mludvig / smtp-cli

The ultimate command line SMTP client
http://smtp-cli.logix.cz
187 stars 32 forks source link

smtp-cli does not actually try to login (--force-ehlo fixes this, but not documented) #4

Closed rngadam closed 9 years ago

rngadam commented 9 years ago

version: smtp-cli version 3.6

Testing 163.com SMTP sending but from the verbose output it never actually tries to login? I've tried a number of flags and options but without any success:

~root/bin/smtp-cli --server=applesmtp.163.com --user=tcvsys@163.com --from=tcvsys@163.com --to=rngadam@thecarevoice.com --pass=PASSWORD --port=465 --ssl --subject="hello from Ricky" --body-plain="content" --verbose
Connection from 121.41.35.79:56504 to 220.181.12.17:465
Starting SMTP/SSL...
Using cipher: AES128-SHA256
Subject Name: /serialNumber=YnR7sUbvKb4d/SY/OwmmcD88FU0ZzluZ/C=CN/ST=Zhejiang/L=Hangzhou/O=NetEase (Hangzhou) Network Co., Ltd/OU=MAIL Dept./CN=*.163.com
Issuer  Name: /C=US/O=GeoTrust, Inc./CN=GeoTrust SSL CA
[220] '163.com Anti-spam GT for Coremail System (163com[20121016])'
> HELO localhost
[250] 'OK'
> MAIL FROM: <tcvsys@163.com>
[553] 'authentication is required,smtp13,EcCowECZoy+xLGNU4LXrAQ--.2290S2 1415785650'
MAIL FROM <tcvsys@163.com> failed: '553 authentication is required,smtp13,EcCowECZoy+xLGNU4LXrAQ--.2290S2 1415785650'
> QUIT
[221] 'Bye'

Another attempt:

~root/bin/smtp-cli --verbose --host=applesmtp.163.com --enable-auth --user tcvsys --from tcvsys@163.com --to rngadam@thecarevoice.com --body-plain "hello you" 
Enter password for tcvsys@applesmtp.163.com : 
Connection from 121.41.35.79:59954 to 220.181.12.16:25
[220] '163.com Anti-spam GT for Coremail System (163com[20121016])'
> HELO localhost
[250] 'OK'
> MAIL FROM: <tcvsys@163.com>
[553] 'authentication is required,smtp12,EMCowECZ51KDLWNU045BBw--.16S2 1415785859'
MAIL FROM <tcvsys@163.com> failed: '553 authentication is required,smtp12,EMCowECZ51KDLWNU045BBw--.16S2 1415785859'
> QUIT
[221] 'Bye'

After writing this, I found:

http://www.logix.cz/michal/devel/smtp-cli/index.xp?show_selected=1&msgid=417#feedback_form

Thanks for the patch. The problem with smtp.tom.com is, however, that the server offers 
only SMTP, not ESMTP. My client then chooses to use HELO instead of EHLO which makes 
the server to not offer any SMTP extensions like AUTH. The obvious solution is to force
using EHLO even if not detected as being supported by the server. 

I added a new --force-ehlo switch for this purpose and tested with smtp.tom.com. 
Voila, now it works!

...and indeed, that was the problem.

I think it would be helpful to provide an explicit note and an example in the documentation:

http://www.logix.cz/michal/devel/smtp-cli/

mludvig commented 9 years ago

Since this problem only affects servers that don't follow the standard I'm not really concerned.

Danie10 commented 5 months ago

It is a similar issue with Gmail, but related to smtp-cli itself as I had the same issue with ssmtp. But for both being able to specify a flag for login, solved it. It should not be necessary, but seemingly some servers need it, and they break many other ssmtp apps. So for smtp-cli using --auth-login worked 100%.