LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   fetchmail + procmail (?) (https://www.linuxquestions.org/questions/linux-networking-3/fetchmail-procmail-35267/)

markus1982 11-12-2002 09:57 AM

fetchmail + procmail (?)
 
Following situation:

There is a so called catch-all-account (all emails for a specific domain are sent into this account no matter where they were sent to). On another server there is fetchmail running and getting those mails ... and should forward those mails to another server then, let's say if you send an email to alpha@beta.com it's sent to that catch-all-account ...


Now the 2nd server should be doing a fetchmail and forward the mail for the domain beta.com to another server BUT should also send it to the user specified in the original message (alpha).


Anybody has a solution? Maybe with procmail or something alike?

unSpawn 11-12-2002 06:18 PM

Ahhh, procmail... spose it's scripting time. Dunno if this works, if it fails I spose it's in the "To:" addressing, you get the idea to work it out further I hope.

:0
# X-header "X-CC-Original-To" being indication
# we haven't processed this msg yet, tack it on.
* ! ^X-CC-Original-To:
CCTO=| formail -rzx To:
| formail -A "X-CC-Original-To: ${CCTO}"
{
# No send off a copy to the original To: addy
:0c
! ${CCTO}
# Finally file message
:0
$DEFAULT
}


All times are GMT -5. The time now is 08:10 PM.