You are on page 1of 3

Configure SendMail to Use SMTP Relay (ORACLE)

Configure SendMail to Use SMTP Relay (ORACLE)


1 Purpose

2 Prerequisites

3 Add SMTP Relay

4 Add Authentication (Optional)

5 Restart Service

6 Sources

Purpose
This article gives the steps to setup SendMail to use an SMTP relay also known as Smart Host to send out
email through. If you don't have your own SMTP relay then your ISP SMTP Relay can be used. Although,
keep in mind you may have to pass credentials to use your ISP or maybe even your enterprise SMTP relay.
This is useful when sending emails to external recipients to avoid anti-spoof and anti-spam filters to drop the
messages because they are not coming from a whitelist SMTP relay. Be default it would use it's local SMTP
mechanism which generally will be blocked by most SMTP systems.

Prerequisites
 sendmail
 sendmail-cf The files needed to reconfigure SendMail

Add SMTP Relay


1. Edit Sendmail Make file /etc/mail/sendmail.mc

2. vim /etc/mail/sendmail.mc

3. Remove Comment for the following lines

4. dnl define(`SMART_HOST', `smtp.your.provider')dnl

5. Replace smtp.your.provider
Example:

define(`SMART_HOST', `mail.grm.co.id')dnl

KURNIAWAN SETYO NUGROHO 1


Configure SendMail to Use SMTP Relay (ORACLE)

1. Do not use IP Address. It must be a FQDN.


2. Beware of your DNS MX records causing issues.
6. Regenerate SendMail Configuration File /etc/mail/sendmail.cf

7. /etc/mail/make

Add Authentication (Optional)


If the SMTP relay requires authentication then do the following steps.
1. Change to mail configuration directory

2. cd /etc/mail

3. Create /etc/mail/authinfo

4. vim /etc/mail/authinfo

5. Add a plain text line with SMTP FQDN and Credentials.


Replace smtp.domain.com, USERNAME and PASSWORD

6. AuthInfo:smtp.domain.com "U:USERNAME" "P:PASSWORD" "M:PLAIN"


7. Become => AuthInfo:mail.grm.co.id "U:oracle.admin@grm.co.id" "P:%udi12m$n" "M:PLAIN"

8. Create a hash map

9. makemap hash authinfo < authinfo

10. Add Authinfo to sendmail config

11. vim /etc/mail/sendmail.mc

FEATURE(`authinfo')

12. Regenerate SendMail Configuration File /etc/mail/sendmail.cf

13. /etc/mail/make

Restart Service
Restart the service with the appropriate command for your flavor and version of Linux.
KURNIAWAN SETYO NUGROHO 2
Configure SendMail to Use SMTP Relay (ORACLE)

service sendmail restart


/etc/init.d/sendmail restart
systemctl restart sendmail

Sources
 https://www.dnsexit.com/support/mailrelay/sendmail.html

KURNIAWAN SETYO NUGROHO 3

You might also like