{
    "content": [
        {
            "type": "text",
            "text": "# MHLOGIN (man)\n\n## NAME\n\nmhlogin - nmh login to external (OAuth) services\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\n## Sections\n\n- **NAME**\n- **SYNOPSIS** (3 subsections)\n- **DESCRIPTION**\n- **EXAMPLES** (1 subsections)\n- **PROFILE COMPONENTS**\n- **SEE ALSO**\n- **DEFAULTS**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "MHLOGIN",
        "section": "",
        "mode": "man",
        "summary": "mhlogin - nmh login to external (OAuth) services",
        "synopsis": "",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "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": 1,
                "subsections": [
                    {
                        "name": "This  implementation is no longer supported but is left here for information.  That's because",
                        "lines": 1
                    },
                    {
                        "name": "Google now only supports POP except with a private client ID.  Also, it  no  longer  supports",
                        "lines": 1
                    },
                    {
                        "name": "OOB requests to Google's OAuth 2.0 authorization endpoint.",
                        "lines": 3
                    }
                ]
            },
            {
                "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": 3,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "mhlogin - nmh login to external (OAuth) services\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "",
                "subsections": [
                    {
                        "name": "This  implementation is no longer supported but is left here for information.  That's because",
                        "content": ""
                    },
                    {
                        "name": "Google now only supports POP except with a private client ID.  Also, it  no  longer  supports",
                        "content": ""
                    },
                    {
                        "name": "OOB requests to Google's OAuth 2.0 authorization endpoint.",
                        "content": "mhlogin [-help] [-version] [-user username] [-saslmech mechanism] [-authservice service]\n[-browser command] [-snoop]\n"
                    }
                ]
            },
            "DESCRIPTION": {
                "content": "mhlogin  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",
                "subsections": []
            },
            "EXAMPLES": {
                "content": "",
                "subsections": [
                    {
                        "name": "Gmail",
                        "content": "First,  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"
                    }
                ]
            },
            "PROFILE COMPONENTS": {
                "content": "oauth-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",
                "subsections": []
            },
            "SEE ALSO": {
                "content": "send(1)\n",
                "subsections": []
            },
            "DEFAULTS": {
                "content": "`-saslmech' xoauth2\n\nnmh-1.8                                      2016-10-10                                 MHLOGIN(1mh)",
                "subsections": []
            }
        }
    }
}