1MHLOGIN(1)                  General Commands Manual                 MHLOGIN(1)
2
3
4

NAME

6       mhlogin - nmh login to external (OAuth) services
7

SYNOPSIS

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

DESCRIPTION

13       mhlogin currently only supports OAuth for  Gmail.   Run  mhlogin  -user
14       username  -saslmech xoauth2 -authservice gmail and load the printed URL
15       in your browser.  Login to a Gmail account,  grant  authorization,  and
16       copy  and  paste  the code into the mhlogin prompt.  Be sure to use the
17       same account with the -user switch to send.  See the  EXAMPLES  section
18       below for an example.
19
20       The  -browser switch causes mhlogin to load the URL directly into a new
21       browser session.  The command argument must include the browser invoca‐
22       tion  name, and can include any browser arguments in the -browser argu‐
23       ment string, e.g., 'google-chrome --new-window'.
24
25       The -snoop switch can be used to view the HTTP transaction.
26
27       All parameters configuring the service may  be  overridden  by  profile
28       components, and even though only Gmail is supported out of the box, the
29       user can define new services entirely in the profile.   Profile  compo‐
30       nents  are prefixed by oauth-service-, for example, oauth-gmail-creden‐
31       tial-file which specifies where mhlogin should  write  credentials  and
32       where send should read them.
33

EXAMPLES

35   Gmail
36       First, login to the Gmail account that you want to use, e.g, user@exam‐
37       ple.com, using a web browser.  Then, enter a mhlogin command such as:
38
39              mhlogin -user user@example.com -saslmech xoauth2 -authservice gmail -browser 'google-chrome --new-window'
40
41       The username should be a complete email address.  Respond to the prompt
42       in  the  browser  window, then copy and paste the authorization code in
43       response to the mhlogin prompt.
44

PROFILE COMPONENTS

46       oauth-gmail-credential-file: oauth-gmail
47       oauth-gmail-client_id:       nmh project client_id
48       oauth-gmail-client_secret:   nmh project client_secret
49       oauth-gmail-auth_endpoint:   https://accounts.google.com/o/oauth2/auth
50       oauth-gmail-redirect_uri:    urn:ietf:wg:oauth:2.0:oob
51       oauth-gmail-token_endpoint:  https://accounts.google.com/o/oauth2/token
52       oauth-gmail-scope:           https://mail.google.com/
53

SEE ALSO

55       send(1)
56

DEFAULTS

58       `-saslmech' xoauth2
59
60
61
62nmh-1.7.1                         2016-10-10                        MHLOGIN(1)
Impressum