Contact us on Phone:01-4428599 or enquiries@ecomgolive.ie

linux emails to relay via gmail

linux emails to relay via gmail
The XX Intro [long version]
# apt-get install sendmail mailutils sendmail-bin
# mkdir -m 700 /etc/mail/authinfo/
# cd /etc/mail/authinfo/
AuthInfo: "U:root" "I:YOUR GMAIL EMAIL ADDRESS" "P:YOUR PASSWORD"
# makemap hash gmail-auth < gmail-auth


Put bellow lines into your sendmail.mc configuration file right above first "MAILER" definition line:
define(`SMART_HOST',`[smtp.gmail.com]')dnl
define(`RELAY_MAILER_ARGS', `TCP $h 587')dnl
define(`ESMTP_MAILER_ARGS', `TCP $h 587')dnl
define(`confAUTH_OPTIONS', `A p')dnl
TRUST_AUTH_MECH(`EXTERNAL DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl
define(`confAUTH_MECHANISMS', `EXTERNAL GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl
FEATURE(`authinfo',`hash -o /etc/mail/authinfo/gmail-auth.db')dnl

# make -C /etc/mail

Reload sendmail service:

/etc/init.d/sendmail reload

$ echo "Just testing my sendmail to gmail relay" | mail -s "Sendmail gmail Relay" enquiries@ecomgolive.ie