info > MHLOGIN(1mh)

📛 NAME

mhlogin - nmh login to external (OAuth) services

🚀 Quick Reference

Use CaseCommandDescription
🔑 Basic Gmail OAuth login mhlogin -user user@example.com -saslmech xoauth2 -authservice gmail Login to Gmail using OAuth 2.0 with the xoauth2 mechanism
🌐 Login using specific browser mhlogin -user user@example.com -saslmech xoauth2 -authservice gmail -browser 'firefox --new-tab' Open the OAuth URL in a chosen browser instance
🔍 Snoop HTTP traffic mhlogin -user user@example.com -saslmech xoauth2 -authservice gmail -snoop Log the HTTP exchange to debug the OAuth flow
❓ Display help mhlogin -help Show usage summary and all options

📋 SYNOPSIS

mhlogin [-help] [-version] [-user username] [-saslmech mechanism]
     [-authservice service] [-browser command] [-snoop]

📖 DESCRIPTION

🔑 mhlogin currently only supports OAuth for Gmail. Run mhlogin -user username -saslmech xoauth2 -authservice gmail and load the printed URL in your browser. Login to a Gmail account, grant authorization, and copy and paste the code into the mhlogin prompt. Be sure to use the same account with the -user switch to send. See the EXAMPLES section below for an example.

🌐 The -browser switch causes mhlogin to load the URL directly into a new browser session. The command argument must include the browser invocation name, and can include any browser arguments in the -browser argument string, e.g., 'google-chrome --new-window'.

🔍 The -snoop switch can be used to view the HTTP transaction.

All parameters configuring the service may be overridden by profile components, and even though only Gmail is supported out of the box, the user can define new services entirely in the profile. Profile components are prefixed by oauth-service-, for example, oauth-gmail-credential-file which specifies where mhlogin should write credentials and where send should read them.

💡 EXAMPLES

📧 Gmail

First, login to the Gmail account that you want to use, e.g., user@example.com, using a web browser. Then, enter a mhlogin command such as:

mhlogin -user user AT example.com -saslmech xoauth2 -authservice gmail -browser 'google-chrome --new-window'

The username should be a complete email address. Respond to the prompt in the browser window, then copy and paste the authorization code in response to the mhlogin prompt.

🔧 PROFILE COMPONENTS

🔗 SEE ALSO

send(1)

⚙️ DEFAULTS

Default -saslmech: xoauth2

MHLOGIN(1mh)
📛 NAME 🚀 Quick Reference 📋 SYNOPSIS 📖 DESCRIPTION 💡 EXAMPLES
📧 Gmail
🔧 PROFILE COMPONENTS 🔗 SEE ALSO ⚙️ DEFAULTS

Generated by phpman v4.9.26-1-g511901d Author: Che Dong Under GNU General Public License
2026-08-08 17:13 @216.73.216.150
CrawledBy Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
Valid XHTML 1.0 Transitional!Valid CSS!
Enhanced by LLM: deepseek-v4-flash / taotoken.net / www.chedong.com - original format