procmail
[Top] [All Lists]

Re: Mail rewriting (FAQ?)

1998-08-04 19:29:29
I have 2 types of things going (on solaris though because that's where
our mail comesin, but it sholdn't make a difference).

First, forward a mailing list to friends:

# Forward GermNews to a few others
GERMNEWS=hgo14,kepplert,axel(_dot_)wilke(_at_)ccc(_dot_)govt(_dot_)nz
:0 c:
* ^Sender:.*s going on in Germany - a summary of daily news from Germany
* ^To: *GERMNEWS(_at_)LISTSERV(_dot_)GMD(_dot_)DE
$LISTS/GermNews-List
#
:0 A
! $GERMNEWS

Second, a simple mailing list for some friends of mine. I can't use
smartlist because it has to run over my own email address (I am not the
ISP/sysop so can't set up new email addresses). Detection "is this for
the list" works by either the subject starting with a certain string,
or a special header line being found.

# Excuse of a "mailing list" for NZ visitors
NZVISITORLISTXLOOP="X-Loop: VolkerNZ-List"
NZVISITORLIST=email1,email2,email3
# see what's actually going out:
NZVISITORLIST=$NZVISITORLIST,kuhlmav(_at_)elec(_dot_)canterbury(_dot_)ac(_dot_)nz
#NZVISITORLIST=kuhlmav(_at_)elec(_dot_)canterbury(_dot_)ac(_dot_)nz
:0
* (^X-VolkerNZ-List: *[yYjJ]|^Subject: *(|Re: )VolkerNZ-Besucher-Liste)
* !^FROM_DAEMON
* !^FROM_MAILER
#* !^$NZVISITORLISTXLOOP
* !^X-Loop: *VolkerNZ-List
* ^TOkuhlmav(_at_)elec
{
:0 c:
NZ-Besucher
:0 fhw
| formail -f -A "$NZVISITORLISTXLOOP" -i "To: $NZVISITORLIST"
:0
! $NZVISITORLIST
}

hard to belive maybe, but it does work.

Volker

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