I would like to share an idea how to implement queue mailer.
It may be used to move mail for servicing down sites,
infrequent dialup sites [they never call during night so you set
longer warning time-outs when processing the other queue]
and much much more [possibilities are endless :-) ]
PLEASE DO SEND YOUR COMMENTS!!!
Basic idea is as follows you speak ESMTP to another sendmail
which stores the message in another queue. ESMTP is used to
avoid lost of any information (e.g. DSN).
I have seen some similar mailers but one one of the used ESMTP
so some information could be lost.
Queue mailer has been tested on sendmail 8.8.7
Here queue is standard esmtp mailer (for comparison):
----------------------------------------------------->
Mesmtp, P=[IPC],
F=mDFMuXa,
S=11/31, R=21/31, E=\r\n, L=990, T=DNS/RFC822/SMTP,
A=IPC $h
<-----------------------------------------------------
And here is new queue mailer:
----------------------------------------------------->
Mqueue, P=/usr/lib/sendmail,
F=SkmDFMuXa,
S=11/31, R=21/31, E=\r\n, L=990, T=DNS/RFC822/SMTP,
U=root:root,
A=sendmail -odd -bs -C /etc/queue.cf -oQ/var/spool/mqueue/$h
<-----------------------------------------------------
Changes:
1) P= : sendmail is used instead of built in [IPC] mailer
2) F=k : k flag is added so sendmail does not check loops in HELO
command
[it is willing to speak to itself - a sign of insanity :-) ]
3) F=S & U=root:root : run as root [ it is not needed it every case
but I want new queue to be a sub directory of the queue ]
4) A= :
-odd - deferred delivery mode (no DNS lookups, store in queue)
-bs - speak ESMTP
-C /etc/queue.cf - use another configuration file [ described later
]
-oQ/var/spool/mqueue/$h - queue directory location - I assumed that
it is a sub directory of standard queue directory
queue.mc file used to generate /etc/queue.cf
(must be modified):
----------------------------------------------------->
divert(-1)
include(`../m4/cf.m4')dnl
OSTYPE(`linux')dnl
undefine(`ALIAS_FILE')dnl
define(`confLOG_LEVEL',`4')dnl
FEATURE(`always_add_domain')dnl
FEATURE(`nullclient',`your.host.name')dnl
<-----------------------------------------------------
Fixes required in your queue.mc:
1) change OSTYPE to system you use
2) in nulclient feature use name of your system
USAGE:
I recommend use via mailertable e.g.:
down.host.domain queue:down-host
And when the host is up again remove the entry and run
sendmail -q -oQ/var/spool/mqueue/down-host
--
Andrzej (Andrew) A. Filip fax: +1(801)327-6278
mailto:an...@bigfoot.com http://bigfoot.com/~anfi
Postings: http://deja.com/profile.xp?author=Andrzej%20Filip