README for 8.9.1a-envto+etrnprog.dif Version 1.0 20-Oct-1998 0. INTRODUCTION This patch really does two things: 1. The original Envelope-To information is saved for each adressee and can be added as a header at final (local) delivery Envelope-To address during delivery. 2. A new option is introduced, EtrnProg, that defines a program to be executed at ETRN time instead of sendmail handling it internally. 1. NEW OPTION: EnvelopeToHeader 1.1 WHAT IS IT If this option is set, a header with the name of this option and the value of the Envelope-To address is added if final (local) delivery is performed. It is useful to add an Envelope-To header line to locally delivered mail so that all mail for a domain can be dumped into a local mailbox for retrievement with POP3 without the loss of Envelope-To information. 1.2 USAGE Example to add an X-Envelope-To header to all locally delivered mail: a. You need to turn off the `m' flag in sendmail.cf for the mailer that does local delivery, usually Mlocal. You don't want the Envelope-To information to be shared between unrelated accounts. In fact sendmail will ensure that the Envelope-To header doesn't get added for local mailers with the `m' flag turned on. b. You have to turn on the EnvelopeToHeader option by adding the following to the option list in sendmail.cf: # Add X-Envelope-To to locally delivered mail O EnvelopeToHeader=X-Envelope-To If you are using the m4 stuff to generate the sendmail.cf file, you can add this under the LOCAL_CONFIG macro: LOCAL_CONFIG # Add X-Envelope-To to locally delivered mail O EnvelopeToHeader=X-Envelope-To 1.3 CHANGES TO THE QUEUE FILE FORMAT The standard queue file now has an extra field called `Y'. In the queue file, multiple `Y' lines may be present before the `R' line that defines a recipient. The `Y' line defines an original recipient, all Y lines together are the Envelope-To information for this new (local) recipient. 2. NEW OPTION: EtrnProg If you somehow deliver queued SMTP mail in another way than usual, you need to intercept the ETRN command. If the option EtrnProg is set, sendmail will execute that program upon receiving the ETRN command. To define the EtrnProg option, see the above example of how to define the EnvelopeToHeader. The EtrnProg program will be executed with 2 arguments: /path/to/etrnprog {ip number of client} {argument to the ETRN command} This sample perl script duplicates the functionality of the internal ETRN command: #! /usr/bin/perl $arg = $ARGV[1]; # The sendmail implementation of the -qR option and the ETRN # part of the RFC don't agree about the @ sign if ($arg =~ m/^@/) { $arg =~ s/^@//; } else { $arg = "@" . $arg; } exec("/usr/sbin/sendmail", "-qR$arg"); 20-Oct-1998 Miquel van Smoorenburg