Web Hosting Talk







View Full Version : procmail


netserve
09-17-2001, 07:54 PM
I think I've read just about every site with example procmail rcfile examples and I've still not found what I need.

I'm looking for a simple script to take an email and foward it on to two other email addresses. The only tricky bit is that I want the alias from the original address to be used as the alias on the two forwarding addresses.

ie mail to bob@domain.com goes to bob@address1.com and bob@address2.com

Anyone done this or knows how to?

cperciva
09-17-2001, 08:14 PM
I don't know how to do this with procmail, but it's easy with qmail ;)

netserve
09-18-2001, 05:18 AM
You must be an accountant. Your answer is technically correct but useless :-)

RutRow
09-18-2001, 09:48 AM
I don't know about procmail, but it is quite easy to do with sendmail.

Add this line to virtusertable:

bob@domain.com redirectedemails


Add this to aliases:

redirectedemails: bob@address1.com, bob@address2.com



Rebuild your databases...... et voila.

"redirectedemails" is just a tag. You can call it whatever you want.

On a RedHat system, virtusertable is in /etc/mail, and aliases is in /etc.

netserve
09-18-2001, 10:06 AM
Sorry but I think you've missed the point.
If you add

@domain.com %1@someisp.com to virtusertable then sendmail will rewrite the alias used on domain.com and add it to @someisp.com

I want to do the same thing but to forward the email to two separate domains rather than just one.

I can rewrite via virtusertable to one address but not two, and I can forward to two addresses via the aliases table but not rewrite.

Hence the need to do this with procmail. :-)