procmail
[Top] [All Lists]

Re: Well traveled emails

2001-07-02 21:51:07
Well, it seems to me that this is something you
want to do with the MTA, the mail transport agent,
in your case sendmail.

Is there any possibility that you might do this
with postfix? The reason being, is that postfix,
rather than sendmail, really really likes virtual
domains. I don't know sendmail well
enough, but I never could get sendmail to
do as much as I would like with virtual mail
as with postfix. I'll describe most of the MTA
setup for postfix here. 

for example, the configuration for a new virtual
domain would be this:

main.cf
virtual_maps = hash:/etc/postfix/virtual, pcre:/etc/postfix/pcre

/etc/postfix/virtual:
spherion.com            dummyvalue
user1(_at_)spherion(_dot_)com   useraccount
user2(_at_)spherion(_dot_)com   somewherelse(_at_)somwhere(_dot_)com
user3(_at_)spherion(_dot_)com   anotheruseraccount
@spherion.com           singleuseraccount

specialuseraccount would the account in this
case to catch all the variable names as you have
said.

Now, the really interesting thing is that you can
change the "deliver-to" field to remember the
original email by utilizing "+" entries which forces
you to use the some regular expression processing.

/etc/postfix/virtual
spherion.com            dummyvalue
user1(_at_)spherion(_dot_)com   useraccount+user1.spherion.com
user2(_at_)spherion(_dot_)com   somewherelse(_at_)somwhere(_dot_)com
user3(_at_)spherion(_dot_)com   anotheruseraccount+user3.spherion.com

/etc/postfix/pcre
/^spherion\.com$/       dummyvalue
/^(.*)@spherion\.com$/  singleuseraccount+$1.spherion.com

Any mail sent to the single user account (I called it
"singleuseraccount" would retain the original email
adress. Let's say your mailserver is mail.hoopy.com.
An email sent to bubba(_at_)spherion(_dot_)com would
be sent to the single user account called
singleuseraccount(_at_)mail(_dot_)hoopy(_dot_)com but the
deliver-to field would read:
singleuseraccount+bubba(_dot_)spherion(_dot_)com(_at_)mail(_dot_)hoopy(_dot_)com

Since all information is retained you can then
process it any way you want.

Alex Miller


On Monday 02 July 2001 23:29, Michael Piko wrote:
Hi People

My problem:

We have many users around the world who all have user(_at_)spherion(_dot_)com
addresses. I am in Australia and it seems silly that if I want to send an
email to the guy next to me that this email should head off across the
world (to the States) before reaching the destination in the next office.
(especially with the size of some of the attachments that are "floating"
about)

I want to set up sendmail to scan the virtual usertable and if it does not
find a match, to forward it to a single user account. - this is where I
would like procmail to step in and forward all mail it receives to our main
server in the States. Thus cutting out a couple of thousand miles.

All documents I have read so far are mainly aimed at filtering mail into
mailboxes, but I am sure that if procmail can send a reply then it should
be able to do this task.

If anyone has any ideas, good tutorials, or previous experiences (or can
tell me if I am barking up the wrong tree) in this area, it would be great
to hear from you.


Michael.
_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>