- Linux – ssmtp settings for namecheap: Invalid response SMTP Server (STARTTLS)
- Best Answer
- Related Solutions
- sSMTP no longer works — ‘Invalid response: 501 5.5.4 HELO/EHLO argument MYEMAILADDRESS@gmail.com invalid, closing connection.’
- ssmtp settings for namecheap: Invalid response SMTP Server (STARTTLS)
- Answer
- Thread: [Solved] SSMTP connecting to Gmail
- [Solved] SSMTP connecting to Gmail
Linux – ssmtp settings for namecheap: Invalid response SMTP Server (STARTTLS)
I am trying to configure ssmtp to use the namecheap smtp server to send emails. My current configuration:
root=my@email.com mailhub=mail.privateemail.com:465 rewriteDomain=email.com hostname=email.com AuthUser=my@email.com AuthPass=password FromLineOverride=YES UseTLS=NO UseSTARTTLS=YES
Trying to send a test email using cat — | sudo /usr/sbin/ssmtp -vvvv my@email.com results in the following output in my syslog:
Jun 17 13:55:08 hostname sSMTP[12161]: Creating SSL connection to host Jun 17 13:55:18 hostname sSMTP[12161]: Invalid response SMTP Server (STARTTLS) Jun 17 13:55:18 hostname sSMTP[12161]: Cannot open mail.privateemail.com:465
So far, no configuration change has had any impact. I find mostly solutions for gmail, which do not work for Namecheap it seems. The Namecheap documentation does not mention any special settings one needs to apply.
I tried setting it up with gmail and it worked flawlessly. I guess this means that my settings for the NameCheap SMTP are wrong?
Best Answer
SSMTP is expected to be TLS from the start. This should work if you set UseTLS to Yes. This port/protocol has been obsoleted now that the STARTTLS option is available.
If you want to use STARTTLS try the submission port (587). I have verified that the submission port is open.
Related Solutions
Linux – sSMTP Configuration Question
Mail submission to smtp.gmail.com:587 will fail if STARTTLS is not issued:
[palantir]-[/var/tmp]-[528] % nc smtp.gmail.com 587 [2:16] 220 mx.google.com ESMTP b3sm14232728ibf.7 EHLO domain.com 250-mx.google.com at your service, [67.167.112.165] 250-SIZE 35651584 250-8BITMIME 250-STARTTLS 250 ENHANCEDSTATUSCODES MAIL 530 5.7.0 Must issue a STARTTLS command first. b3sm14232728ibf.7 STARTTLS 220 2.0.0 Ready to start TLS
For this use case, your credentials must be transmitted over TLS to be transmitted at all, so they are not being sent in the clear. Note however that while this is common behavior, this is not the required behavior — it is quite possible that a server doesn’t require TLS on the submission port, and also possible to similarly misconfigure your client.
As joschi mentioned, you can make sure it is encrypted with any tool that can capture packets off the wire, and I’d like to add tcpflow as a suggestion as well for that.
Joomla SMTP Configuration Issue
The answer was right under my nose. The problem was that when I upgraded CBMailing the original configuration was reset to default. Most Joomla extensions maintain the existing configuration after an upgrade so I didn’t think to even look there at first. So I set it back to the old config and problem solved.
If anyone is interested here is a working CBMailing Config:
- Allow attachments? checked
- Allow HTML? checked
- Method: One e-mail for the whole list
- Send from: A specific address, ctaspa-info@ctaspa.org
- Reply to: The person logged in
- Send to: The list addresses
- BCC recipients: No one
Related Topic
sSMTP no longer works — ‘Invalid response: 501 5.5.4 HELO/EHLO argument MYEMAILADDRESS@gmail.com invalid, closing connection.’
As the title/tags say, I run sSMTP on Linux for a PHP server. Whenever I try to send an email, I get these errors (that do not show up in PHP, only in the logs/ ‘sudo service sendmail status’ or ‘sudo service php5-fpm status’) From /var/log/mail.log
Mar 31 03:34:34 ip-172-31-22-38 sSMTP[2004]: Creating SSL connection to host Mar 31 03:34:34 ip-172-31-22-38 sSMTP[2004]: Invalid response: 501 5.5.4 HELO/ELO argument MYEMAILADDRESS@gmail.com invalid, closing connection. v74sm9147441pfa.7- gsmtp (MYEMAILADDRESS@gmail.com) Mar 31 03:34:34 ip-172-31-22-38 sSMTP[2004]: SSL connection using (null) Mar 31 03:34:34 ip-172-31-22-38 sSMTP[2004]: Cannot open smtp.gmail.com:587
Mar 31 03:34:10 ip-172-31-22-38 sSMTP[1997]: Cannot open smtp.gmail.com:587 Mar 31 03:34:34 ip-172-31-22-38 sSMTP[2004]: Invalid response: 501 5.5.4 HELO/EHLO argument MYEMAILADDRESS@gmail.com invalid, closing connection. v74sm9147441pfa.7 - gsmtp (MYEMAILADDRESS@gmail.com) Mar 31 03:34:34 ip-172-31-22-38 sSMTP[2004]: Cannot open smtp.gmail.com:587
# # Config file for sSMTP sendmail # # The person who gets all mail for userids < 1000 # Make this empty to disable rewriting. root=MYEMAILADDRESS@gmail.com # The place where the mail goes. The actual machine name is required no # MX records are consulted. Commonly mailhosts are named mail.domain.com mailhub=smtp.gmail.com:587 # Where will the mail seem to come from? #rewriteDomain= # The full hostname hostname=MYEMAILADDRESS@gmail.com AuthUser=MYEMAILADDRESS@gmail.com AuthPass=[removed] UseSTARTTLS=YES # Are users allowed to set their own From: address? # YES - Allow the user to specify their own From: address # NO - Use the system generated From: address FromLineOverride=YES
root:MYEMAILADDRESS@gmail.com:smtp.gmail.com:587 localusername:MYEMAILADDRESS@gmail.com:smtp.gmail.com:587
ssmtp settings for namecheap: Invalid response SMTP Server (STARTTLS)
I am trying to configure ssmtp to use the namecheap smtp server to send emails. My current configuration:
root=my@email.com mailhub=mail.privateemail.com:465 rewriteDomain=email.com hostname=email.com AuthUser=my@email.com AuthPass=password FromLineOverride=YES UseTLS=NO UseSTARTTLS=YES
Trying to send a test email using cat - | sudo /usr/sbin/ssmtp -vvvv my@email.com results in the following output in my syslog:
Jun 17 13:55:08 hostname sSMTP[12161]: Creating SSL connection to host Jun 17 13:55:18 hostname sSMTP[12161]: Invalid response SMTP Server (STARTTLS) Jun 17 13:55:18 hostname sSMTP[12161]: Cannot open mail.privateemail.com:465
So far, no configuration change has had any impact. I find mostly solutions for gmail, which do not work for Namecheap it seems. The Namecheap documentation does not mention any special settings one needs to apply.
I tried setting it up with gmail and it worked flawlessly. I guess this means that my settings for the NameCheap SMTP are wrong?
Answer
SSMTP is expected to be TLS from the start. This should work if you set UseTLS to Yes. This port/protocol has been obsoleted now that the STARTTLS option is available.
If you want to use STARTTLS try the submission port (587). I have verified that the submission port is open.
Attribution
Source : Link , Question Author : Sgoettschkes , Answer Author : BillThor
Thread: [Solved] SSMTP connecting to Gmail
Spilled the Beans
[Solved] SSMTP connecting to Gmail
Until a short while ago (not quite sure when), SSMTP was sending the results of my cron jobs to my email.
# # Config file for sSMTP sendmail # # The person who gets all mail for userids < 1000 # Make this empty to disable rewriting. root=@gmail.com # The place where the mail goes. The actual machine name is required no # MX records are consulted. Commonly mailhosts are named mail.domain.com mailhub=smtp.gmail.com:587 # Where will the mail seem to come from? #rewriteDomain= # The full hostname hostname=@gmail.com # Are users allowed to set their own From: address? # YES - Allow the user to specify their own From: address # NO - Use the system generated From: address FromLineOverride=YES UseSTARTTLS=YES UseTLS=YES AuthUser=@gmail.com AuthPass=
Various Google searches have yielded a few results which imply I need to add a TLS_CA_File= line, but they all reference a RedHat installation and need to add:
TLS_CA_File=/etc/pki/tls/certs/ca-bundle.crt
The only file with the same name is: /usr/share/ncat/ca-bundle.crt
Apr 1 22:25:20 MYHOST sSMTP[31704]: Unable to set TLS_CA_File="/usr/share/ncat/ca-bundle.crt" Apr 1 22:25:23 MYHOST sSMTP[31704]: Creating SSL connection to host Apr 1 22:25:23 MYHOST sSMTP[31704]: Invalid response: 501 5.5.4 HELO/EHLO argument MYEMAIL@gmail.com invalid, closing connection. g2sm376695igi.2 - gsmtp (MYEMAIL@gmail.com) Apr 1 22:25:23 MYHOST sSMTP[31704]: SSL connection using (null) Apr 1 22:25:23 MYHOST sSMTP[31704]: Cannot open smtp.gmail.com:587
I get the feeling the TLS_CA_File is where the problem is.
Has anyone else managed to get sSMTP working with Gmail? Is there an alternative to SSMTP?