From: cbbs70a on
All;
Its been way too many years since I've written any rule sets so I am
hoping that someone here will have mercy on me. I need to setup a rule
such that any inbound email that matches gets forwarded to a
particular user. That is, I have a host, mail.acme.com and any email
that contains only digits as the user (ie, 12345(a)mail.acme.com or
456(a)mail.acme.com) will get forwarded to user 'foobar'. Any insight at
all would be greatly appreciated.
Thanks
Frank
From: Andrzej Adam Filip on
cbbs70a <frank(a)digennaro.com> wrote:
> All;
> Its been way too many years since I've written any rule sets so I am
> hoping that someone here will have mercy on me. I need to setup a rule
> such that any inbound email that matches gets forwarded to a
> particular user. That is, I have a host, mail.acme.com and any email
> that contains only digits as the user (ie, 12345(a)mail.acme.com or
> 456(a)mail.acme.com) will get forwarded to user 'foobar'. Any insight at
> all would be greatly appreciated.

Based on:
http://groups.google.com/group/comp.mail.sendmail/msg/6c92c14e01082f5e
Newsgroups: comp.mail.sendmail
From: Andrzej Filip <a...(a)priv.onet.pl>
Date: Wed, 22 Oct 2003 09:49:00 +0000
Subject: Re: Handling sites that don't support plussed addressing

Add the following lines in your *.mc file
[put tab between $* and $: in R line]:

LOCAL_CONFIG
Kdigit regex -s1,2 -dfoobar+ ^()([0-9]+)$
LOCAL_RULE_0
R$+ <@mail.acme.com.> $* $: $(plus $1 $: $1 $) <@mail.acme.com.> $3

It should redirect email addressed to 12345(a)mail.acme.com to
foobar+12345(a)mail.acme.com. In typical sendmail configuration
foobar+12345 will be delivered to foobar but e.g. ~foobar/.procmailrc may
get 12345 in $1.

--
[pl>en Andrew] Andrzej Adam Filip : anfi(a)onet.eu : Andrzej.Filip(a)gmail.com
http://open-sendmail.sourceforge.net/ http://anfi.homeunix.org/
A man does not look behind the door unless he has stood there himself.
-- Du Bois