Msmtp is an SMTP client it it transmits a mail to an SMTP server (for example at a free mail provider) which takes care of further delivery.
To use this program with your mail user agent (MUA), create a configuration file with your mail account(s) and tell your MUA to call msmtp instead of /usr/sbin/sendmail. With Msmtp on OpenWrt you able to send e-mail using a command or code script.
Minimum free space size requirement = (2.5 MB)
To use this program with your mail user agent (MUA), create a configuration file with your mail account(s) and tell your MUA to call msmtp instead of /usr/sbin/sendmail. With Msmtp on OpenWrt you able to send e-mail using a command or code script.
Requirements
Installation and Configuration
Step 1: Install Msmtp
- Select Tabs System - Software
- Select Update List
- In download and install packages type "msmtp" then click ok
- cd /etc
- vi msmtprc *If there are no msmtprc files, add the files by "touch msmtprc" command
- account default
- host mailhub.oursite.example ---> host smtp.gmail.com
- port 587 *add port
- #tls on *remove hashtag to --> tls on
- #tls_trust_file /etc/ssl/certs/ca-certificates.crt *replace with ---> tls_certcheck off
- *and add under / below syslog LOG_MAIL*
- auth login
- user your.email@gmail.com
- password gmailpassword
- from your.email@gmail.com
Testing
Run this command from SSH on your router:
echo -e "Subject: Test Mail\r\n\r\nThis is a test mail" |msmtp --debug --from=default -t username@gmail.comThen check the destination email inbox.
Additional Msmtp options parameters
- --debu
g *If you want to see log of sending mail - --from=default *It's default account located in /etc/msmtprc
- -t username[at]gmail.com *It will send email to the destination email
Reference
- Installing and Configuring mSMTP - VigasDeep
- Image by Cairo on Flickr used under CC BY 2.0 / Add More Shadow
You have shared amazing post. This post is really helpful for us to know the information. Thank you for taking your time to post such a wonderful article. SMTP Server for Bulk Email
ReplyDelete