You are not logged in.

#1 2010-12-26 18:56:12

GalacticArachnid
Member
Registered: 2009-01-02
Posts: 155
Website

msmtp hates gmail?

Im trying top get msmtp to play nice with gmail, my account passwords are stored in my .netrc file. So far I keep getting authentication errors when i try to send a test mail (msmtp wait for quite a while, then spews this out):

$ cat blah | msmtp -a gmail ***@****
msmtp: authentication failed (method PLAIN)
msmtp: server message: 535-5.7.1 Username and Password not accepted. Learn more at                   
msmtp: server message: 535 5.7.1 http://mail.google.com/support/bin/answer.py?answer=14257 j49sm4290067wer.38
msmtp: could not send mail (account gmail from /home/vision/.msmtprc)

Im not asked to enter a password, which suggests that msmtp does find .netrc data just fine, but something else throws it off..


So, here is my .msmtprc:

# Accounts will inherit settings from this section
defaults
auth             on
tls              on

[ ... ]
# Other account info here
[ .. ]

######################################################
account        gmail
host           smtp.gmail.com
port           587
protocol       smtp
from           ***@gmail.com
user           ***@gmail.com
tls_trust_file /usr/share/ca-certificates/mozilla/Equifax_Secure_CA.crt


# Gmail is not the default account..
account default : ***
logfile        /var/log/msmtp.log

And here is my .netrc it works file with offlineimap..

machine imap.gmail.com
    login ***@***
    password ***

machine smtp.gmail.com
    login ***@***
    password ***

If you can shed some light as to why msmtp doesnt work, please do so ))

Last edited by GalacticArachnid (2010-12-26 19:11:08)

Offline

#2 2010-12-26 19:04:09

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 29,311
Website

Re: msmtp hates gmail?

You need a  password entry (blank). This works for me:
.msmtprc

account GMail 
host smtp.gmail.com
port 587
protocol smtp
auth on
from jasonwryan@gmail.com
user jasonwryan@gmail.com
password 
tls on
tls_nocertcheck

.netrc

machine smtp.gmail.com
        login jasonwryan@gmail.com
        password **********

Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#3 2010-12-26 19:10:32

GalacticArachnid
Member
Registered: 2009-01-02
Posts: 155
Website

Re: msmtp hates gmail?

Cheers for the reply jason,

I tried adding a blank password field but that hasn't made a difference unfortunately

Offline

#4 2010-12-26 19:22:10

Gusar
Member
Registered: 2009-08-25
Posts: 3,605

Re: msmtp hates gmail?

I don't use .netrc, I specify password directly in .msmtprc and it works

account gmail
host smtp.gmail.com
port 587
auth on
tls on
tls_trust_file /etc/ssl/certs/ca-certificates.crt
user email_address_here
password password_here

Offline

#5 2010-12-26 20:41:18

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 29,311
Website

Re: msmtp hates gmail?

Did you add

auth on

I seem to recall playing with that option to get it to work...


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#6 2010-12-26 20:51:48

GalacticArachnid
Member
Registered: 2009-01-02
Posts: 155
Website

Re: msmtp hates gmail?

Hi, thanks for the replies guys! ))

Yeah, I have set auth on

msmtp does work when the password is entered inside the .msmtp file, but I want my passwords stored in .netrc  -> it seems far better to have one file for all this onfo, especially since it's already storing password info for offline imap..

... Also, funny thing..

.netrc contains the smtp password for another account of mine, which seems to work flawlessly with msmtp. But not gmail...

Offline

#7 2010-12-26 21:11:42

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 29,311
Website

Re: msmtp hates gmail?

Try using my .msmtprc entry values, just to get it working, then revert back to your own to find the failure point.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#8 2010-12-26 21:28:08

GalacticArachnid
Member
Registered: 2009-01-02
Posts: 155
Website

Re: msmtp hates gmail?

Gave it a go, but still no luck ((

Offline

#9 2010-12-26 21:34:05

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 29,311
Website

Re: msmtp hates gmail?

What version of msmtp - I'm on 1.4.21-1


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#10 2010-12-26 21:42:28

GalacticArachnid
Member
Registered: 2009-01-02
Posts: 155
Website

Re: msmtp hates gmail?

Im on msmtp-1.4.21-1  too.. I have also tried the latest git version from aur but to no avail

Offline

#11 2010-12-26 21:49:28

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 29,311
Website

Re: msmtp hates gmail?

The only other thing I can think of is a conflict with .offlineimaprc - if there are values in .netrc for that file that are fux0ring it. Sorry - I'm out if ideas...


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#12 2010-12-26 23:35:03

saline
Member
Registered: 2010-02-20
Posts: 86

Re: msmtp hates gmail?

I use

auth on
tls on
tls_starttls on
tls_trust_file /etc/ssl/certs/ca-certificates.crt

Offline

#13 2010-12-27 12:38:55

bharani
Member
From: Karaikudi, India
Registered: 2009-07-12
Posts: 202

Re: msmtp hates gmail?

IIRC msmtp wont work correctly with gmail passwords that have space. I had the problem and changed the password.


Tamil is my mother tongue.

Offline

#14 2010-12-27 13:54:51

Army
Member
Registered: 2007-12-07
Posts: 1,784

Re: msmtp hates gmail?

Passwords shall never have spaces!

Offline

#15 2010-12-27 14:12:48

bharani
Member
From: Karaikudi, India
Registered: 2009-07-12
Posts: 202

Re: msmtp hates gmail?

<offtopic>

Army wrote:

Passwords shall never have spaces!

Are  there any technical reasons? It thought that it just a special charecter .
</offtopic>


Tamil is my mother tongue.

Offline

#16 2010-12-27 21:27:22

Army
Member
Registered: 2007-12-07
Posts: 1,784

Re: msmtp hates gmail?

I don't know wink

Offline

#17 2010-12-31 05:12:57

diegonc
Member
Registered: 2008-12-13
Posts: 42

Re: msmtp hates gmail?

Have you tried unlocking the captcha? That worked for me smile

http://www.google.com/accounts/DisplayUnlockCaptcha

Offline

#18 2010-12-31 09:38:14

x33a
Forum Fellow
Registered: 2009-08-15
Posts: 4,586
Website

Re: msmtp hates gmail?

have you changed the permissions for .msmtprc?

chmod 600 ~/.msmtprc

Offline

#19 2011-01-02 14:35:37

tlvince
Member
Registered: 2010-07-06
Posts: 68
Website

Re: msmtp hates gmail?

I had the exact same problem. The issue was caused because my password contained a single quote. Replacing it with a different special character fixed it.

Last edited by tlvince (2011-01-02 14:36:43)

Offline

#20 2021-04-06 04:38:20

edithturn
Member
Registered: 2021-04-06
Posts: 1

Re: msmtp hates gmail?

Hello, guys, I was struggling a lot with this until I read this post, I tried many things, but finally, I changed my password, it contained and point and an asterisk and I changed it, only with letters, it is less secure neutral  but It works.

Offline

#21 2021-04-06 06:31:21

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 12,698

Re: msmtp hates gmail?

While that's nice to hear that this helped you, please don't necrobump 10 year old threads.

Closing.

Online

Board footer

Powered by FluxBB