You are not logged in.

#1 2010-01-25 19:47:44

badger101101
Member
Registered: 2008-03-27
Posts: 20

Unable to get msmtp working

I have decided to make the switch to mutt, and the MTA is the last puzzle piece that I cannot seem to get working on Arch.  I was able to get it working just fine on my wife's OpenSuSE box at home, but not on Arch.

I followed this guide:  http://wiki.archlinux.org/index.php/Msmtp

Here's my config:

account gmail
host smtp.gmail.com
port 587
protocol smtp
auth on
from <username>@gmail.com
user <username>@gmail.com
password <password>
tls on
tls_starttls on
tls_trust_file /usr/share/ca-certificates/mozilla/Equifax_Secure_CA.crt   //(also tried Thawte cert & no cert check)

Here's my test case & results:

echo "testing msmtp via gmail" | msmtp -a gmail <username>@gmail.com

msmtp: cannot connect to smtp.gmail.com, port 587: Connection refused
msmtp: could not send mail (account gmail from /home/<user>/.msmtprc)

Anyone have any ideas why this isn't functioning when the same config works on my wife's computer?

Thanks

Offline

#2 2010-01-28 16:41:56

skanky
Member
From: WAIS
Registered: 2009-10-23
Posts: 1,847

Re: Unable to get msmtp working

Don't have gmail set-up with msmtp (though I use it otherwise and keep meaning to set it up), but a few thoughts:

Have you checked that nothing is blocking port 587 between you and Google (like a firewall)?
Edit to add, you could try SSL (which is on a different port and more likely to be open?) too.

Have you checked that the certificate files are there (or the path's correct)?

You could also follow these instructions:
http://msmtp.sourceforge.net/doc/msmtp. … r-Security

and check which file it's looking for.

Last edited by skanky (2010-01-28 16:43:48)


"...one cannot be angry when one looks at a penguin."  - John Ruskin
"Life in general is a bit shit, and so too is the internet. And that's all there is." - scepticisle

Offline

#3 2010-01-28 18:32:02

Kitty
Member
From: The Burning Desert
Registered: 2008-01-11
Posts: 88

Re: Unable to get msmtp working

Make sure the permissions are 600 on the .msmtp file.


/etc/rc.d/ is where daemons reside. Beware.

Offline

#4 2010-01-28 18:47:12

brisbin33
Member
From: boston, ma
Registered: 2008-07-24
Posts: 1,796
Website

Re: Unable to get msmtp working

a while back i had to ditch the cert crap.

mine for comparison:

//blue/0/~/ cat .msmtprc
# msmtp config file

# gmail
account gmail
host smtp.gmail.com
port 587
protocol smtp
auth on
from pbrisbin@gmail.com
user pbrisbin@gmail.com
password XXXXX
tls on
tls_nocertcheck

# gmx
account gmx
host mail.gmx.com
port 587
protocol smtp
auth on
from pbrisbin@gmx.com
user pbrisbin@gmx.com
password XXXXX
tls on
tls_nocertcheck

# use gmail as default
account default : gmail

works like a dream.

Offline

#5 2010-01-28 23:22:09

badger101101
Member
Registered: 2008-03-27
Posts: 20

Re: Unable to get msmtp working

Thanks for the replies.

@skanky:
It's not likely that port 587 is being blocked, because I've used it with other email clients from within my company network, but I suppose it's not impossible.  Also tried port 465 with no success.  Thanks for the informative link.

@kitty:
Permissions are set to 600.  In fact, msmtp refuses to run if it's not.

@brisbin33:
Interesting...  using your exact settings (but with my email/passwd), I get the same error "Connection Refused".  Same thing happens if I try using port 465.  Perhaps this is a bug in the most recent update?  I am on version 1.4.19


*sigh*

Offline

#6 2010-01-29 11:11:16

skanky
Member
From: WAIS
Registered: 2009-10-23
Posts: 1,847

Re: Unable to get msmtp working

Long shot I know, but do you have iptables set-up? If so, could it be  something in that config?
Can you telnet to the port(s)?

Two other ones to try are connecting to smtp.googlemail.com and changing your outgoing ip address (Google have been known to be a bit forward in blocking at times).

Otherwise, it might be worth checking on the msmtp mailing list - I haven't found a bug list for the app. yet (though I haven't searched hard).


"...one cannot be angry when one looks at a penguin."  - John Ruskin
"Life in general is a bit shit, and so too is the internet. And that's all there is." - scepticisle

Offline

#7 2010-01-29 18:06:21

badger101101
Member
Registered: 2008-03-27
Posts: 20

Re: Unable to get msmtp working

No iptables here.

Tried smtp.googlemail.com with no luck.

Do you mean telnet to smtp.gmail.com on those ports?  No, I cannot.

I'll post on the msmtp mailing list.  Thanks for all the help.

Offline

#8 2010-01-29 18:39:47

skanky
Member
From: WAIS
Registered: 2009-10-23
Posts: 1,847

Re: Unable to get msmtp working

badger101101 wrote:

No iptables here.

Tried smtp.googlemail.com with no luck.

Do you mean telnet to smtp.gmail.com on those ports?  No, I cannot.

I'll post on the msmtp mailing list.  Thanks for all the help.

The telnet failure strongly it's not msmtp, as I can telnet to smtp.gmail.com port 587 from here (not an Arch machine).

I'm a bit stuck as to what it can be though, if others on the same network can connect.


"...one cannot be angry when one looks at a penguin."  - John Ruskin
"Life in general is a bit shit, and so too is the internet. And that's all there is." - scepticisle

Offline

#9 2010-01-29 18:41:32

Kitty
Member
From: The Burning Desert
Registered: 2008-01-11
Posts: 88

Re: Unable to get msmtp working

do a traceroute from the borked box and then from a working box, see what's different.


/etc/rc.d/ is where daemons reside. Beware.

Offline

#10 2010-01-29 18:44:19

skanky
Member
From: WAIS
Registered: 2009-10-23
Posts: 1,847

Re: Unable to get msmtp working

Kitty wrote:

do a traceroute from the borked box and then from a working box, see what's different.

Good idea. smile

Should've thought of that myself. roll


"...one cannot be angry when one looks at a penguin."  - John Ruskin
"Life in general is a bit shit, and so too is the internet. And that's all there is." - scepticisle

Offline

#11 2010-01-29 18:56:20

brisbin33
Member
From: boston, ma
Registered: 2008-07-24
Posts: 1,796
Website

Re: Unable to get msmtp working

badger101101 wrote:

@brisbin33:
Interesting...  using your exact settings (but with my email/passwd), I get the same error "Connection Refused".  Same thing happens if I try using port 465.  Perhaps this is a bug in the most recent update?  I am on version 1.4.19

bit of bad news, i'm on the same version and it's working fine.  something else is going on hmm.

Offline

#12 2010-01-29 19:13:16

KimTjik
Member
From: Sweden
Registered: 2007-08-22
Posts: 715

Re: Unable to get msmtp working

Checked here as well, version 1.4.19-1, and gmail smtp works fine. I changed certificate some time ago and uses this one now:

tls on                           
tls_starttls on
tls_trust_file /usr/share/ca-certificates/mozilla/Thawte_Premium_Server_CA.crt

I can't see anything wrong either, but I'm just using the plain msmtp as well. There are of course several Thawte certificates in the folder so maybe you did choose another one. I don't even remember if this is one that resided there from the beginning or a certificate I downloaded from VeriSigned, might be.

Last edited by KimTjik (2010-01-29 19:17:28)

Offline

#13 2010-01-29 19:30:04

badger101101
Member
Registered: 2008-03-27
Posts: 20

Re: Unable to get msmtp working

Well that's disheartening.  Running a traceroute to smtp.gmail.com never completes - looks like it gets hung up at our corporate firewall or some other point within the corporate network...  How lame.

Glad to know it's not a bug in msmtp.

Thanks for the help.

Offline

#14 2010-01-29 19:32:33

KimTjik
Member
From: Sweden
Registered: 2007-08-22
Posts: 715

Re: Unable to get msmtp working

And this command gives you no output as well?

msmtp --serverinfo --host=smtp.gmail.com --tls=on --port=587 --tls-certcheck=off

Offline

#15 2010-01-29 19:41:31

badger101101
Member
Registered: 2008-03-27
Posts: 20

Re: Unable to get msmtp working

msmtp: cannot connect to smtp.gmail.com, port 587: Connection refused

I just called our corporate office and talked with one of our IT guys and discovered that virtually all outbound traffic is locked down  *sigh*.  I suppose I can send all personal email via the company smtp server.

Thanks for all the help.

Offline

Board footer

Powered by FluxBB