

Include(`/usr/share/sendmail-cf/m4/cf.m4′)dnlĭefine(`SMART_HOST’, `’)dnlĭnl #define(`confDEF_USER_ID’, “8:12”)dnlĭefine(`confTRY_NULL_MX_LIST’, `True’)dnlĭefine(`confDONT_PROBE_INTERFACES’, `True’)dnlĭefine(`PROCMAIL_MAILER_PATH’, `/usr/bin/procmail’)dnlĭefine(`STATUS_FILE’, `/var/log/mail/statistics’)dnlĭefine(`confUSERDB_SPEC’, `/etc/mail/userdb.db’)dnlĭefine(`confPRIVACY_FLAGS’, `authwarnings,novrfy,noexpn,restrictqrun’)dnlĭefine(`RELAY_MAILER_ARGS’, `TCP $h 587′)ĭefine(`ESMTP_MAILER_ARGS’, `TCP $h 587′) If it fails, read /var/log/maillog and /var/log/messages. Now, send a test email changing echo “Subject: test” | /usr/lib/sendmail -v echo “Email test” | mail -s “test” -r To delete all mail for root, run the following command:

To empty your mail queue run the following command: # systemctl restart rvice Additional InformationĮdit the “/etc/aliases” and add the following line at the end and save:Įdit the “/etc/mail/trusted-users” and add the following line at the end and save: # makemap -r hash gmail-info.db /etc/mail/sendmail.cf
#SMTP RELAY CENTOS 7 PASSWORD#
Type the following lines and save (replace email address anad password with your’s)ĪuthInfo: “U:smmsp” “P:password” “M:PLAIN”ĪuthInfo::587 “U:smmsp” “P:password” “M:PLAIN” If you use Gmail hosted email with your own domain name, you will have in there. (Create a directory called auth inside /etc/mail to keep this file separate form other files). This is to store the authentication details to my Gmail account. Then I have the /etc/mail/auth/gmail-info looks like the following. # make sendmail.pem Configuration Gmail Authentication # setsebool httpd_can_sendmail on (SET NEW STATUS ON) Creating CertificatesĮnter the appropriate information when you’re generating the certificates, such as your name, organization and email address. # getsebool httpd_can_sendmail (GET CURRENT STATUS by default is off) # cp /etc/mail/sendmail.mc /etc/mail/sendmail.mc.orig


This took me a really log time to debug, because this error message isn’t very clear. The common error in the /var/log/maillog is this:ĪUTH=client, available mechanisms do not fulfill requirements You can see why when you get to the sendmail configuration in the later steps. If your SASL installation doesn’t have the “plain” and “login” lib you will have authentication problem with Gmail.
#SMTP RELAY CENTOS 7 INSTALL#
# yum install cyrus-sasl-plain cyrus-sasl-md5 mailx # yum install sendmail sendmail-cf Additional Packages There were dependency requirements and after almost giving up, I got this to work! Here’s how… Installing Sendmailįirst, you need remove the postfix package:Īnd now, install the sendmail and sendmail-cf for configation of sendmail: However configuring this wasn’t as smooth as I though. All I had to do is to configure sendmail to relay all my mail though Google’s SMTP servers. However I couldn’t get sendmail to send an email because I don’t have a static IP with my home internet connection. I was trying to setup notifications on my Nagios server.
