MHLOGIN(1mh)

πŸ“¦
version 1.8 Β· 3 versions
, in debian trixie, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– MHLOGIN πŸ’–

okay bestie, welcome to mhlogin from the nmh fam β€” it's the one that handles logging you into external (OAuth) services. yes, that kind of login. grab a snack, we're doing auth ✨


🌸 NAME 🌸

mhlogin β€” nmh login to external (OAuth) services 🫢


✨ SYNOPSIS ✨

okay so real talk first, no cap: this implementation is no longer supported, but it's still sitting here for information purposes. why? two reasons, bestie:

  • Google now only supports POP except with a private client ID 😭
  • it also no longer supports OOB requests to Google's OAuth 2.0 authorization endpoint πŸ’€

here's the shape of the thing:

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

πŸ‘‘ DESCRIPTION πŸ‘‘

so rn mhlogin only supports OAuth for Gmail. that's it, that's the whole roster.

run

mhlogin -user username -saslmech xoauth2 -authservice gmail

and then load the printed URL in your browser. login to a Gmail account, grant authorization, and copy-paste the code into the mhlogin prompt. πŸŽ€

important bestie: be sure to use the same account with the -user switch to send. the vibes must match. ✨

there's a whole example down in EXAMPLES if you want the visual, keep scrolling πŸ’…

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 it can include any browser arguments in the -browser argument string, e.g., 'google-chrome --new-window'. iconic.

The -snoop switch can be used to view the HTTP transaction. peek behind the curtain, you nosy queen πŸ‘€

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. main character energy fr fr.

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@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. slay, you did it πŸ’…βœ¨


πŸŽ€ PROFILE COMPONENTS πŸŽ€

here's the whole lineup, no skips, no shortcuts:

oauth-gmail-credential-file: oauth-gmail
oauth-gmail-client_id:       nmh project client_id
oauth-gmail-client_secret:   nmh project client_secret
oauth-gmail-auth_endpoint:   https://accounts.google.com/o/oauth2/auth
oauth-gmail-redirect_uri:    urn:ietf:wg:oauth:2.0:oob
oauth-gmail-token_endpoint:  https://accounts.google.com/o/oauth2/token
oauth-gmail-scope:           https://mail.google.com/

πŸ¦‹ SEE ALSO πŸ¦‹


⭐ DEFAULTS ⭐

  • -saslmech β€” xoauth2

and that's the whole page bestie, you ate that πŸ“

mhlogin ships with nmh-1.8, dated 2016-10-10. yes, it's giving vintage. still iconic tho πŸ’–βœ¨πŸ‘‘
πŸ“¦ where this page comes from