{
    "content": [
        {
            "type": "text",
            "text": "# mhlogin(1) (man)\n\n**Summary:** mhlogin - nmh login to external (OAuth) services\n\n**Synopsis:** mhlogin [-help] [-version] [-user username] [-saslmech mechanism] [-authservice service]\n[-browser command] [-snoop]\n\n## Examples\n\n- `First, login to the Gmail account that you want to use, e.g, user@example.com,  using  a  web`\n- `browser.  Then, enter a mhlogin command such as:`\n- `mhlogin -user user@example.com -saslmech xoauth2 -authservice gmail -browser 'google-chrome --new-window'`\n- `The  username  should be a complete email address.  Respond to the prompt in the browser win‐`\n- `dow, then copy and paste the authorization code in response to the mhlogin prompt.`\n\n## See Also\n\n- send(1)\n\n## Section Outline\n\n- **NAME** (2 lines)\n- **SYNOPSIS** (3 lines)\n- **DESCRIPTION** (18 lines)\n- **EXAMPLES** (1 lines) — 1 subsections\n  - Gmail (8 lines)\n- **PROFILE COMPONENTS** (8 lines)\n- **SEE ALSO** (2 lines)\n- **DEFAULTS** (5 lines)\n\n## Full Content\n\n### NAME\n\nmhlogin - nmh login to external (OAuth) services\n\n### SYNOPSIS\n\nmhlogin [-help] [-version] [-user username] [-saslmech mechanism] [-authservice service]\n[-browser command] [-snoop]\n\n### DESCRIPTION\n\nmhlogin currently only supports OAuth  for  Gmail.   Run  mhlogin  -user  username  -saslmech\nxoauth2  -authservice  gmail  and load the printed URL in your browser.  Login to a Gmail ac‐\ncount, grant authorization, and copy and paste the code into the mhlogin prompt.  Be sure  to\nuse  the  same  account with the -user switch to send.  See the EXAMPLES section below for an\nexample.\n\nThe -browser switch causes mhlogin to load the URL directly into a new browser session.   The\ncommand  argument must include the browser invocation name, and can include any browser argu‐\nments in the -browser argument string, e.g., 'google-chrome --new-window'.\n\nThe -snoop switch can be used to view the HTTP transaction.\n\nAll parameters configuring the service may be overridden  by  profile  components,  and  even\nthough  only  Gmail is supported out of the box, the user can define new services entirely in\nthe profile.  Profile components are prefixed by oauth-service-,  for  example,  oauth-gmail-\ncredential-file  which specifies where mhlogin should write credentials and where send should\nread them.\n\n### EXAMPLES\n\n#### Gmail\n\nFirst, login to the Gmail account that you want to use, e.g, user@example.com,  using  a  web\nbrowser.  Then, enter a mhlogin command such as:\n\nmhlogin -user user@example.com -saslmech xoauth2 -authservice gmail -browser 'google-chrome --new-window'\n\nThe  username  should be a complete email address.  Respond to the prompt in the browser win‐\ndow, then copy and paste the authorization code in response to the mhlogin prompt.\n\n### PROFILE COMPONENTS\n\noauth-gmail-credential-file: oauth-gmail\noauth-gmail-clientid:       nmh project clientid\noauth-gmail-clientsecret:   nmh project clientsecret\noauth-gmail-authendpoint:   https://accounts.google.com/o/oauth2/auth\noauth-gmail-redirecturi:    urn:ietf:wg:oauth:2.0:oob\noauth-gmail-tokenendpoint:  https://accounts.google.com/o/oauth2/token\noauth-gmail-scope:           https://mail.google.com/\n\n### SEE ALSO\n\nsend(1)\n\n### DEFAULTS\n\n`-saslmech' xoauth2\n\n\n\nnmh-1.7.1                                    2016-10-10                                 MHLOGIN(1mh)\n\n"
        }
    ],
    "structuredContent": {
        "command": "mhlogin",
        "section": "1",
        "mode": "man",
        "summary": "mhlogin - nmh login to external (OAuth) services",
        "synopsis": "mhlogin [-help] [-version] [-user username] [-saslmech mechanism] [-authservice service]\n[-browser command] [-snoop]",
        "flags": [],
        "examples": [
            "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 win‐",
            "dow, then copy and paste the authorization code in response to the mhlogin prompt."
        ],
        "see_also": [
            {
                "name": "send",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/send/1/json"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 18,
                "subsections": []
            },
            {
                "name": "EXAMPLES",
                "lines": 1,
                "subsections": [
                    {
                        "name": "Gmail",
                        "lines": 8
                    }
                ]
            },
            {
                "name": "PROFILE COMPONENTS",
                "lines": 8,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "DEFAULTS",
                "lines": 5,
                "subsections": []
            }
        ]
    }
}