Routing all outgoing mails via the outgoing smarthost:

  1. Ensure the IP address is added as an authorized smarthost (without authentication)
  2. Ensure the outgoing user has correct limits set matching your traffic volumes
  3. Update your configuration:
    1. For this you have to edit /etc/ and add the following lines at the top under the "pert(-1)dnl" line:
    2. define(`RELAY_MAILER_ARGS', `TCP $h 587')dnl
      define(`SMART_HOST', `[SMART.HOST.TLD]')dnl

    3. Run "sendmailconfig" to use this new configuration
    4. This will automatically re-start sendmail

Alternative Configuration with username authentication (un-tested)

  1. Change directory to where your sendmail configuration files ( and are located, usually /etc/mail/
  2. Create a safe sub-directory (suggested name auth/):
  3. # mkdir auth
    # chmod 700 auth
  4. Create a file with your authentication information (suggested filename: auth/client-info)
  6. Generate the authentication database and make both files readable only by root:
  7. # cd auth
    # makemap hash client-info < client-info
    # chmod 600 client-info*
    # cd ..
  8. Add the following lines to your file
  9. define(`SMART_HOST',`[SMARTHOST]')dnl
    define(`RELAY_MAILER_ARGS', `TCP $h 587')
    FEATURE(`authinfo',`hash /etc/mail/auth/client-info')dnl
  10. Generate
  11. # m4 >
  12. Restart the sendmail daemon
  13. # kill -HUP `cat /var/run/` (old-school) -OR-
    # make restart (FreeBSD) -OR-
    # /etc/init.d/sendmail reload (debian Linux)
  14. SMARTHOST should be replaced with your SMTP hostname