Hosted by PSE.pl | Created: 1999-10-23 | Last update: 2004-03-17 07:40:32 UTC | GnuPG signature of this page
anfiTop | anfiUp | Andrzej Filip | Mirror Sites | GnuPG Keys | New!google
googleMy Postings | slashdotJournal | Showing Gratitude
Personal | Sendmail | Exim | General MTA | Cyrus IMAP | UUCP

ReQueue mailer

Abstract

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 alternative
Copyright (c) 1999 Andrzej Filip

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 (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:

  1. change OSTYPE to system you use
  2. in nulclient feature use name of your system

Case Study (A) - Handling down hosts

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

Original Posting

googleThe posting
Subject: Requeue mailer
Date: 1999-06-03
Newsgroups: comp.mail.sendmail
Message-ID: <377E28F7.C2E9BF3C@bigfoot.com>