Relay email to gmail (msmtp, mailx, sendmail
Overview
If you're running an alpine from stick and need a way for your program to alert you through a standard gmail account
Install msmtp
# apk add msmtp
Configuration
Create a global configuration:
Contents of /etc/msmtprc
Sendmail alias
By default alpine comes with busybox sendmail, msmtp can act as a sendmail alternative including syntax and option, there I create a local.d script to overwrite the busybox link to msmtp.
Contents of /etc/local.d/msmtp-sendmail.start
Make it executable
# chmod +x /etc/local.d/msmtp-sendmail.start
and run it first time through
# /etc/local.d/msmtp-sendmail.start
Mailx and aliases
Install mailx for program that uses mail (like apcupsd for monitoring UPS events)
# apk add mailx
Create an /etc/aliases file with content:
Contents of /etc/aliases
Testing
Test an email, run
echo -e "Subject: Do you love alpine?\nYes, I do!\n"
Saving the configuration
This material needs expanding ... This does't apply to a static install. |
# lbu ci
Hope it helps.