On Tue, Feb 27, 2001 at 12:08:12AM -0700, Andy Bradford wrote:
> Not necessary.  They will be queued up in qmail's mail queue until they 
> can be delivered to their mail server (or until the message has been in your 
> queue too long and the message bounces).  Simple really.

We've had simmilar problems with "dialup customer" wanting their email
delivered via SMTP.
What we did (and also use for some backup MX customers, that turn off
their mailservers during weekends *argl*) is to use a maildirsmtp
setup.
I find it pretty annoying having some 1000 email for them in the
"active" qmail queue and the customers complain "that some emails
take a long time to arrive although the mailserver is back up again"
(this is due to the quadratic backoff).

What we do:

1) create a  /var/qmail/channels/serialmail  directory.
2) in this directory create another directory "dom.ain"
3) in this directory create a maildir (e.g. called "Maildir") and
   a .qmail-default file containing
   ./Maildir/
4) add to users/assign a line like:
   +dom.ain-:qmaild:101:101:/var/qmail/channels/serialmail/dom.ain:-::
   (101:101 is the uid:gid for qmaild:nofiles - this is because of
   section 10) below ;-)
5) run qmail-newu
6) add lines to control/virtualdomains
   dom.ain:dom.ain
   .dom.ain:dom.ain
7) kill -HUP pidof(qmail-send)

Now mails for [EMAIL PROTECTED] will end up in the maildir
   /var/qmail/channels/serialmail/dom.ain/Maildir/
If the customer has more than one domain (e.g. .net, .com. org) you can
use in virtualdomains
   example.com:dom.ain
   .example.com:dom.ain
   example.net:dom.ain
   .example.net:dom.ain
And they will end up in the same directory.

8) In /var/qmail/channels/serialmail/dom.ain create a file "RELAYHOST"
   and put in it the name of the mail exchanger for that dom.ain
   (e.g. mail.dom.ain)
9) All you need now is a script that periodically scans (we use 3
   minutes) all the /var/qmail/channels/serialmail/dom.ain directories,
   checks if there are eMails in Maildir/new.
   If so, flock the RELAYHOST file (to avoid concurrent deliveries)
   and start  maildirsmtp  to try to deliver the email to `cat RELAYHOST`
   We do this in a two way style, so we have one scanner and one
   deliverer thats been forked off from scanner.
   The maildir command would look like
      maildirsmtp /var/qmail/channels/serialmail/dom.ain/Maildir \
        dom.ain-  `cat .../dom.ain/RELAYHOST`  mail.mydom.ain
   (don't forget the trailing "-" on  dom.ain- above)
10) we also use tcpserver to set the ETRN="dom.ain" Variable for the ip
   the mail.dom.ain runs on and we use a wrapper to qmail-smtpd that
   checks for the existance of the ETRN Variable and if it exists it
   forks off deliverer for dom.ain (kinda AutoTURN like ETRN).

We use this setup for about two years now and it works like a charm.
There is only one problem: if the customer changes the mail exchanger
without telling you *sigh*

The scripts for scanner and deliverer are in perl, the qmail-smtpd
wrapper is in sh.
If I find some time, I'll write some docs and cleanup the code and
put it up for public retrival. *sigh* but I cannot promise any date
as I have nearly zero spare time right now :/

        \Maex

-- 
SpaceNet AG            | Joseph-Dollinger-Bogen 14 | Fon: +49 (89) 32356-0
Research & Development |       D-80807 Muenchen    | Fax: +49 (89) 32356-299
Stress is when you wake up screaming and you realize you haven't fallen
asleep yet.

Reply via email to