Hi all,
I've packaged msmtp, a sendmail compatabile SMTP forwarder that replaces the dated and unmaintained ssmtp package.
To set up msmtp to forward using GMail, install the msmtp package (with openssl support, see below on finding packages).
root@OpenWrt:~# opkg install http://etc.kupesoft.com/openwrt/msmtp_1.4.17-2_mipsel.ipk
Then, edit /etc/msmtprc to look something like this
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
Finally, you can send email like this,
root@OpenWrt:~# echo 'Hello, World!' | sendmail user@test.com
Or even in your scripts like this,
#!/bin/sh
EMAIL='To: user@test.com
Subject: EMERGENCY BROADCASTING SYSTEM
This is a test of the emergency broadcasting system.
Had there have been an actual emergency, you would have heard this message
followed by a long beep.'
echo "$EMAIL" | sendmail -t
Of course, msmtp can be configured many different ways. You can find more about how to configure msmtp by reading its manpage.
If you are connecting upstream to an SMTP server that doesn't use TLS authentication, go ahead and use the msmtp-nossl package, which is a bit smaller and doesn't require the rather large libopenssl dependency.
The package is now included in Openwrt, but you can grab the brcm-2.4 images it here...
* msmtp (with openssl support) -- msmtp_1.4.17-3_mipsel.ipk
* msmtp-nossl (without openssl support) -- msmtp-nossl_1.4.17-3_mipsel.ipk
Thanks,
Dave
Update: Bumped versions and the patch has been accepted in to OpenWrt.
(Last edited by kupesoft on 6 Feb 2009, 08:48)