On Thu, Nov 16, 2000 at 08:55:03AM -0600, Charles Cazabon wrote:
> Essentially you want AutoTURN. It's better than ETRN and requires no
> special support by the client.
We use a similar approach.
However, we do queue the eMails in Maildirs mapped to domain names,
i.e. /var/qmail/etrn/example.com
which contains a
.qmail-default ./Maildir/
./Maildir
RELAYHOST 1.2.3.4 # defines IP to deliver to
Via tcpserver and ACLs we do mappings like
1.2.3.4:allow,RELAYCLIENT="",ETRN="example.com"
This allows us to define IPs that trigger AutoTURN for a specific
domain (and the IP that triggers AutoTURN hasn't even to be the
mailserver the mails get delivered to).
However there are some mailservers that are set up to explicitely
"trigger" ETRN that give up with qmail as qmail doesn't know about ETRN
commands. Give up means even if they are configured to e.g. connect
every 30 minutes to ETRN they stop at all as they get a 500 code from qmail.
I have added this code to qmail-smtpd.c:
(sorry no patch, as we're still on a qmail-1.01 and it is *heavily*
patched, so a patch would not apply).
char *env_etrn;
in getenvs() add
env_etrn = env_get("ETRN");
/* ------------------------------------------------------------------------ */
void smtp_etrn(arg) char *arg; {
if (env_etrn) { out("250 OK, queuing for node "); out(env_etrn); out("
started\r\n"); }
else { if (!arg) { out("500 Syntax Error\r\n"); }
else { out("459 Node "); out(arg); out(" not allowed: not
configured\r\n"); }
}
}
/* ------------------------------------------------------------------------ */
and also add
{ smtp_etrn, "etrn", 1 }
to the smtpcmd[] struct.
tcpserver now starts a script "qmail-smtpd-etrn" that looks like this:
# ------------------------------------------------------------------------
#!/bin/sh
[ ! -z "$ETRN" ] && {
(
exec </dev/null >/dev/null 2>&1
/var/qmail/bin/sm-delivery $ETRN </dev/null 2>&1 | /var/qmail/bin/splogger
"serialsmtp" 17 &
) &
}
exec /var/qmail/bin/qmail-smtpd
# ------------------------------------------------------------------------
/var/qmail/bin/sm-delivery in turn is a small script that basically
- exists, if it can't get a lock on
/var/qmail/etrn/$ETRN/RELAYHOST
- otherwise locks /var/qmail/etrn/$ETRN/RELAYHOST and starts delivering
eMails from /var/qmail/etrn/$ETRN/Maildir via maildirsmtp to the host
listed in /var/qmail/etrn/$ETRN/RELAYHOST
\Maex
--
SpaceNet GmbH | http://www.Space.Net/ | Stress is when you wake
Research & Development | mailto:[EMAIL PROTECTED] | up screaming and you
Joseph-Dollinger-Bogen 14 | Tel: +49 (89) 32356-0 | realize you haven't
D-80807 Muenchen | Fax: +49 (89) 32356-299 | fallen asleep yet.