I would like to share an idea how to implement "move to another queue" mailer. It may be used to move mail for servicing down sites, infrequent dial-up 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 :-) ]
Before applying the suggestion below read about queue groups introduced by sendmail 8.12 - it may be a good alternativeTHIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS``AS IS'' AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
THE AUTHOR NAME MUST BE QUOTED IN ANY WORK DERIVATED FROM THE WORK.
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:
queue.mc file used to generate /etc/queue.cf (requires changes for your system)
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:
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
The
posting
Subject: Requeue mailer
Date: 1999-06-03
Newsgroups: comp.mail.sendmail
Message-ID: <377E28F7.C2E9BF3C@bigfoot.com>