Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to send email with mailsend in OpenWrt #156

Closed
cliffordanup opened this issue Sep 18, 2020 · 2 comments
Closed

Unable to send email with mailsend in OpenWrt #156

cliffordanup opened this issue Sep 18, 2020 · 2 comments

Comments

@cliffordanup
Copy link

Hello,

I just installed the mailsend with ssl binary from the OpenWrt Repository. When I attempt to send an email, it just doesn't want to work with all the openssl dependencies installed. Here is the command and output of the mailsend command.

`
root@OpenWrt_Netgear_R6220:~# mailsend -f "xyz@hotmail.com" -t "xyz@hotmail.com" -ssl -user "xyz@hotmail.com" -pass 'abcdefghijklmnop' -smtp 'smtp-mail.outlook.com' -sub "Test Email from OpenWrt" -msg-body "Test Email from OpenWrt"
Error: turn_on_raw_ssl: SSL connection failed

2012839556:error:1408F10B:SSL routines:ssl3_get_record:wrong version number:ssl/record/ssl3_record.c:332:
Error: Expected smtp code 220, got 0

Could not send mail
`

The following are all the installed programs of openssl, mailsend and luci (OpenWrt Web Interface with https using openssl)

root@OpenWrt_Netgear_R6220:~# opkg list-installed | egrep "ssl|luci|mailsend" liblucihttp-lua - 2019-07-05-a34a17d5-1 liblucihttp0 - 2019-07-05-a34a17d5-1 libopenssl-conf - 1.1.1g-1 libopenssl1.1 - 1.1.1g-1 libustream-openssl20150806 - 2020-03-13-40b563b1-1 luci - git-20.247.75781-0d0ab01-1 luci-app-firewall - git-20.247.75781-0d0ab01-1 luci-app-nlbwmon - git-20.260.30581-915a64c-1 luci-app-opkg - git-20.247.75781-0d0ab01-1 luci-base - git-20.247.75781-0d0ab01-1 luci-compat - git-20.247.75781-0d0ab01-1 luci-lib-ip - git-20.247.75781-0d0ab01-1 luci-lib-jsonc - git-20.247.75781-0d0ab01-1 luci-lib-nixio - git-20.247.75781-0d0ab01-1 luci-mod-admin-full - git-20.247.75781-0d0ab01-1 luci-mod-network - git-20.247.75781-0d0ab01-1 luci-mod-status - git-20.247.75781-0d0ab01-1 luci-mod-system - git-20.247.75781-0d0ab01-1 luci-proto-ipv6 - git-20.247.75781-0d0ab01-1 luci-proto-ppp - git-20.247.75781-0d0ab01-1 luci-ssl-openssl - git-20.260.30581-915a64c-1 luci-theme-bootstrap - git-20.247.75781-0d0ab01-1 mailsend - 1.19-2 openssl-util - 1.1.1g-1 rpcd-mod-luci - 20191114 uwsgi-luci-support - 2.0.18-1

@muquit
Copy link
Owner

muquit commented Sep 18, 2020

mailsend works with openssl 1.1.1g. I don't have access to OpenWrt, so can't tell what's gong on. Did you try to get the info about the server using StartTLS? e.g.

mailsend -info -smtp smtp-mail.outlook.com -port 587

You specified -ssl but I don't see the port you specified.

Thanks.

@cliffordanup
Copy link
Author

I got this issue resolved. I had to use the -starttls and -auth parameters along with the -user and -pass parameters for this to work. I had better luck in using Google's SMTP smtp.gmail.com than Outlook's smtp-mail.outlook.com. For some reason, Outlook used to fail with the following error most of the times and used to work only once when the same command was tried 4-5 times, not sure what was going on there:

root@OpenWrt_Netgear_R6220:~# mailsend -f "xyz@hotmail.com" -t "xyz@xyz.com" -smtp "smtp-mail.outlook.com" -starttls -auth-login -user "xyz@hotmail.com" -pass "abcdefghijklmnop" -sub "Test from OpenWrt" -M "Test from OpenWrt" Socket Error: [11]: Resource temporarily unavailable Error: Connection is closed unexpectedly Error: AUTH LOGIN failed: '-1 ' Could not send mail

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants