---------------------- Gmail Debian Smarthost ---------------------- Feb. 14, 2016 This should only be done for a single user system. All email will come from the authenticated gmail account. Configure sending mail: 1) run: dpkg-reconfigure exim4-config following the configuration prompts 2) General type of mail configuration: - mail sent by smarthost: received via sMTP or fetchmail 3) System mail name: - Enter the system mail name 4) IP-addresses to listen on for incoming SMTP connections: - Set to the local interface ipv4 and ipv6 if available 127.0.0.1 ; ::1 5) Other destination for which mail is accepted: - Blank 6) Machines to relay mail for: - Blank 7) IP address or host name of the outgoing smarthost: smtp.gmail.com::587 8) Hide local mail name in outgoing mail? - No 9) Keep number of DNS-queries minimal (Dial-on-Demand)? - No 10) Delivery method for local mail: - mbox format in /var/mail/ 11) Split configuration into small files? - Yes 12) If you use two factor authentication, generate a Google application password 13) Edit /etc/exim4/passwd.client and add the line: *.google.com:your_username@gmail.com:password_here 14) Edit /etc/email-addresses and map all of your local names to the gmail address. local_name: your_username@gmail.com local_name@localhost: your_username@gmail.com local_name@hostname: your_username@gmail.com local_name@hostname.localdomain: your_username@gmail.com 15) service exim4 restart Configure retrieving mail: 1) Setup /var/lib/fetchmail/.fetchmailrc changing your_name, password_here, and local_name: poll pop.gmail.com with proto POP3 user 'your_username@gmail.com' there with password 'password_here' is local_name here options ssl 2) Set permissions 600 on /var/lib/fetchmail/.fetchmailrc 3) Set the cron job to retrieve mail periodically crontab -u fetchmail -e */13 * * * * /usr/bin/fetchmail Notes: - Gmail must be configured to allow POP access. - Exim log file /var/log/exim4/mainlog - Modify configuration edit: /etc/exim4/update-exim4.conf.conf run: update-exim4.conf - Force retry on the mail queue run: exim -qf