Using OpenWrt 10.03
I need to send "reports" from my router by email:

i installed sendmail:
# opkg install mini-sendmail

Then i used my isp's smtp server:
# echo -e "From: TEST@TEST.TES\nSubject: SUBJECT\nReply-to: TEST@TEST.TES\n\nBODYHERE" | mini_sendmail -sMYISPSSMTPSERVER MYEMAIL@MYDOMAIN.COM
mini_sendmail: unexpected response 550 to RCPT TO command
#

Questions:
1) How could i know, that my ISP's blocking port 25?

# telnet MYISPSSMTPSERVER 25
220 MYISPSSMTPSERVER ESMTP ready
quit
221 MYISPSSMTPSERVER closing connection
Connection closed by foreign host
#
so it's not blocked? :O

2) If port 25 isn't blocked, then how could i check this: do i need an "email user" at my ISP?

3) If i can't get email working, than i have to register a free e-mail address [gmail?], and find out, how to send e-mail [with username and password required] in OpenWrt [help?:].
The only problem is that, i don't want to store passwords on the router :\

Thank you for any links/hints/good words!

link|improve this question

79% accept rate
feedback

4 Answers

Can you take the router out of the equation and just send an email through telnet? ISPs will often block outbound SMTP (tcp/25) altogether while permitting connections to their mail server, which you can use as a smarthost (that might require authentication) to relay mail for you.

link|improve this answer
feedback

Normally consumer Internet service providers will block TCP/25 for all SMTP servers other than their own. So it would be perfectly normal to be able to telnet to it from your router.

Your ISP may require authentication before sending over SMTP and I do not believe mini_sendmail supports SMTP AUTH. You might look at ssmtp opkg instead of (or in addition to) mini_sendmail: http://linux.die.net/man/5/ssmtp.conf

link|improve this answer
feedback
up vote 0 down vote accepted

Solution: I installed ssmtp + registered a free email address with ssl smtp:
opkg install ssmtp

$ cat /etc/ssmtp/ssmtp.conf
root=MYEMAIL@MYDOMAIN.COM
mailhub=SMTP.MYDOMAIN.COM:465
rewriteDomain=MYDOMAIN.COM
hostname=MYDOMAIN.COM
FromLineOverride=YES
UseTLS=YES
AuthUser=MYEMAIL
AuthPass=PASSWORDHERE
$

echo -e "From: MYEMAIL@MYDOMAIN.COM\nSubject: SUBJECT\nReply-to: MYEMAIL@MYDOMAIN.COM\n\nBODYHERE" | ssmtp -vvv MYOTHEREMAIL@MYDOMAIN.COM

link|improve this answer
feedback

I know this is old, but it's one of the links that come up when searching "openwrt smtp"
Follow this link- https://forum.openwrt.org/viewtopic.php?id=18669

For sake of preventing linkrot issues..
First install.

# opkg install msmtp

Then create config file.

# cat /etc/msmtprc
account default

host smtp.gmail.com
port 587
auth on
user account@gmail.com
password password

auto_from off
from account@gmail.com

tls on
tls_starttls on
tls_certcheck off

logfile
syslog LOG_MAIL

To email, use the usual sendmail approach.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.