15.6 Configuring a Sendmail Client

A Sendmail client sends outbound mail to another SMTP server, which is typically administered by an ISP or the IT department of an organization, and this server then relays the email to its destination.

To configure a Sendmail client:

  1. If the account on the SMTP server requires authentication:

    1. Create an auth directory under /etc/mail that is accessible only to root:

      # mkdir /etc/mail/auth
      # chmod 700 /etc/mail/auth
    2. In the auth directory, create a file smtp-auth that contains the authentication information for the SMTP server, for example:

      # echo 'AuthInfo:smtp.isp.com: "U:username" "P:password"' > /etc/mail/auth/smtp-auth

      where smtp.isp.com is the FQDN of the SMTP server, and username and password are the name and password of the account.

    3. Create the database file from smtp-auth, and make both files read-writable only by root:

      # cd /etc/mail/auth
      # makemap hash smtp-auth < smtp-auth
      # chmod 600 smtp-auth smtp-auth.db
  2. Edit /etc/mail/sendmail.mc, and change the following line:

    dnl define('SMART_host', 'smtp.your.provider')dnl

    to read:

    define('SMART_host', 'smtp.isp.com')dnl

    where smtp.isp.com is the FQDN of the SMTP server.

  3. If the account on the SMTP server requires authentication, add the following lines after the line that defines SMART_host:

    define('RELAY_MAILER_ARGS', 'TCP $h port')dnl
    define('confAUTH_MECHANISMS', 'EXTERNAL GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl
    FEATURE('authinfo','hash /etc/mail/auth/smtp-auth.db')dnl
    define(`confAUTH_OPTIONS', `A p y')dnl

    where port is the port number used by the SMTP server (for example, 587 for SMARTTLS or 465 for SSL/TLS).

  4. Edit /etc/sysconfig/sendmail and set the value of DAEMON to no:

    DAEMON=no

    This entry disables sendmail from listening on port 25 for incoming email.

  5. Restart the sendmail service:

    # service sendmail restart

    To test the configuration, send email to an account in another domain.

This configuration does not receive or relay incoming email. You can use a client application to receive email via POP or IMAP.