Gmail blocking mutt











up vote
44
down vote

favorite
12












When I try to log in to gmail with mutt, it flashes a quick Webalert with a url, something like accounts.gmail.com or something. It's too quick for me to see or copy it. Then it says Login failed.



Then I get an email from Gmail saying:



Google Account: sign-in attempt blocked

Hi Adam,

We recently blocked a sign-in attempt to your Google Account [a...@gmail.com].

Sign in attempt details
Date & Time: Wednesday, December 10, 2014 11:55:21 PM UTC
Location: Utah, USA

If this wasn't you
Please review your Account Activity page at https://security.google.com/settings/security/activity to see if anything looks suspicious. Whoever tried to sign in to your account knows your password; we recommend that you change it right away.

If this was you
You can switch to an app made by Google such as Gmail to access your account (recommended) or change your settings at https://www.google.com/settings/security/lesssecureapps so that your account is no longer protected by modern security standards.

To learn more, see https://support.google.com/accounts/answer/6010255.

Sincerely,
The Google Accounts team


I can go to the link and enable "Access for less secure apps" and then I can log in just fine, but is there a way to login with mutt without having to turn on this less secure option in Gmail?



Update:



I'm on mac os x Yosemite
When I run mutt -v, in the compile options, it does contain +USE_SSL_OPENSSL
I'm not using google 2-step verification
I'm not using an application specific password
Here are the messages that I get when I try to log in:



Reading imaps://imap.gmail.com:993/INBOX...
Looking up imap.gmail.com...
Connecting to imap.gmail.com...
TLSv1.2 connection using TLSv1/SSLv3 (ECDHE-RSA-AES128-GCM-SHA256)
Logging in...
[WEBALERT https://accounts.google.com/ContinueSignIn?sarp=1&scc=1&plt=AKgnsbsm0P......


I found this answer, but it didn't work: https://stackoverflow.com/a/25209735/1665818










share|improve this question
























  • Do you have 2-factor authentication turned on in gmail? If so mutt won't be able to log in that way. You'll have to generate an application key for mutt to use to log in instead.
    – jw013
    Dec 11 '14 at 3:00










  • I don't have 2-factor authentication turned on.
    – aharris88
    Dec 11 '14 at 5:15






  • 1




    hello, i experience the same problems. would be great if someone has a solution to use mutt with gmail and keep the standard security settings for the gmail account.
    – linluk
    Dec 12 '14 at 20:24










  • Are you using an application specific password? I haven't run into this issue yet.
    – Caleb
    Dec 13 '14 at 19:13










  • No, I'm not using an application specific password.
    – aharris88
    Dec 13 '14 at 23:46















up vote
44
down vote

favorite
12












When I try to log in to gmail with mutt, it flashes a quick Webalert with a url, something like accounts.gmail.com or something. It's too quick for me to see or copy it. Then it says Login failed.



Then I get an email from Gmail saying:



Google Account: sign-in attempt blocked

Hi Adam,

We recently blocked a sign-in attempt to your Google Account [a...@gmail.com].

Sign in attempt details
Date & Time: Wednesday, December 10, 2014 11:55:21 PM UTC
Location: Utah, USA

If this wasn't you
Please review your Account Activity page at https://security.google.com/settings/security/activity to see if anything looks suspicious. Whoever tried to sign in to your account knows your password; we recommend that you change it right away.

If this was you
You can switch to an app made by Google such as Gmail to access your account (recommended) or change your settings at https://www.google.com/settings/security/lesssecureapps so that your account is no longer protected by modern security standards.

To learn more, see https://support.google.com/accounts/answer/6010255.

Sincerely,
The Google Accounts team


I can go to the link and enable "Access for less secure apps" and then I can log in just fine, but is there a way to login with mutt without having to turn on this less secure option in Gmail?



Update:



I'm on mac os x Yosemite
When I run mutt -v, in the compile options, it does contain +USE_SSL_OPENSSL
I'm not using google 2-step verification
I'm not using an application specific password
Here are the messages that I get when I try to log in:



Reading imaps://imap.gmail.com:993/INBOX...
Looking up imap.gmail.com...
Connecting to imap.gmail.com...
TLSv1.2 connection using TLSv1/SSLv3 (ECDHE-RSA-AES128-GCM-SHA256)
Logging in...
[WEBALERT https://accounts.google.com/ContinueSignIn?sarp=1&scc=1&plt=AKgnsbsm0P......


I found this answer, but it didn't work: https://stackoverflow.com/a/25209735/1665818










share|improve this question
























  • Do you have 2-factor authentication turned on in gmail? If so mutt won't be able to log in that way. You'll have to generate an application key for mutt to use to log in instead.
    – jw013
    Dec 11 '14 at 3:00










  • I don't have 2-factor authentication turned on.
    – aharris88
    Dec 11 '14 at 5:15






  • 1




    hello, i experience the same problems. would be great if someone has a solution to use mutt with gmail and keep the standard security settings for the gmail account.
    – linluk
    Dec 12 '14 at 20:24










  • Are you using an application specific password? I haven't run into this issue yet.
    – Caleb
    Dec 13 '14 at 19:13










  • No, I'm not using an application specific password.
    – aharris88
    Dec 13 '14 at 23:46













up vote
44
down vote

favorite
12









up vote
44
down vote

favorite
12






12





When I try to log in to gmail with mutt, it flashes a quick Webalert with a url, something like accounts.gmail.com or something. It's too quick for me to see or copy it. Then it says Login failed.



Then I get an email from Gmail saying:



Google Account: sign-in attempt blocked

Hi Adam,

We recently blocked a sign-in attempt to your Google Account [a...@gmail.com].

Sign in attempt details
Date & Time: Wednesday, December 10, 2014 11:55:21 PM UTC
Location: Utah, USA

If this wasn't you
Please review your Account Activity page at https://security.google.com/settings/security/activity to see if anything looks suspicious. Whoever tried to sign in to your account knows your password; we recommend that you change it right away.

If this was you
You can switch to an app made by Google such as Gmail to access your account (recommended) or change your settings at https://www.google.com/settings/security/lesssecureapps so that your account is no longer protected by modern security standards.

To learn more, see https://support.google.com/accounts/answer/6010255.

Sincerely,
The Google Accounts team


I can go to the link and enable "Access for less secure apps" and then I can log in just fine, but is there a way to login with mutt without having to turn on this less secure option in Gmail?



Update:



I'm on mac os x Yosemite
When I run mutt -v, in the compile options, it does contain +USE_SSL_OPENSSL
I'm not using google 2-step verification
I'm not using an application specific password
Here are the messages that I get when I try to log in:



Reading imaps://imap.gmail.com:993/INBOX...
Looking up imap.gmail.com...
Connecting to imap.gmail.com...
TLSv1.2 connection using TLSv1/SSLv3 (ECDHE-RSA-AES128-GCM-SHA256)
Logging in...
[WEBALERT https://accounts.google.com/ContinueSignIn?sarp=1&scc=1&plt=AKgnsbsm0P......


I found this answer, but it didn't work: https://stackoverflow.com/a/25209735/1665818










share|improve this question















When I try to log in to gmail with mutt, it flashes a quick Webalert with a url, something like accounts.gmail.com or something. It's too quick for me to see or copy it. Then it says Login failed.



Then I get an email from Gmail saying:



Google Account: sign-in attempt blocked

Hi Adam,

We recently blocked a sign-in attempt to your Google Account [a...@gmail.com].

Sign in attempt details
Date & Time: Wednesday, December 10, 2014 11:55:21 PM UTC
Location: Utah, USA

If this wasn't you
Please review your Account Activity page at https://security.google.com/settings/security/activity to see if anything looks suspicious. Whoever tried to sign in to your account knows your password; we recommend that you change it right away.

If this was you
You can switch to an app made by Google such as Gmail to access your account (recommended) or change your settings at https://www.google.com/settings/security/lesssecureapps so that your account is no longer protected by modern security standards.

To learn more, see https://support.google.com/accounts/answer/6010255.

Sincerely,
The Google Accounts team


I can go to the link and enable "Access for less secure apps" and then I can log in just fine, but is there a way to login with mutt without having to turn on this less secure option in Gmail?



Update:



I'm on mac os x Yosemite
When I run mutt -v, in the compile options, it does contain +USE_SSL_OPENSSL
I'm not using google 2-step verification
I'm not using an application specific password
Here are the messages that I get when I try to log in:



Reading imaps://imap.gmail.com:993/INBOX...
Looking up imap.gmail.com...
Connecting to imap.gmail.com...
TLSv1.2 connection using TLSv1/SSLv3 (ECDHE-RSA-AES128-GCM-SHA256)
Logging in...
[WEBALERT https://accounts.google.com/ContinueSignIn?sarp=1&scc=1&plt=AKgnsbsm0P......


I found this answer, but it didn't work: https://stackoverflow.com/a/25209735/1665818







email authentication mutt imap






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited May 23 '17 at 12:39









Community

1




1










asked Dec 11 '14 at 0:12









aharris88

5711513




5711513












  • Do you have 2-factor authentication turned on in gmail? If so mutt won't be able to log in that way. You'll have to generate an application key for mutt to use to log in instead.
    – jw013
    Dec 11 '14 at 3:00










  • I don't have 2-factor authentication turned on.
    – aharris88
    Dec 11 '14 at 5:15






  • 1




    hello, i experience the same problems. would be great if someone has a solution to use mutt with gmail and keep the standard security settings for the gmail account.
    – linluk
    Dec 12 '14 at 20:24










  • Are you using an application specific password? I haven't run into this issue yet.
    – Caleb
    Dec 13 '14 at 19:13










  • No, I'm not using an application specific password.
    – aharris88
    Dec 13 '14 at 23:46


















  • Do you have 2-factor authentication turned on in gmail? If so mutt won't be able to log in that way. You'll have to generate an application key for mutt to use to log in instead.
    – jw013
    Dec 11 '14 at 3:00










  • I don't have 2-factor authentication turned on.
    – aharris88
    Dec 11 '14 at 5:15






  • 1




    hello, i experience the same problems. would be great if someone has a solution to use mutt with gmail and keep the standard security settings for the gmail account.
    – linluk
    Dec 12 '14 at 20:24










  • Are you using an application specific password? I haven't run into this issue yet.
    – Caleb
    Dec 13 '14 at 19:13










  • No, I'm not using an application specific password.
    – aharris88
    Dec 13 '14 at 23:46
















Do you have 2-factor authentication turned on in gmail? If so mutt won't be able to log in that way. You'll have to generate an application key for mutt to use to log in instead.
– jw013
Dec 11 '14 at 3:00




Do you have 2-factor authentication turned on in gmail? If so mutt won't be able to log in that way. You'll have to generate an application key for mutt to use to log in instead.
– jw013
Dec 11 '14 at 3:00












I don't have 2-factor authentication turned on.
– aharris88
Dec 11 '14 at 5:15




I don't have 2-factor authentication turned on.
– aharris88
Dec 11 '14 at 5:15




1




1




hello, i experience the same problems. would be great if someone has a solution to use mutt with gmail and keep the standard security settings for the gmail account.
– linluk
Dec 12 '14 at 20:24




hello, i experience the same problems. would be great if someone has a solution to use mutt with gmail and keep the standard security settings for the gmail account.
– linluk
Dec 12 '14 at 20:24












Are you using an application specific password? I haven't run into this issue yet.
– Caleb
Dec 13 '14 at 19:13




Are you using an application specific password? I haven't run into this issue yet.
– Caleb
Dec 13 '14 at 19:13












No, I'm not using an application specific password.
– aharris88
Dec 13 '14 at 23:46




No, I'm not using an application specific password.
– aharris88
Dec 13 '14 at 23:46










6 Answers
6






active

oldest

votes

















up vote
23
down vote













As one of the comments says it looks like Google have moved to blocking apps that are using IMAP/SMTP PLAIN authentication by default and you can read official blogs stating that Google strongly recommends IMAP/SMTP protocol users switch to OAuth 2.0 (as XMPP is also listed I wonder if (older?) OSX iChat will stop working with GTalk at some point). Elsewhere, there's some fun speculation as to the rationale for this change. At the time of writing anecdotal investigation suggests:




  • Google business accounts won't see this issue - they continue to automatically accept password based IMAP/SMTP logins and there's currently no setting to refuse them (can't be causing trouble for all those paying users with programs using "legacy" password logins eh?).

  • Non-"business" Google accounts now have a setting to allow or disallow password based IMAP/SMTP logins ("less secure apps"). Google accounts that have existed for years can automatically have opted to disallow but this might not happen to everyone.


I've tried first logging into GMail using a web browser then using mutt from the same machine. I've tried changing muttrc settings to ensure TLS is always used. I've tried the unlock captcha link. All have failed to let my mutt work with a "do not allow less secure apps" GMail account (but may solve login problems in different scenarios). Your choices are:




  • Switch your Google account to require 2-step verification and create an app-specific password for mutt.

  • Use the Google account setting that allows less secure apps to connect.

  • Move to another IMAP client that does OAuth.

  • Create a patch for mutt to support OAuth.


(Whoever voted up my original reply - thank you)






share|improve this answer



















  • 1




    How do app specific passwords fit into the mix? If you use an app specific password can you leave "allow less secure apps to connect" off and still use PLAIN / Basic Authentication without the warning?
    – jla
    May 8 '15 at 17:20






  • 2




    Using an app-specific password with @hampercm's setup circumvents this issue. - security.google.com/settings/security/apppasswords
    – Yoshua Wuyts
    Sep 27 '15 at 7:15


















up vote
22
down vote



accepted










I finally got it to work by enabling Google 2-step verification and using an app-specific password for mutt.



More detail:



I enabled 2-step verification on my Google account, which means that when I log in to Google, I have to enter a pin number from either a text or from the Google Authenticator app.



Then I had to get an app-specific password for mutt. You can generate an app specific password here.



Then I used that app-specific password for logging into mutt instead of my normal password. And then I don't have to enter a pin number.






share|improve this answer























  • could you elaborate on this more please?
    – tetris11
    Dec 8 '15 at 22:56






  • 1




    Ok, I added more detail. Hope that helps.
    – aharris88
    Dec 8 '15 at 23:39






  • 1




    Still working and saving hours all around the world. Thanks @aharris88
    – Bernardo Sulzbach
    Sep 25 '16 at 22:42


















up vote
6
down vote













Judging by aharris88's description, Gmail was blocking access to his account via mutt because mutt is using insecure connections when communicating with Gmail's servers. This means that your username and password are being sent across the local network and the Internet in an unencrypted form; generally a really bad idea, and something to be avoided whenever possible. Gmail was attempting to discourage this risky configuration by rejecting mutt's connection attempt. Changing your Google account settings to allow "Access for less secure apps" overrode this behavior, allowing mutt to connect in an insecure fashion.



One solution for this is to configure mutt to use TLS security when connecting to Gmail. This way, your credentials aren't sent in plain-text form, and you can thus disable "Access for less secure apps" in your Google account settings.



To use TLS, edit your mutt configuration file (~/.muttrc) to be similar to the following:



set realname = 'Your Full Name'
set imap_user = 'youraccount@gmail.com'
set smtp_url = "smtp://youraccount@smtp.gmail.com:587/"
set spoolfile = imaps://imap.gmail.com:993/INBOX
set folder = "imaps://imap.gmail.com:993"
set record="+[Gmail]/Sent Mail"
set postponed="+[Gmail]/Drafts"
set header_cache="~/.mutt/cache/headers"
set message_cachedir="~/.mutt/cache/bodies"
set certificate_file=~/.mutt/certificates

# These two lines appear to be needed on some Linux distros, like Arch Linux
set ssl_starttls = yes
set ssl_force_tls = yes


Also, create the directories and files mutt will use to cache message information and store certificates by executing:



mkdir -p ~/.mutt/cache/bodies
mkdir ~/.mutt/cache/headers
touch ~/.mutt/certificates


Lines 3-5 of the mutt configuration file tell mutt to connect to Gmail using secure ports and protocols. Make sure you fill in 'Your Full Name' on line 1, and replace "youraccount" in both lines 2 and 3. The last two lines will force mutt to connect securely, and may be required on some Linux distributions. The rest of the configuration is a pretty common setup to make mutt play nice with Gmail.



You'll also need to have OpenSSL (or something equivalent) installed on your system, though most systems will probably already have this.



Now, start mutt. You'll be prompted for your Gmail account password. You may also be prompted to accept a certificate that the Gmail server will send you; go ahead and do so. If you see your inbox, you should be all set!



If it's still not connecting, something else is preventing mutt from connecting securely. Try executing: mutt -v to display mutt's version and compile options. In the "Compile options" section of the output, look for +USE_SSL or something similar like +USE_SSL_OPENSSL or +USE_SSL_GNUTLS. If none of these appear with a plus next to them, then mutt was compiled without the ability to connect with TLS, and you'd need to recompile it.



Another possibility is that OpenSSL (or an equivalent SSL package) is not yet installed on your system. The method of installing it will be dependent on which Linux/Unix distribution you are using. Try searching for guides specific to your distribution. You may also need to install an additional package containing Certificate Authorities.



Once you do get things working, if you don't want to type your Gmail password every time you run mutt, you can store it directly in the ~/.muttrc file by adding a line like:



set imap_pass = 'yourpassword'


Note, however, that this presents a security risk, particularly if you share a system with other users. To reduce this risk, you can make ~/.muttrc readable only by you by executing:



chmod 600 ~/.muttrc


This prevents non-root users and services running on your system from reading your password stored in the ~/.muttrc file.






share|improve this answer



















  • 2




    this doesn't solves the problem, its the same configuration i have. you have to allow insecure apps in your gmail settings to use mutt this way. but we want to use it (f possible) with the standard security settings. thanks anyway.
    – linluk
    Dec 13 '14 at 10:00










  • Make sure that smtp_url, spoolfile, and folder are being set exactly as specified above, except of course replacing 'youraccount' with your account name. These are the key lines. And, make sure those aren't being set to something else further down in the file. I've also augmented my answer to address a couple other possibilities. Using the two lines I added at the bottom of the configuration file given above may help. Otherwise, you may need to install a SSL implementation or recompile mutt.
    – hampercm
    Dec 13 '14 at 16:31






  • 1




    It still didn't work. That was almost the exact same stuff I already had in my .muttrc. But I had extra stuff. I deleted the other stuff just in case. I didn't add the ssl part because I'm on mac. Also, the messages I'm getting looks like it's using ssl already.
    – aharris88
    Dec 14 '14 at 0:15










  • Hmmm. I have very little personal experience with MacOS, so unfortunately I may not be of much help for your issue. Did you create the ~/.mutt/ subdirectories and files using the mkdir and touch commands as described above? Those appear to be necessary on some -nixes. Other than that, I don't have much more to suggest, other than doing some web searches specific to mutt and Gmail on Mac OS. Several search hits talk about using "MacPorts" to install mutt variants.
    – hampercm
    Dec 14 '14 at 16:47








  • 2




    I ran across some info that may explain things. This suggests that OAuth 2.0 is required for ALL access from external apps, even over secure connections. I checked my Google settings and found I had enabled less secure apps in the past for some other reason, and forgot about it, which is why my mutt access was working bonks head with palm :( It appears you can use SASL XOAUTH2 to get around needing the "less secure" option, but may not be worth the time invested for a small? security boost.
    – hampercm
    Dec 22 '14 at 18:28




















up vote
1
down vote













Create an app specific password for mutt:
https://support.google.com/accounts/answer/185833
https://security.google.com/settings/security/apppasswords






share|improve this answer

















  • 1




    I'm not using google 2-step verification.
    – aharris88
    Sep 16 '15 at 13:53










  • Oh, I thought you could use app specific passwords with or without 2-step verification. I guess this is something to consider for those who have setup the 2-step verification.
    – twolfe18
    Sep 16 '15 at 15:10


















up vote
1
down vote













Mutt now officially supports OAuth specifically targeting issues with Gmail.






share|improve this answer





















  • I think it's better if you try to add at least some of the instructions for how to use OAuth in with gmail to your answer. link only answers become invalid if the url changes. or the file moves.
    – yukashima huksay
    yesterday


















up vote
0
down vote













OK. So after a long time debugging this, I found this post that gives the real solution.



If you have the said problem, and aren't using 2-factor auth, you need to login to the web version of Gmail and then go to:



https://accounts.google.com/b/0/DisplayUnlockCaptcha



Now, try Mutt - it should login now.






share|improve this answer





















  • In my question, I've already linked to this answer, which says the same thing, but it doesn't work. stackoverflow.com/questions/25209676/…
    – aharris88
    Mar 13 '15 at 0:21










  • Indeed, this didn't help for me, either.
    – reinierpost
    Dec 11 '15 at 14:32











Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "106"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f172666%2fgmail-blocking-mutt%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























6 Answers
6






active

oldest

votes








6 Answers
6






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
23
down vote













As one of the comments says it looks like Google have moved to blocking apps that are using IMAP/SMTP PLAIN authentication by default and you can read official blogs stating that Google strongly recommends IMAP/SMTP protocol users switch to OAuth 2.0 (as XMPP is also listed I wonder if (older?) OSX iChat will stop working with GTalk at some point). Elsewhere, there's some fun speculation as to the rationale for this change. At the time of writing anecdotal investigation suggests:




  • Google business accounts won't see this issue - they continue to automatically accept password based IMAP/SMTP logins and there's currently no setting to refuse them (can't be causing trouble for all those paying users with programs using "legacy" password logins eh?).

  • Non-"business" Google accounts now have a setting to allow or disallow password based IMAP/SMTP logins ("less secure apps"). Google accounts that have existed for years can automatically have opted to disallow but this might not happen to everyone.


I've tried first logging into GMail using a web browser then using mutt from the same machine. I've tried changing muttrc settings to ensure TLS is always used. I've tried the unlock captcha link. All have failed to let my mutt work with a "do not allow less secure apps" GMail account (but may solve login problems in different scenarios). Your choices are:




  • Switch your Google account to require 2-step verification and create an app-specific password for mutt.

  • Use the Google account setting that allows less secure apps to connect.

  • Move to another IMAP client that does OAuth.

  • Create a patch for mutt to support OAuth.


(Whoever voted up my original reply - thank you)






share|improve this answer



















  • 1




    How do app specific passwords fit into the mix? If you use an app specific password can you leave "allow less secure apps to connect" off and still use PLAIN / Basic Authentication without the warning?
    – jla
    May 8 '15 at 17:20






  • 2




    Using an app-specific password with @hampercm's setup circumvents this issue. - security.google.com/settings/security/apppasswords
    – Yoshua Wuyts
    Sep 27 '15 at 7:15















up vote
23
down vote













As one of the comments says it looks like Google have moved to blocking apps that are using IMAP/SMTP PLAIN authentication by default and you can read official blogs stating that Google strongly recommends IMAP/SMTP protocol users switch to OAuth 2.0 (as XMPP is also listed I wonder if (older?) OSX iChat will stop working with GTalk at some point). Elsewhere, there's some fun speculation as to the rationale for this change. At the time of writing anecdotal investigation suggests:




  • Google business accounts won't see this issue - they continue to automatically accept password based IMAP/SMTP logins and there's currently no setting to refuse them (can't be causing trouble for all those paying users with programs using "legacy" password logins eh?).

  • Non-"business" Google accounts now have a setting to allow or disallow password based IMAP/SMTP logins ("less secure apps"). Google accounts that have existed for years can automatically have opted to disallow but this might not happen to everyone.


I've tried first logging into GMail using a web browser then using mutt from the same machine. I've tried changing muttrc settings to ensure TLS is always used. I've tried the unlock captcha link. All have failed to let my mutt work with a "do not allow less secure apps" GMail account (but may solve login problems in different scenarios). Your choices are:




  • Switch your Google account to require 2-step verification and create an app-specific password for mutt.

  • Use the Google account setting that allows less secure apps to connect.

  • Move to another IMAP client that does OAuth.

  • Create a patch for mutt to support OAuth.


(Whoever voted up my original reply - thank you)






share|improve this answer



















  • 1




    How do app specific passwords fit into the mix? If you use an app specific password can you leave "allow less secure apps to connect" off and still use PLAIN / Basic Authentication without the warning?
    – jla
    May 8 '15 at 17:20






  • 2




    Using an app-specific password with @hampercm's setup circumvents this issue. - security.google.com/settings/security/apppasswords
    – Yoshua Wuyts
    Sep 27 '15 at 7:15













up vote
23
down vote










up vote
23
down vote









As one of the comments says it looks like Google have moved to blocking apps that are using IMAP/SMTP PLAIN authentication by default and you can read official blogs stating that Google strongly recommends IMAP/SMTP protocol users switch to OAuth 2.0 (as XMPP is also listed I wonder if (older?) OSX iChat will stop working with GTalk at some point). Elsewhere, there's some fun speculation as to the rationale for this change. At the time of writing anecdotal investigation suggests:




  • Google business accounts won't see this issue - they continue to automatically accept password based IMAP/SMTP logins and there's currently no setting to refuse them (can't be causing trouble for all those paying users with programs using "legacy" password logins eh?).

  • Non-"business" Google accounts now have a setting to allow or disallow password based IMAP/SMTP logins ("less secure apps"). Google accounts that have existed for years can automatically have opted to disallow but this might not happen to everyone.


I've tried first logging into GMail using a web browser then using mutt from the same machine. I've tried changing muttrc settings to ensure TLS is always used. I've tried the unlock captcha link. All have failed to let my mutt work with a "do not allow less secure apps" GMail account (but may solve login problems in different scenarios). Your choices are:




  • Switch your Google account to require 2-step verification and create an app-specific password for mutt.

  • Use the Google account setting that allows less secure apps to connect.

  • Move to another IMAP client that does OAuth.

  • Create a patch for mutt to support OAuth.


(Whoever voted up my original reply - thank you)






share|improve this answer














As one of the comments says it looks like Google have moved to blocking apps that are using IMAP/SMTP PLAIN authentication by default and you can read official blogs stating that Google strongly recommends IMAP/SMTP protocol users switch to OAuth 2.0 (as XMPP is also listed I wonder if (older?) OSX iChat will stop working with GTalk at some point). Elsewhere, there's some fun speculation as to the rationale for this change. At the time of writing anecdotal investigation suggests:




  • Google business accounts won't see this issue - they continue to automatically accept password based IMAP/SMTP logins and there's currently no setting to refuse them (can't be causing trouble for all those paying users with programs using "legacy" password logins eh?).

  • Non-"business" Google accounts now have a setting to allow or disallow password based IMAP/SMTP logins ("less secure apps"). Google accounts that have existed for years can automatically have opted to disallow but this might not happen to everyone.


I've tried first logging into GMail using a web browser then using mutt from the same machine. I've tried changing muttrc settings to ensure TLS is always used. I've tried the unlock captcha link. All have failed to let my mutt work with a "do not allow less secure apps" GMail account (but may solve login problems in different scenarios). Your choices are:




  • Switch your Google account to require 2-step verification and create an app-specific password for mutt.

  • Use the Google account setting that allows less secure apps to connect.

  • Move to another IMAP client that does OAuth.

  • Create a patch for mutt to support OAuth.


(Whoever voted up my original reply - thank you)







share|improve this answer














share|improve this answer



share|improve this answer








edited Jun 9 at 6:56

























answered Apr 3 '15 at 16:21









Anon

1,4221118




1,4221118








  • 1




    How do app specific passwords fit into the mix? If you use an app specific password can you leave "allow less secure apps to connect" off and still use PLAIN / Basic Authentication without the warning?
    – jla
    May 8 '15 at 17:20






  • 2




    Using an app-specific password with @hampercm's setup circumvents this issue. - security.google.com/settings/security/apppasswords
    – Yoshua Wuyts
    Sep 27 '15 at 7:15














  • 1




    How do app specific passwords fit into the mix? If you use an app specific password can you leave "allow less secure apps to connect" off and still use PLAIN / Basic Authentication without the warning?
    – jla
    May 8 '15 at 17:20






  • 2




    Using an app-specific password with @hampercm's setup circumvents this issue. - security.google.com/settings/security/apppasswords
    – Yoshua Wuyts
    Sep 27 '15 at 7:15








1




1




How do app specific passwords fit into the mix? If you use an app specific password can you leave "allow less secure apps to connect" off and still use PLAIN / Basic Authentication without the warning?
– jla
May 8 '15 at 17:20




How do app specific passwords fit into the mix? If you use an app specific password can you leave "allow less secure apps to connect" off and still use PLAIN / Basic Authentication without the warning?
– jla
May 8 '15 at 17:20




2




2




Using an app-specific password with @hampercm's setup circumvents this issue. - security.google.com/settings/security/apppasswords
– Yoshua Wuyts
Sep 27 '15 at 7:15




Using an app-specific password with @hampercm's setup circumvents this issue. - security.google.com/settings/security/apppasswords
– Yoshua Wuyts
Sep 27 '15 at 7:15












up vote
22
down vote



accepted










I finally got it to work by enabling Google 2-step verification and using an app-specific password for mutt.



More detail:



I enabled 2-step verification on my Google account, which means that when I log in to Google, I have to enter a pin number from either a text or from the Google Authenticator app.



Then I had to get an app-specific password for mutt. You can generate an app specific password here.



Then I used that app-specific password for logging into mutt instead of my normal password. And then I don't have to enter a pin number.






share|improve this answer























  • could you elaborate on this more please?
    – tetris11
    Dec 8 '15 at 22:56






  • 1




    Ok, I added more detail. Hope that helps.
    – aharris88
    Dec 8 '15 at 23:39






  • 1




    Still working and saving hours all around the world. Thanks @aharris88
    – Bernardo Sulzbach
    Sep 25 '16 at 22:42















up vote
22
down vote



accepted










I finally got it to work by enabling Google 2-step verification and using an app-specific password for mutt.



More detail:



I enabled 2-step verification on my Google account, which means that when I log in to Google, I have to enter a pin number from either a text or from the Google Authenticator app.



Then I had to get an app-specific password for mutt. You can generate an app specific password here.



Then I used that app-specific password for logging into mutt instead of my normal password. And then I don't have to enter a pin number.






share|improve this answer























  • could you elaborate on this more please?
    – tetris11
    Dec 8 '15 at 22:56






  • 1




    Ok, I added more detail. Hope that helps.
    – aharris88
    Dec 8 '15 at 23:39






  • 1




    Still working and saving hours all around the world. Thanks @aharris88
    – Bernardo Sulzbach
    Sep 25 '16 at 22:42













up vote
22
down vote



accepted







up vote
22
down vote



accepted






I finally got it to work by enabling Google 2-step verification and using an app-specific password for mutt.



More detail:



I enabled 2-step verification on my Google account, which means that when I log in to Google, I have to enter a pin number from either a text or from the Google Authenticator app.



Then I had to get an app-specific password for mutt. You can generate an app specific password here.



Then I used that app-specific password for logging into mutt instead of my normal password. And then I don't have to enter a pin number.






share|improve this answer














I finally got it to work by enabling Google 2-step verification and using an app-specific password for mutt.



More detail:



I enabled 2-step verification on my Google account, which means that when I log in to Google, I have to enter a pin number from either a text or from the Google Authenticator app.



Then I had to get an app-specific password for mutt. You can generate an app specific password here.



Then I used that app-specific password for logging into mutt instead of my normal password. And then I don't have to enter a pin number.







share|improve this answer














share|improve this answer



share|improve this answer








edited Dec 8 '15 at 23:38

























answered Oct 29 '15 at 16:35









aharris88

5711513




5711513












  • could you elaborate on this more please?
    – tetris11
    Dec 8 '15 at 22:56






  • 1




    Ok, I added more detail. Hope that helps.
    – aharris88
    Dec 8 '15 at 23:39






  • 1




    Still working and saving hours all around the world. Thanks @aharris88
    – Bernardo Sulzbach
    Sep 25 '16 at 22:42


















  • could you elaborate on this more please?
    – tetris11
    Dec 8 '15 at 22:56






  • 1




    Ok, I added more detail. Hope that helps.
    – aharris88
    Dec 8 '15 at 23:39






  • 1




    Still working and saving hours all around the world. Thanks @aharris88
    – Bernardo Sulzbach
    Sep 25 '16 at 22:42
















could you elaborate on this more please?
– tetris11
Dec 8 '15 at 22:56




could you elaborate on this more please?
– tetris11
Dec 8 '15 at 22:56




1




1




Ok, I added more detail. Hope that helps.
– aharris88
Dec 8 '15 at 23:39




Ok, I added more detail. Hope that helps.
– aharris88
Dec 8 '15 at 23:39




1




1




Still working and saving hours all around the world. Thanks @aharris88
– Bernardo Sulzbach
Sep 25 '16 at 22:42




Still working and saving hours all around the world. Thanks @aharris88
– Bernardo Sulzbach
Sep 25 '16 at 22:42










up vote
6
down vote













Judging by aharris88's description, Gmail was blocking access to his account via mutt because mutt is using insecure connections when communicating with Gmail's servers. This means that your username and password are being sent across the local network and the Internet in an unencrypted form; generally a really bad idea, and something to be avoided whenever possible. Gmail was attempting to discourage this risky configuration by rejecting mutt's connection attempt. Changing your Google account settings to allow "Access for less secure apps" overrode this behavior, allowing mutt to connect in an insecure fashion.



One solution for this is to configure mutt to use TLS security when connecting to Gmail. This way, your credentials aren't sent in plain-text form, and you can thus disable "Access for less secure apps" in your Google account settings.



To use TLS, edit your mutt configuration file (~/.muttrc) to be similar to the following:



set realname = 'Your Full Name'
set imap_user = 'youraccount@gmail.com'
set smtp_url = "smtp://youraccount@smtp.gmail.com:587/"
set spoolfile = imaps://imap.gmail.com:993/INBOX
set folder = "imaps://imap.gmail.com:993"
set record="+[Gmail]/Sent Mail"
set postponed="+[Gmail]/Drafts"
set header_cache="~/.mutt/cache/headers"
set message_cachedir="~/.mutt/cache/bodies"
set certificate_file=~/.mutt/certificates

# These two lines appear to be needed on some Linux distros, like Arch Linux
set ssl_starttls = yes
set ssl_force_tls = yes


Also, create the directories and files mutt will use to cache message information and store certificates by executing:



mkdir -p ~/.mutt/cache/bodies
mkdir ~/.mutt/cache/headers
touch ~/.mutt/certificates


Lines 3-5 of the mutt configuration file tell mutt to connect to Gmail using secure ports and protocols. Make sure you fill in 'Your Full Name' on line 1, and replace "youraccount" in both lines 2 and 3. The last two lines will force mutt to connect securely, and may be required on some Linux distributions. The rest of the configuration is a pretty common setup to make mutt play nice with Gmail.



You'll also need to have OpenSSL (or something equivalent) installed on your system, though most systems will probably already have this.



Now, start mutt. You'll be prompted for your Gmail account password. You may also be prompted to accept a certificate that the Gmail server will send you; go ahead and do so. If you see your inbox, you should be all set!



If it's still not connecting, something else is preventing mutt from connecting securely. Try executing: mutt -v to display mutt's version and compile options. In the "Compile options" section of the output, look for +USE_SSL or something similar like +USE_SSL_OPENSSL or +USE_SSL_GNUTLS. If none of these appear with a plus next to them, then mutt was compiled without the ability to connect with TLS, and you'd need to recompile it.



Another possibility is that OpenSSL (or an equivalent SSL package) is not yet installed on your system. The method of installing it will be dependent on which Linux/Unix distribution you are using. Try searching for guides specific to your distribution. You may also need to install an additional package containing Certificate Authorities.



Once you do get things working, if you don't want to type your Gmail password every time you run mutt, you can store it directly in the ~/.muttrc file by adding a line like:



set imap_pass = 'yourpassword'


Note, however, that this presents a security risk, particularly if you share a system with other users. To reduce this risk, you can make ~/.muttrc readable only by you by executing:



chmod 600 ~/.muttrc


This prevents non-root users and services running on your system from reading your password stored in the ~/.muttrc file.






share|improve this answer



















  • 2




    this doesn't solves the problem, its the same configuration i have. you have to allow insecure apps in your gmail settings to use mutt this way. but we want to use it (f possible) with the standard security settings. thanks anyway.
    – linluk
    Dec 13 '14 at 10:00










  • Make sure that smtp_url, spoolfile, and folder are being set exactly as specified above, except of course replacing 'youraccount' with your account name. These are the key lines. And, make sure those aren't being set to something else further down in the file. I've also augmented my answer to address a couple other possibilities. Using the two lines I added at the bottom of the configuration file given above may help. Otherwise, you may need to install a SSL implementation or recompile mutt.
    – hampercm
    Dec 13 '14 at 16:31






  • 1




    It still didn't work. That was almost the exact same stuff I already had in my .muttrc. But I had extra stuff. I deleted the other stuff just in case. I didn't add the ssl part because I'm on mac. Also, the messages I'm getting looks like it's using ssl already.
    – aharris88
    Dec 14 '14 at 0:15










  • Hmmm. I have very little personal experience with MacOS, so unfortunately I may not be of much help for your issue. Did you create the ~/.mutt/ subdirectories and files using the mkdir and touch commands as described above? Those appear to be necessary on some -nixes. Other than that, I don't have much more to suggest, other than doing some web searches specific to mutt and Gmail on Mac OS. Several search hits talk about using "MacPorts" to install mutt variants.
    – hampercm
    Dec 14 '14 at 16:47








  • 2




    I ran across some info that may explain things. This suggests that OAuth 2.0 is required for ALL access from external apps, even over secure connections. I checked my Google settings and found I had enabled less secure apps in the past for some other reason, and forgot about it, which is why my mutt access was working bonks head with palm :( It appears you can use SASL XOAUTH2 to get around needing the "less secure" option, but may not be worth the time invested for a small? security boost.
    – hampercm
    Dec 22 '14 at 18:28

















up vote
6
down vote













Judging by aharris88's description, Gmail was blocking access to his account via mutt because mutt is using insecure connections when communicating with Gmail's servers. This means that your username and password are being sent across the local network and the Internet in an unencrypted form; generally a really bad idea, and something to be avoided whenever possible. Gmail was attempting to discourage this risky configuration by rejecting mutt's connection attempt. Changing your Google account settings to allow "Access for less secure apps" overrode this behavior, allowing mutt to connect in an insecure fashion.



One solution for this is to configure mutt to use TLS security when connecting to Gmail. This way, your credentials aren't sent in plain-text form, and you can thus disable "Access for less secure apps" in your Google account settings.



To use TLS, edit your mutt configuration file (~/.muttrc) to be similar to the following:



set realname = 'Your Full Name'
set imap_user = 'youraccount@gmail.com'
set smtp_url = "smtp://youraccount@smtp.gmail.com:587/"
set spoolfile = imaps://imap.gmail.com:993/INBOX
set folder = "imaps://imap.gmail.com:993"
set record="+[Gmail]/Sent Mail"
set postponed="+[Gmail]/Drafts"
set header_cache="~/.mutt/cache/headers"
set message_cachedir="~/.mutt/cache/bodies"
set certificate_file=~/.mutt/certificates

# These two lines appear to be needed on some Linux distros, like Arch Linux
set ssl_starttls = yes
set ssl_force_tls = yes


Also, create the directories and files mutt will use to cache message information and store certificates by executing:



mkdir -p ~/.mutt/cache/bodies
mkdir ~/.mutt/cache/headers
touch ~/.mutt/certificates


Lines 3-5 of the mutt configuration file tell mutt to connect to Gmail using secure ports and protocols. Make sure you fill in 'Your Full Name' on line 1, and replace "youraccount" in both lines 2 and 3. The last two lines will force mutt to connect securely, and may be required on some Linux distributions. The rest of the configuration is a pretty common setup to make mutt play nice with Gmail.



You'll also need to have OpenSSL (or something equivalent) installed on your system, though most systems will probably already have this.



Now, start mutt. You'll be prompted for your Gmail account password. You may also be prompted to accept a certificate that the Gmail server will send you; go ahead and do so. If you see your inbox, you should be all set!



If it's still not connecting, something else is preventing mutt from connecting securely. Try executing: mutt -v to display mutt's version and compile options. In the "Compile options" section of the output, look for +USE_SSL or something similar like +USE_SSL_OPENSSL or +USE_SSL_GNUTLS. If none of these appear with a plus next to them, then mutt was compiled without the ability to connect with TLS, and you'd need to recompile it.



Another possibility is that OpenSSL (or an equivalent SSL package) is not yet installed on your system. The method of installing it will be dependent on which Linux/Unix distribution you are using. Try searching for guides specific to your distribution. You may also need to install an additional package containing Certificate Authorities.



Once you do get things working, if you don't want to type your Gmail password every time you run mutt, you can store it directly in the ~/.muttrc file by adding a line like:



set imap_pass = 'yourpassword'


Note, however, that this presents a security risk, particularly if you share a system with other users. To reduce this risk, you can make ~/.muttrc readable only by you by executing:



chmod 600 ~/.muttrc


This prevents non-root users and services running on your system from reading your password stored in the ~/.muttrc file.






share|improve this answer



















  • 2




    this doesn't solves the problem, its the same configuration i have. you have to allow insecure apps in your gmail settings to use mutt this way. but we want to use it (f possible) with the standard security settings. thanks anyway.
    – linluk
    Dec 13 '14 at 10:00










  • Make sure that smtp_url, spoolfile, and folder are being set exactly as specified above, except of course replacing 'youraccount' with your account name. These are the key lines. And, make sure those aren't being set to something else further down in the file. I've also augmented my answer to address a couple other possibilities. Using the two lines I added at the bottom of the configuration file given above may help. Otherwise, you may need to install a SSL implementation or recompile mutt.
    – hampercm
    Dec 13 '14 at 16:31






  • 1




    It still didn't work. That was almost the exact same stuff I already had in my .muttrc. But I had extra stuff. I deleted the other stuff just in case. I didn't add the ssl part because I'm on mac. Also, the messages I'm getting looks like it's using ssl already.
    – aharris88
    Dec 14 '14 at 0:15










  • Hmmm. I have very little personal experience with MacOS, so unfortunately I may not be of much help for your issue. Did you create the ~/.mutt/ subdirectories and files using the mkdir and touch commands as described above? Those appear to be necessary on some -nixes. Other than that, I don't have much more to suggest, other than doing some web searches specific to mutt and Gmail on Mac OS. Several search hits talk about using "MacPorts" to install mutt variants.
    – hampercm
    Dec 14 '14 at 16:47








  • 2




    I ran across some info that may explain things. This suggests that OAuth 2.0 is required for ALL access from external apps, even over secure connections. I checked my Google settings and found I had enabled less secure apps in the past for some other reason, and forgot about it, which is why my mutt access was working bonks head with palm :( It appears you can use SASL XOAUTH2 to get around needing the "less secure" option, but may not be worth the time invested for a small? security boost.
    – hampercm
    Dec 22 '14 at 18:28















up vote
6
down vote










up vote
6
down vote









Judging by aharris88's description, Gmail was blocking access to his account via mutt because mutt is using insecure connections when communicating with Gmail's servers. This means that your username and password are being sent across the local network and the Internet in an unencrypted form; generally a really bad idea, and something to be avoided whenever possible. Gmail was attempting to discourage this risky configuration by rejecting mutt's connection attempt. Changing your Google account settings to allow "Access for less secure apps" overrode this behavior, allowing mutt to connect in an insecure fashion.



One solution for this is to configure mutt to use TLS security when connecting to Gmail. This way, your credentials aren't sent in plain-text form, and you can thus disable "Access for less secure apps" in your Google account settings.



To use TLS, edit your mutt configuration file (~/.muttrc) to be similar to the following:



set realname = 'Your Full Name'
set imap_user = 'youraccount@gmail.com'
set smtp_url = "smtp://youraccount@smtp.gmail.com:587/"
set spoolfile = imaps://imap.gmail.com:993/INBOX
set folder = "imaps://imap.gmail.com:993"
set record="+[Gmail]/Sent Mail"
set postponed="+[Gmail]/Drafts"
set header_cache="~/.mutt/cache/headers"
set message_cachedir="~/.mutt/cache/bodies"
set certificate_file=~/.mutt/certificates

# These two lines appear to be needed on some Linux distros, like Arch Linux
set ssl_starttls = yes
set ssl_force_tls = yes


Also, create the directories and files mutt will use to cache message information and store certificates by executing:



mkdir -p ~/.mutt/cache/bodies
mkdir ~/.mutt/cache/headers
touch ~/.mutt/certificates


Lines 3-5 of the mutt configuration file tell mutt to connect to Gmail using secure ports and protocols. Make sure you fill in 'Your Full Name' on line 1, and replace "youraccount" in both lines 2 and 3. The last two lines will force mutt to connect securely, and may be required on some Linux distributions. The rest of the configuration is a pretty common setup to make mutt play nice with Gmail.



You'll also need to have OpenSSL (or something equivalent) installed on your system, though most systems will probably already have this.



Now, start mutt. You'll be prompted for your Gmail account password. You may also be prompted to accept a certificate that the Gmail server will send you; go ahead and do so. If you see your inbox, you should be all set!



If it's still not connecting, something else is preventing mutt from connecting securely. Try executing: mutt -v to display mutt's version and compile options. In the "Compile options" section of the output, look for +USE_SSL or something similar like +USE_SSL_OPENSSL or +USE_SSL_GNUTLS. If none of these appear with a plus next to them, then mutt was compiled without the ability to connect with TLS, and you'd need to recompile it.



Another possibility is that OpenSSL (or an equivalent SSL package) is not yet installed on your system. The method of installing it will be dependent on which Linux/Unix distribution you are using. Try searching for guides specific to your distribution. You may also need to install an additional package containing Certificate Authorities.



Once you do get things working, if you don't want to type your Gmail password every time you run mutt, you can store it directly in the ~/.muttrc file by adding a line like:



set imap_pass = 'yourpassword'


Note, however, that this presents a security risk, particularly if you share a system with other users. To reduce this risk, you can make ~/.muttrc readable only by you by executing:



chmod 600 ~/.muttrc


This prevents non-root users and services running on your system from reading your password stored in the ~/.muttrc file.






share|improve this answer














Judging by aharris88's description, Gmail was blocking access to his account via mutt because mutt is using insecure connections when communicating with Gmail's servers. This means that your username and password are being sent across the local network and the Internet in an unencrypted form; generally a really bad idea, and something to be avoided whenever possible. Gmail was attempting to discourage this risky configuration by rejecting mutt's connection attempt. Changing your Google account settings to allow "Access for less secure apps" overrode this behavior, allowing mutt to connect in an insecure fashion.



One solution for this is to configure mutt to use TLS security when connecting to Gmail. This way, your credentials aren't sent in plain-text form, and you can thus disable "Access for less secure apps" in your Google account settings.



To use TLS, edit your mutt configuration file (~/.muttrc) to be similar to the following:



set realname = 'Your Full Name'
set imap_user = 'youraccount@gmail.com'
set smtp_url = "smtp://youraccount@smtp.gmail.com:587/"
set spoolfile = imaps://imap.gmail.com:993/INBOX
set folder = "imaps://imap.gmail.com:993"
set record="+[Gmail]/Sent Mail"
set postponed="+[Gmail]/Drafts"
set header_cache="~/.mutt/cache/headers"
set message_cachedir="~/.mutt/cache/bodies"
set certificate_file=~/.mutt/certificates

# These two lines appear to be needed on some Linux distros, like Arch Linux
set ssl_starttls = yes
set ssl_force_tls = yes


Also, create the directories and files mutt will use to cache message information and store certificates by executing:



mkdir -p ~/.mutt/cache/bodies
mkdir ~/.mutt/cache/headers
touch ~/.mutt/certificates


Lines 3-5 of the mutt configuration file tell mutt to connect to Gmail using secure ports and protocols. Make sure you fill in 'Your Full Name' on line 1, and replace "youraccount" in both lines 2 and 3. The last two lines will force mutt to connect securely, and may be required on some Linux distributions. The rest of the configuration is a pretty common setup to make mutt play nice with Gmail.



You'll also need to have OpenSSL (or something equivalent) installed on your system, though most systems will probably already have this.



Now, start mutt. You'll be prompted for your Gmail account password. You may also be prompted to accept a certificate that the Gmail server will send you; go ahead and do so. If you see your inbox, you should be all set!



If it's still not connecting, something else is preventing mutt from connecting securely. Try executing: mutt -v to display mutt's version and compile options. In the "Compile options" section of the output, look for +USE_SSL or something similar like +USE_SSL_OPENSSL or +USE_SSL_GNUTLS. If none of these appear with a plus next to them, then mutt was compiled without the ability to connect with TLS, and you'd need to recompile it.



Another possibility is that OpenSSL (or an equivalent SSL package) is not yet installed on your system. The method of installing it will be dependent on which Linux/Unix distribution you are using. Try searching for guides specific to your distribution. You may also need to install an additional package containing Certificate Authorities.



Once you do get things working, if you don't want to type your Gmail password every time you run mutt, you can store it directly in the ~/.muttrc file by adding a line like:



set imap_pass = 'yourpassword'


Note, however, that this presents a security risk, particularly if you share a system with other users. To reduce this risk, you can make ~/.muttrc readable only by you by executing:



chmod 600 ~/.muttrc


This prevents non-root users and services running on your system from reading your password stored in the ~/.muttrc file.







share|improve this answer














share|improve this answer



share|improve this answer








edited Dec 13 '14 at 16:26

























answered Dec 13 '14 at 5:39









hampercm

16114




16114








  • 2




    this doesn't solves the problem, its the same configuration i have. you have to allow insecure apps in your gmail settings to use mutt this way. but we want to use it (f possible) with the standard security settings. thanks anyway.
    – linluk
    Dec 13 '14 at 10:00










  • Make sure that smtp_url, spoolfile, and folder are being set exactly as specified above, except of course replacing 'youraccount' with your account name. These are the key lines. And, make sure those aren't being set to something else further down in the file. I've also augmented my answer to address a couple other possibilities. Using the two lines I added at the bottom of the configuration file given above may help. Otherwise, you may need to install a SSL implementation or recompile mutt.
    – hampercm
    Dec 13 '14 at 16:31






  • 1




    It still didn't work. That was almost the exact same stuff I already had in my .muttrc. But I had extra stuff. I deleted the other stuff just in case. I didn't add the ssl part because I'm on mac. Also, the messages I'm getting looks like it's using ssl already.
    – aharris88
    Dec 14 '14 at 0:15










  • Hmmm. I have very little personal experience with MacOS, so unfortunately I may not be of much help for your issue. Did you create the ~/.mutt/ subdirectories and files using the mkdir and touch commands as described above? Those appear to be necessary on some -nixes. Other than that, I don't have much more to suggest, other than doing some web searches specific to mutt and Gmail on Mac OS. Several search hits talk about using "MacPorts" to install mutt variants.
    – hampercm
    Dec 14 '14 at 16:47








  • 2




    I ran across some info that may explain things. This suggests that OAuth 2.0 is required for ALL access from external apps, even over secure connections. I checked my Google settings and found I had enabled less secure apps in the past for some other reason, and forgot about it, which is why my mutt access was working bonks head with palm :( It appears you can use SASL XOAUTH2 to get around needing the "less secure" option, but may not be worth the time invested for a small? security boost.
    – hampercm
    Dec 22 '14 at 18:28
















  • 2




    this doesn't solves the problem, its the same configuration i have. you have to allow insecure apps in your gmail settings to use mutt this way. but we want to use it (f possible) with the standard security settings. thanks anyway.
    – linluk
    Dec 13 '14 at 10:00










  • Make sure that smtp_url, spoolfile, and folder are being set exactly as specified above, except of course replacing 'youraccount' with your account name. These are the key lines. And, make sure those aren't being set to something else further down in the file. I've also augmented my answer to address a couple other possibilities. Using the two lines I added at the bottom of the configuration file given above may help. Otherwise, you may need to install a SSL implementation or recompile mutt.
    – hampercm
    Dec 13 '14 at 16:31






  • 1




    It still didn't work. That was almost the exact same stuff I already had in my .muttrc. But I had extra stuff. I deleted the other stuff just in case. I didn't add the ssl part because I'm on mac. Also, the messages I'm getting looks like it's using ssl already.
    – aharris88
    Dec 14 '14 at 0:15










  • Hmmm. I have very little personal experience with MacOS, so unfortunately I may not be of much help for your issue. Did you create the ~/.mutt/ subdirectories and files using the mkdir and touch commands as described above? Those appear to be necessary on some -nixes. Other than that, I don't have much more to suggest, other than doing some web searches specific to mutt and Gmail on Mac OS. Several search hits talk about using "MacPorts" to install mutt variants.
    – hampercm
    Dec 14 '14 at 16:47








  • 2




    I ran across some info that may explain things. This suggests that OAuth 2.0 is required for ALL access from external apps, even over secure connections. I checked my Google settings and found I had enabled less secure apps in the past for some other reason, and forgot about it, which is why my mutt access was working bonks head with palm :( It appears you can use SASL XOAUTH2 to get around needing the "less secure" option, but may not be worth the time invested for a small? security boost.
    – hampercm
    Dec 22 '14 at 18:28










2




2




this doesn't solves the problem, its the same configuration i have. you have to allow insecure apps in your gmail settings to use mutt this way. but we want to use it (f possible) with the standard security settings. thanks anyway.
– linluk
Dec 13 '14 at 10:00




this doesn't solves the problem, its the same configuration i have. you have to allow insecure apps in your gmail settings to use mutt this way. but we want to use it (f possible) with the standard security settings. thanks anyway.
– linluk
Dec 13 '14 at 10:00












Make sure that smtp_url, spoolfile, and folder are being set exactly as specified above, except of course replacing 'youraccount' with your account name. These are the key lines. And, make sure those aren't being set to something else further down in the file. I've also augmented my answer to address a couple other possibilities. Using the two lines I added at the bottom of the configuration file given above may help. Otherwise, you may need to install a SSL implementation or recompile mutt.
– hampercm
Dec 13 '14 at 16:31




Make sure that smtp_url, spoolfile, and folder are being set exactly as specified above, except of course replacing 'youraccount' with your account name. These are the key lines. And, make sure those aren't being set to something else further down in the file. I've also augmented my answer to address a couple other possibilities. Using the two lines I added at the bottom of the configuration file given above may help. Otherwise, you may need to install a SSL implementation or recompile mutt.
– hampercm
Dec 13 '14 at 16:31




1




1




It still didn't work. That was almost the exact same stuff I already had in my .muttrc. But I had extra stuff. I deleted the other stuff just in case. I didn't add the ssl part because I'm on mac. Also, the messages I'm getting looks like it's using ssl already.
– aharris88
Dec 14 '14 at 0:15




It still didn't work. That was almost the exact same stuff I already had in my .muttrc. But I had extra stuff. I deleted the other stuff just in case. I didn't add the ssl part because I'm on mac. Also, the messages I'm getting looks like it's using ssl already.
– aharris88
Dec 14 '14 at 0:15












Hmmm. I have very little personal experience with MacOS, so unfortunately I may not be of much help for your issue. Did you create the ~/.mutt/ subdirectories and files using the mkdir and touch commands as described above? Those appear to be necessary on some -nixes. Other than that, I don't have much more to suggest, other than doing some web searches specific to mutt and Gmail on Mac OS. Several search hits talk about using "MacPorts" to install mutt variants.
– hampercm
Dec 14 '14 at 16:47






Hmmm. I have very little personal experience with MacOS, so unfortunately I may not be of much help for your issue. Did you create the ~/.mutt/ subdirectories and files using the mkdir and touch commands as described above? Those appear to be necessary on some -nixes. Other than that, I don't have much more to suggest, other than doing some web searches specific to mutt and Gmail on Mac OS. Several search hits talk about using "MacPorts" to install mutt variants.
– hampercm
Dec 14 '14 at 16:47






2




2




I ran across some info that may explain things. This suggests that OAuth 2.0 is required for ALL access from external apps, even over secure connections. I checked my Google settings and found I had enabled less secure apps in the past for some other reason, and forgot about it, which is why my mutt access was working bonks head with palm :( It appears you can use SASL XOAUTH2 to get around needing the "less secure" option, but may not be worth the time invested for a small? security boost.
– hampercm
Dec 22 '14 at 18:28






I ran across some info that may explain things. This suggests that OAuth 2.0 is required for ALL access from external apps, even over secure connections. I checked my Google settings and found I had enabled less secure apps in the past for some other reason, and forgot about it, which is why my mutt access was working bonks head with palm :( It appears you can use SASL XOAUTH2 to get around needing the "less secure" option, but may not be worth the time invested for a small? security boost.
– hampercm
Dec 22 '14 at 18:28












up vote
1
down vote













Create an app specific password for mutt:
https://support.google.com/accounts/answer/185833
https://security.google.com/settings/security/apppasswords






share|improve this answer

















  • 1




    I'm not using google 2-step verification.
    – aharris88
    Sep 16 '15 at 13:53










  • Oh, I thought you could use app specific passwords with or without 2-step verification. I guess this is something to consider for those who have setup the 2-step verification.
    – twolfe18
    Sep 16 '15 at 15:10















up vote
1
down vote













Create an app specific password for mutt:
https://support.google.com/accounts/answer/185833
https://security.google.com/settings/security/apppasswords






share|improve this answer

















  • 1




    I'm not using google 2-step verification.
    – aharris88
    Sep 16 '15 at 13:53










  • Oh, I thought you could use app specific passwords with or without 2-step verification. I guess this is something to consider for those who have setup the 2-step verification.
    – twolfe18
    Sep 16 '15 at 15:10













up vote
1
down vote










up vote
1
down vote









Create an app specific password for mutt:
https://support.google.com/accounts/answer/185833
https://security.google.com/settings/security/apppasswords






share|improve this answer












Create an app specific password for mutt:
https://support.google.com/accounts/answer/185833
https://security.google.com/settings/security/apppasswords







share|improve this answer












share|improve this answer



share|improve this answer










answered Sep 16 '15 at 3:51









twolfe18

1112




1112








  • 1




    I'm not using google 2-step verification.
    – aharris88
    Sep 16 '15 at 13:53










  • Oh, I thought you could use app specific passwords with or without 2-step verification. I guess this is something to consider for those who have setup the 2-step verification.
    – twolfe18
    Sep 16 '15 at 15:10














  • 1




    I'm not using google 2-step verification.
    – aharris88
    Sep 16 '15 at 13:53










  • Oh, I thought you could use app specific passwords with or without 2-step verification. I guess this is something to consider for those who have setup the 2-step verification.
    – twolfe18
    Sep 16 '15 at 15:10








1




1




I'm not using google 2-step verification.
– aharris88
Sep 16 '15 at 13:53




I'm not using google 2-step verification.
– aharris88
Sep 16 '15 at 13:53












Oh, I thought you could use app specific passwords with or without 2-step verification. I guess this is something to consider for those who have setup the 2-step verification.
– twolfe18
Sep 16 '15 at 15:10




Oh, I thought you could use app specific passwords with or without 2-step verification. I guess this is something to consider for those who have setup the 2-step verification.
– twolfe18
Sep 16 '15 at 15:10










up vote
1
down vote













Mutt now officially supports OAuth specifically targeting issues with Gmail.






share|improve this answer





















  • I think it's better if you try to add at least some of the instructions for how to use OAuth in with gmail to your answer. link only answers become invalid if the url changes. or the file moves.
    – yukashima huksay
    yesterday















up vote
1
down vote













Mutt now officially supports OAuth specifically targeting issues with Gmail.






share|improve this answer





















  • I think it's better if you try to add at least some of the instructions for how to use OAuth in with gmail to your answer. link only answers become invalid if the url changes. or the file moves.
    – yukashima huksay
    yesterday













up vote
1
down vote










up vote
1
down vote









Mutt now officially supports OAuth specifically targeting issues with Gmail.






share|improve this answer












Mutt now officially supports OAuth specifically targeting issues with Gmail.







share|improve this answer












share|improve this answer



share|improve this answer










answered 2 days ago









Philipp Gesang

1153




1153












  • I think it's better if you try to add at least some of the instructions for how to use OAuth in with gmail to your answer. link only answers become invalid if the url changes. or the file moves.
    – yukashima huksay
    yesterday


















  • I think it's better if you try to add at least some of the instructions for how to use OAuth in with gmail to your answer. link only answers become invalid if the url changes. or the file moves.
    – yukashima huksay
    yesterday
















I think it's better if you try to add at least some of the instructions for how to use OAuth in with gmail to your answer. link only answers become invalid if the url changes. or the file moves.
– yukashima huksay
yesterday




I think it's better if you try to add at least some of the instructions for how to use OAuth in with gmail to your answer. link only answers become invalid if the url changes. or the file moves.
– yukashima huksay
yesterday










up vote
0
down vote













OK. So after a long time debugging this, I found this post that gives the real solution.



If you have the said problem, and aren't using 2-factor auth, you need to login to the web version of Gmail and then go to:



https://accounts.google.com/b/0/DisplayUnlockCaptcha



Now, try Mutt - it should login now.






share|improve this answer





















  • In my question, I've already linked to this answer, which says the same thing, but it doesn't work. stackoverflow.com/questions/25209676/…
    – aharris88
    Mar 13 '15 at 0:21










  • Indeed, this didn't help for me, either.
    – reinierpost
    Dec 11 '15 at 14:32















up vote
0
down vote













OK. So after a long time debugging this, I found this post that gives the real solution.



If you have the said problem, and aren't using 2-factor auth, you need to login to the web version of Gmail and then go to:



https://accounts.google.com/b/0/DisplayUnlockCaptcha



Now, try Mutt - it should login now.






share|improve this answer





















  • In my question, I've already linked to this answer, which says the same thing, but it doesn't work. stackoverflow.com/questions/25209676/…
    – aharris88
    Mar 13 '15 at 0:21










  • Indeed, this didn't help for me, either.
    – reinierpost
    Dec 11 '15 at 14:32













up vote
0
down vote










up vote
0
down vote









OK. So after a long time debugging this, I found this post that gives the real solution.



If you have the said problem, and aren't using 2-factor auth, you need to login to the web version of Gmail and then go to:



https://accounts.google.com/b/0/DisplayUnlockCaptcha



Now, try Mutt - it should login now.






share|improve this answer












OK. So after a long time debugging this, I found this post that gives the real solution.



If you have the said problem, and aren't using 2-factor auth, you need to login to the web version of Gmail and then go to:



https://accounts.google.com/b/0/DisplayUnlockCaptcha



Now, try Mutt - it should login now.







share|improve this answer












share|improve this answer



share|improve this answer










answered Mar 10 '15 at 23:54









niieani

1115




1115












  • In my question, I've already linked to this answer, which says the same thing, but it doesn't work. stackoverflow.com/questions/25209676/…
    – aharris88
    Mar 13 '15 at 0:21










  • Indeed, this didn't help for me, either.
    – reinierpost
    Dec 11 '15 at 14:32


















  • In my question, I've already linked to this answer, which says the same thing, but it doesn't work. stackoverflow.com/questions/25209676/…
    – aharris88
    Mar 13 '15 at 0:21










  • Indeed, this didn't help for me, either.
    – reinierpost
    Dec 11 '15 at 14:32
















In my question, I've already linked to this answer, which says the same thing, but it doesn't work. stackoverflow.com/questions/25209676/…
– aharris88
Mar 13 '15 at 0:21




In my question, I've already linked to this answer, which says the same thing, but it doesn't work. stackoverflow.com/questions/25209676/…
– aharris88
Mar 13 '15 at 0:21












Indeed, this didn't help for me, either.
– reinierpost
Dec 11 '15 at 14:32




Indeed, this didn't help for me, either.
– reinierpost
Dec 11 '15 at 14:32


















draft saved

draft discarded




















































Thanks for contributing an answer to Unix & Linux Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f172666%2fgmail-blocking-mutt%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Accessing regular linux commands in Huawei's Dopra Linux

Can't connect RFCOMM socket: Host is down

Kernel panic - not syncing: Fatal Exception in Interrupt