change domain sendmail

How to change the identifier name which is to be specified during conversation of sendmail with the recipient

  • Currently if we look at header of any client from whom we receive mail the received header would be
    Received: from merce.bangalore.azbpartners.com
  • This is the FQDN of the host from which the mail is sent
  • Just because the recipient does not carry out a DNS check on merce.bangalore.azbpartners.com the mails are delivered.
  • But if merce.bangalore.azbpartners.com is looked up to it wont resolve and hence the mail would bounce back to the sender
  • Hence we need to change the sendmail configuration so that when the sender MTA tries to identify itself it uses the FQDN of the mail server i.e. mail.azbpartners.com
  • This is done as follows
    1. Dig the fully qualified name of the host from which is the end point of the communication to the internet. i.e. firewall, gatekeeper machines
    2. In case of azb their mailserver is merce.bangalore.azbpartners.com
    3. dig merce.mumbai.azbparnters.com
    4. This will not resolve.
    5. If the name resolves to an IP then there is no need to configure the domain. Quit at this point.
    6. In the current scenario for azbpartners.com dig the mail server
    7. This is done by executing "dig azbpartners.com mx"
    8. In the answer section the output will be of type

      azbpartners.com. 3538 IN MX 7 delhi-gate1.azbpartners.com.
      azbpartners.com. 3538 IN MX 8 delhi-gate2.azbpartners.com.
      azbpartners.com. 3538 IN MX 10 mail1.azbpartners.com.
      azbpartners.com. 3538 IN MX 5 mail.azbpartners.com.
      azbpartners.com. 3538 IN MX 6 mail2.azbpartners.com.

    9. Note down the mail server name with the lowest rank i.e. here mail.azbpartners.com
    10. On the client side mail server carry out the following change
      1. cd /etc/mail/
      2. ci -l merce.mc with the message "Changing the domain name to be displayed during conversation"
      3. vi merce.mc
      4. Add this line
        define(`confDOMAIN_NAME',`mail.azbpartners.com')
      5. Please note that here the name mail.azbpartners.com is specific only to azb client. As per the other client mail servers we should make the corresponding changes.
      6. Save and quit
      7. Execute this command
        m4 /etc/mail/merce.mc > /var/tmp/sendmail.cf
      8. vimdiff /var/tmp/sendmail.cf /etc/sendmail.cf
      9. Note down any manual configuration changes in /etc/sendmail.cf for eg.
        "CN root net backup mailchk" line where in mailchk was added explicitly
      10. Make the manual changes and again execute
        vimdiff /var/tmp/sendmail.cf /etc/sendmail.cf
      11. This time the only differentiating lines would be the commented lines and
        the entry
        #Dj$w.Foo.COM in /etc/sendmail.cf would be
        Djmail.azbpartners.com in /var/tmp/sendmail.cf
      12. cd /etc/
      13. ci -l /etc/sendmail.cf with the message "Changing the domain name to be displayed during conversation"
      14. cp /var/tmp/sendmail.cf /etc/sendmail.cf
      15. Restart sendmail
        /etc/init.d/sendmail restart
      16. Check if you can telnet to port 10025
        telnet localhost 10025
      17. Send a test mail from local machine to gmail.
      18. When mail is received check out the headers, the received from header
        should be of the type
        Received: from mail.azbpartners.com
      19. Please note again that here the name mail.azbpartners.com is specific only to azb client. As per the other client mail servers we should make the corresponding changes.