Skip to content

Instantly share code, notes, and snippets.

@n1shantshrivastava
Last active August 13, 2021 19:56
Show Gist options
  • Save n1shantshrivastava/6420769 to your computer and use it in GitHub Desktop.
Save n1shantshrivastava/6420769 to your computer and use it in GitHub Desktop.
Send Mail Configuration : Disable Local Delivery

What I did to disable local delivery. I'll be using the example.com domain.

Requirements:

  • example.com A entry pointing to IP address assigned to one of the eth interfaces.
  • /etc/hosts defining example.com assigned to the very same IP address as above
  • example.com MX records pointing to Google servers (ASPMX.L.GOOGLE.COM, etc)
  • default sendmail installation (mine was on Ubuntu)

Steps are as follows :

#1. vim /etc/mail/sendmail.mc

#2. Add the below 2 lines at the end of the file

define('MAIL_HUB', 'example.com.')dnl

define('LOCAL_RELAY', 'example.com.')dnl

#3. Perform the below given things

$ sendmailconfig

(or /etc/mail/make depending on your distro)

$ service sendmail restart

Now, go ahead and test the mail now. You will see the problem getting resolved now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment