]> diplodocus.org Git - nmh/blob - man/mhlogin.man
Move things around so you can still initialize netsec with SASL
[nmh] / man / mhlogin.man
1 .\"
2 .\" %nmhwarning%
3 .\"
4 .TH MHLOGIN %manext1% "September 11, 2016" "%nmhversion%"
5 .SH NAME
6 mhlogin \- login to external (OAuth) services
7 .SH SYNOPSIS
8 .HP 5
9 .na
10 .B mhlogin
11 .RB [ \-user
12 .IR username ]
13 .RB [ \-saslmech
14 .IR mechanism ]
15 .RB [ \-authservice
16 .IR service ]
17 .RB [ \-browser
18 .IR command ]
19 .RB [ \-snoop ]
20 .RB [ \-version ]
21 .RB [ \-help ]
22 .ad
23 .SH DESCRIPTION
24 .B Mhlogin
25 currently only supports OAuth for Gmail. Run
26 .B mhlogin
27 .B \-user
28 .I username
29 .B \-saslmech xoauth2
30 .B \-authservice
31 .I gmail
32 and load the printed URL in your browser. Login to a Gmail account, grant
33 authorization, and copy and paste the code into the
34 .B mhlogin
35 prompt. Be sure to use the same account with the
36 .B -user
37 switch to
38 .BR send .
39 .PP
40 The
41 .B \-browser
42 switch causes
43 .B mhlogin
44 to load the URL directly into a new browser session. The command argument
45 must include the browser invocation name, and can include any browser arguments
46 in the
47 .B \-browser
48 argument string, e.g., 'google-chrome --new-window'.
49 .PP
50 The
51 .B \-snoop
52 switch can be used to view the HTTP transaction.
53 .PP
54 All parameters configuring the service may be overridden by profile components,
55 and even though only Gmail is supported out of the box, the user can define
56 new services entirely in the profile. Profile components are prefixed by
57 .IR oauth-service- ,
58 for example,
59 .I oauth-gmail-credential-file
60 which specifies where
61 .B mhlogin
62 should write credentials and where
63 .B send
64 should read them.
65 .SH "EXAMPLES"
66 .PP
67 .SS Gmail
68 First, login to the Gmail account that you want to use, e.g, user@example.com,
69 using a web browser.
70 Then, enter a
71 .B mhlogin
72 command such as:
73 .PP
74 .RS
75 .nf
76 mhlogin -user user@example.com -saslmech xoauth2 -authservice gmail \
77 -browser 'google-chrome --new-window'
78 .fi
79 .RE
80 .PP
81 Respond to the prompt in the browser window, then copy and paste the
82 authorization code in response to the
83 .B mhlogin
84 prompt.
85 .SH "PROFILE COMPONENTS"
86 .fc ^ ~
87 .nf
88 .ta 2.4i
89 .ta \w'ExtraBigProfileName 'u
90 ^oauth-gmail-credential-file:~^oauth-gmail
91 ^oauth-gmail-client_id:~^nmh project client_id
92 ^oauth-gmail-client_secret:~^nmh project client_secret
93 ^oauth-gmail-auth_endpoint:~^https://accounts.google.com/o/oauth2/auth
94 ^oauth-gmail-redirect_uri:~^urn:ietf:wg:oauth:2.0:oob
95 ^oauth-gmail-token_endpoint:~^https://accounts.google.com/o/oauth2/token
96 ^oauth-gmail-scope:~^https://mail.google.com/
97 .fi
98 .SH "SEE ALSO"
99 .IR send (1)
100 .SH DEFAULTS
101 .nf
102 .RB ` \-saslmech "' xoauth2"
103 .fi