search instagram arrow-down

Archives

Categories

Meta

Vmstat and Status update via Email

You can configure Postfix to use the gmail smtp server to deliver the email.
You can follow the following steps.
1. Install Postfix and configuration use Internet Site.

sudo apt-get install libsasl2-modules postfix

2. Generate an App Password for PostfixPermalink
3. Manage your account access and security settings. Scroll down to “Password & sign-in method” and click 2-Step Verification.
4. Generate an App password for Postfix:

Screen Shot 2018-04-19 at 9.38.17 AM

5. Make note of the newly generated app password.
6. In Postfix main.cf

relayhost = [smtp.gmail.com]:587
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options = noanonymous
smtp_tls_CAfile = /etc/postfix/cacert.pem
smtp_use_tls = yes

7. Add Gmail Username and Password to Postfix, create /etc/postfix/sasl_passwd and enter the following information.

[smtp.gmail.com]:587 cfialab@gmail.com:XXXXXXXXcwop

8. Create the hash db file for Postfix by running the postmap command

postmap /etc/postfix/sasl_passwd

Use Mutt to automate the mail.


echo "MESSAGE BODY" | mutt -s "SUBJECT" -a ./access.log.txt -- dayaramb@gmail.com

Ref: https://linode.com/docs/email/postfix/configure-postfix-to-send-mail-using-gmail-and-google-apps-on-debian-or-ubuntu/

Leave a comment
Your email address will not be published. Required fields are marked *