Configure sendmail as a relayserver

Configure sendmail as a relayserver

Configure sendmail as a relayserver 150 150 Roderick Derks

Change the following lines in /etc/mail/sendmail.mc

define(`SMART_HOST’, `ventoux.r71.nl’)dnl

dnl DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA’)dnl
DAEMON_OPTIONS(`Port=smtp, Name=MTA’)dnl

LOCAL_DOMAIN(`alpedhuez.r71.nl’)dnl

  # m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf

Flush deferred messages in sendmail queue

Whenever sendmail has to deliver mails to other hosts which cannot be reached at that time, the messages are kept in the queue and are marked as “Deferred: Connection timed out”. Although the other hosts could be reached again and you want to tell sendmail to flush the mail queue, the command

  # sendmail -q -v

does not really try to reconnect to these hosts and still assumes that the connection timed out. The reason is that the hoststatus is cached, per default for a period of 30 minutes. Using

  # sendmail -OTimeout.hoststatus=0m -q -v

You can re-run the mail queue and force sendmail to reconnect to the hosts. You may want to define an alias for that, say, ‘sendmail-flush-timeouts’.

Default mail queue interval setting

  #  cat /etc/sysconfig/sendmail
      DAEMON=yes
      QUEUE=1h

Test on commandline

telnet yourrelayserver.com 25

helo <hostname>
mail from: name@extrnaldomain.com
rcpt to: user@yourdomain.com
data
mail test
.

Roderick Derks

Liefhebber van fietsen, van het oplossen van IT puzzels, en van het delen van informatie om anderen te helpen.

All stories by:Roderick Derks

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

    Your Name (required)

    Your Email (required)

    Subject

    Your Message

      Your Name (required)

      Your Email (required)

      Subject

      Your Message