sudo apt-get -y install exim4
dpkg-reconfigure exim4-config
nano /etc/exim4/exim4.conf.template
send_via_gmail:
driver = manualroute
domains = ! +local_domains
transport = gmail_smtp
route_list = * smtp.gmail.com
#smarthost:
# debug_print = "R: smarthost for $local_part@$domain"
# driver = manualroute
# domains = ! +local_domains
# transport = remote_smtp_smarthost
# route_list = * DCsmarthost byname
# host_find_failed = defer
# same_domain_copy_routing = yes
# no_more
gmail_login:
driver = plaintext
public_name = LOGIN
client_send = : yourname@gmail.com : YourGmailPassword
gmail_smtp:
driver = smtp
port = 587
hosts_require_auth = $host_address
hosts_require_tls = $host_address
#.ifndef AUTH_CLIENT_ALLOW_NOTLS_PASSWORDS
# client_send = "<; ${if !eq{$tls_cipher}{}\
# {^${extract{1}{:}{PASSWDLINE}}\
# ^${sg{PASSWDLINE}{\\N([^:]+:)(.*)\\N}{\\$2}}\
# }fail}"
#.else
# client_send = "<; ^${extract{1}{:}{PASSWDLINE}}\
# ^${sg{PASSWDLINE}{\\N([^:]+:)(.*)\\N}{\\$2}}"
#.endif
#login:
# driver = plaintext
# public_name = LOGIN
#.ifndef AUTH_CLIENT_ALLOW_NOTLS_PASSWORDS
# Return empty string if not non-TLS AND looking up $host in passwd-file
# yields a non-empty string; fail otherwise.
# client_send = "<; ${if and{\
# {!eq{$tls_cipher}{}}\
# {!eq{PASSWDLINE}{}}\
# }\
# {}fail}\
# ; ${extract{1}{::}{PASSWDLINE}}\
# ; ${sg{PASSWDLINE}{\\N([^:]+:)(.*)\\N}{\\$2}}"
#.else
# Return empty string if looking up $host in passwd-file yields a
# non-empty string; fail otherwise.
# client_send = "<; ${if !eq{PASSWDLINE}{}\
# {}fail}\
# ; ${extract{1}{::}{PASSWDLINE}}\
# ; ${sg{PASSWDLINE}{\\N([^:]+:)(.*)\\N}{\\$2}}"
#.endif
#####################################################
### end auth/30_exim4-config_examples
#####################################################
update-exim4.conf
/etc/init.d/exim4 restart
Service exim4 restart