1.) Get your current public IP and write it to a file:

dig +short myip.opendns.com @resolver1.opendns.com >> myip.txt (got this off the internet, thanks to the guy that posted this!)

2.) Read the file contents and email it:

Basically, follow this tutorial: https://easyengine.io/tutorials/linux/ubuntu-postfix-gmail-smtp/

If you get an error like this one below then do this: 

ERROR: warning: unable to look up public/pickup: No such file or directory

DO THIS: mkfifo /var/spool/postfix/public/pickup

3.) Your config file should look like this:

relayhost = [smtp.gmail.com]:587

smtp_sasl_auth_enable = yes

smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd

smtp_sasl_security_options =

smtp_tls_CAfile = /etc/ssl/certs/ca-certificates.crt

smtp_use_tls = yes

Categories: Uncategorized