muquit / mailsend

A program to send mail via SMTP from command line
Other
295 stars 68 forks source link

Using -starttls will block mailsend for infinite #61

Closed deajan closed 9 years ago

deajan commented 10 years ago

Hello,

I've implemented mailsend in my project smartmontools-win to replace eldering sendemail. So far everything works great. But in my software you can choose between ssl and tls and send a test email. Using gmail with -ssl works great, but -starttls will make mailsend listen forever. I know gmail isn't supposed to use tls, but is there a way to make mailsend at least stop trying to send mail when a user tries -starttls ?

Here's what i've tested: mailsend1.17b15.exe -f mail@example.com -t mail@example.com -sub "Smartmontools test" -M "this is a test" -smtp smtp.gmail.com -port 465 -attach "c:\Program Files (x86)\smartmontools for Windows\smartmontools-install-6.3-1.log" -auth -user mail@example.com -pass PASSWORD -starttls -v Connecting to smtp.gmail.com:465 Will detect IPv4 or IPv6 automatically libmsock: using getaddrinfo AF_INET IPv4 IP address: 173.194.66.108:465 EINPROGRESS=10036,EWOULDBLOCK=10035 connect(): socket=300,rc=-1, errno=10035 (Debug) Try socket 300

muquit commented 10 years ago

gmai's starttls port is 587, would you try that and see if it still hangs? thanks.

deajan commented 10 years ago

Mailsend doesn't hang on starttls if port is 587. I just wanted to make my software more "user proof" as the choice is given to select the protocol and the port, and the bad combination makes it hang.

muquit commented 10 years ago

ok. I will add a read timeout in the next release. thanks.

deajan commented 10 years ago

Thanks alot :)

muquit commented 10 years ago

develop branch has the fix and the bins directory has the windows binary.

deajan commented 10 years ago

Hello,

New version works like a charm, i can now update my software.

Just for my own information, do you write test scripts for every bug you fix ? Great work, and big thanks for mailsend :+1:

muquit commented 10 years ago

Yes I try to test in all supported platforms. It the test is generic enough, I keep the script around.