Configure sendmail as a relayserver PDF Print E-mail
Wednesday, 25 March 2009 00:00

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: This e-mail address is being protected from spambots. You need JavaScript enabled to view it
rcpt to: This e-mail address is being protected from spambots. You need JavaScript enabled to view it
data
mail test
.

 

Add comment


Security code
Refresh

More KB Articles