One of our customers is looking for us to support addresses of the form
username+extension@???, primarily for use with procmail (I'll
enclose the section of the procmail documentation that details it's use in
sendmail). Has anyone done this already?
If not, does anyone have any suggestions? I can probably handle the
actualy delivery part, but configuring our relays to handle it has me
stumped. The problem is that our relays look up the incoming address and
rewrite the envelope-to to redirect it to the server containing their
mailbox. So user@??? might be rewritten as
differentuser@???. How would I do the lookup for
user@??? in the domain.com database while holding onto +extension
and then rewrite the address so that it is
differentuser+extension@???.
Any ideas? Please? :)
TIA,
Tabor
Snippet of procmail documentation follows.
---------------------------------------------------------------------------
In order to take advantage of the optional meta argument that can be
passed to procmail you'd have to change the sendmail.cf file to add a
$#local mailer rule to set the $@ host name (which will be substituted for
$h in the mailer definition). There is nothing forcing you to do this,
but if you do, you'll gain functionality. If you are using sendmail 8.7.*
or newer, and are using the standard FEATURE(local_procmail), then the
support for this meta argument is already present.
For example:
Make sure that the definition of operators in the sendmail.cf file
includes the + sign (simply tack a + to the end of the "Do" definition,
unless it already contains one).
Now look for ruleset zero (S0), skip to the end of it. There
usually is a rule there that takes care of local delivery, something
like:
R$+ $#local $:$1 local names
Don't change that rule, leave it there. But, right BEFORE this
rule, create a new one similar to:
R$++$* $#local $@$2 $:$1 local argument
Depending on the actual contents of your sendmail.cf file, there
still might be some other $#local rule(s) you need to precede with
a corresponding +-handling rule, e.g. in some files you also
find:
R$+ < $+ @ $+ > $#local $: $1
Preceed that with:
R$+ + $* < $+ @ $+ > $#local $@ $2 $: $1
(The spaces are not significant, the tabs are!)
Now, if someone sends mail to fred+pizza@???, procmail
will be called to deliver the mail as:
procmail -a pizza -d fred
In the .procmailrc file, you can now do an assignment like:
ARGUMENT=$1
which will expand to ARGUMENT=pizza.
---------------------------------------------------------------------------
--
________________________________________________________________________
Tabor J. Wells twells@???
Shore.Net Systems Admin. Just another victim of the ambient morality
--
*** Exim information can be found at
http://www.exim.org/ ***