I am interested to get email notifications from my server to my Gmail account - the same notifications that the server gets in the /var/mail/root
- either by forwarding the messages, or or directly emailing the notifications there (which one is better for security?) The Gmail account is set to have two-step-authentication for security reasons.
How can I do this on a Debian Jessie?
Following @tarleb recommendations, I found Gmail's application specific login:
- Went to: https://security.google.com/settings/security/apppasswords
- Created a
mail
specific password for a custom device (named itDebian
): - Got the password:
Now, how to use this with Debian? is exim4 still a good package to use? Is it safer/better to forward the emails to Gmail? Or better skip the internal root mail altogether?
Update I did follow the tutorial on VUTLR, but I am getting the following error:
root@vultr:/etc/exim4# update-exim4.conf
2015-12-07 11:05:18 Exim configuration error in line 22 of /var/lib/exim4/config.autogenerated.tmp:
malformed macro definitionInvalid new configfile /var/lib/exim4/config.autogenerated.tmp, not installing /var/lib/exim4/config.autogenerated.tmp to /var/lib/exim4/config.autogenerated