Short Version: Google seem to be preparing to start up their own SSL Certificate Authority.
I've been using msmtp as an SMTP client on Win32 boxes to hand-off to Gmail for a while with no problems. However, doing a fresh setup on a new machine, I received the following error message when printing server information:
>msmtp -S
msmtp: TLS certificate verification failed: the certificate hasn't got a known issuer
If one interrogates smtp.gmail.com, it seems that Google are no longer using Thawte as their certificate provider; the new certificate issuer is the “Google Internet Authority”.
It all seems legit, and the underlying issuer is Equifax/Geotrust. So pick up the new certificate from your cache, or download it here:
Equifax Secure Certificate Authority (this root is included in all browser's root store)
msmtp users - amend the tls_trust_file directive in msmtprc.txt and way you go!
msmtp --serverinfo --host=smtp.gmail.com --tls=on --port= 587 --tls-certcheck=off
SMTP server at smtp.gmail.com (fk-in-f109.1e100.net [209.85.129.109]), port 587: mx.google.com ESMTP h2sm4781504fkh.55
TLS certificate information:
Owner:
Common Name: smtp.gmail.com
Organization: Google Inc
Locality: Mountain View
State or Province: California
Country: US
Issuer:
Common Name: Google Internet Authority
Organization: Google Inc
Country: US
Validity:
Activation time: Thu Apr 22 21:02:45 2010
Expiration time: Fri Apr 22 21:12:45 2011
Fingerprints:
SHA1: 1A:6F:48:8F:BE:5B:FD:92:D8:12:30:F9:22:CE:84:49:B3:43:BD:2C
MD5: 60:39:DE:FB:0A:D9:9E:43:26:E7:75:AC:60:48:A1:B0
Capabilities:
SIZE 35651584:
Maximum message size is 35651584 bytes = 34.00 MiB
STARTTLS:
Support for TLS encryption via the STARTTLS command
AUTH:
Supported authentication methods:
PLAIN LOGIN
UPDATE - Some additional details from a correspondent, Ramon Leonardi:
(In particular, this solves the problem of Zend Community server using msmtp, by explicitly stating the msmtp configuration file in php.ini)
I had a few problems though, even after using your msmtprc.txt sample file. I don’t know if that is a Windows 7 problem only, but msmtp wasn’t working properly. It took me days to realize the problem was a missing log file. Apparently, msmtp updates – but can’t create – a log file on its own: so I hand created an empty txt file, and renamed it to msmtp.log, and then create a reference to it on my msmtprc.txt file. Before that, every time a tried to send an e-mail, that generated an error on msmtp and stopped the program.
A good way one can test if msmtp is working fine is by sending an echo mail form command prompt:
>echo “this is a test” | msmtp example@test.com -t
The code above works for me without a –from parameter because I’ve set a “from directive” on my msmtprc.txt file. Without that, one should use the complete command:
>echo “this is a test” | msmtp --from=myemail@test.com example@test.com -t
If every this is configured right, msmtp sends the e-mail, returns no message, and updates the log file.
After that I bumped into some integration glitch between msmtp and php. But that was much easier to solve. I have no idea why, but when called by php,msmtp wasn’t loading msmtprc.txt properly. So, after reading Uniserver’s wiki on msmtp I tried fixing php.ini with the following code:
sendmail_path = "C:/example/msmtp/msmtp.exe --file=C:/Users/example/AppData/Roaming/msmtprc.txt -t"
Reference: http://wiki.uniformserver.com/index.php/5.3-Nano:_msmtp#Gmail
________
My config files
#php.ini – mail section#
[mail function]
; For Win32 only.
;SMTP = localhost
;smtp_port = 25
; For Win32 only.
;sendmail_from =
; For Unix only. You may supply arguments as well (default: "sendmail -t -i").
;sendmail_path =
sendmail_path = "C:/pathtomsmtp/msmtp/msmtp.exe --file=C:/Users/MyUserName/AppData/Roaming/msmtprc.txt -t"
; Force the addition of the specified parameters to be passed as extra parameters
; to the sendmail binary. These parameters will always replace the value of
; the 5th parameter to mail(), even in safe mode.
;mail.force_extra_parameters =
#msmtp.txt#
account server
maildomain gmail.com
logfile C:\pathToWhereIcreatedIt\msmtp.log
host smtp.gmail.com
port 587
auth on
password ****
user example@gmail.com
auto_from off
from example @gmail.com
tls on
tls_trust_file "C:\pathToMsmtp\msmtp\Equifax_Secure_Certificate_Authority.cer"
tls_starttls on
account default: server