Wouter van der Horst wrote:
i've been trying to make a recipy (or several) which
accomplishes the following:
- forwards the email for any and all *(_at_)anakha(_dot_)net people to
them, and if there's one for wouter(_at_)anakha(_dot_)net, leave it
in the mailbox. this should take into consideration that
one message could be addresses to any number of people
in *(_at_)anakha(_dot_)net
This is not too hard, and you've made a good start.
Now, as for a clean or elegant solution, I think you may want to do
something with your MTA (like aliases or the user database), but I
don't have details; perhaps the sendmail FAQs?
- any email for non *(_at_)anakha(_dot_)net addresses should remain in
the inbox.
This is harder.
I have two questions.
1. What if mail is addressed as:
To: xyzzywefvsdfew(_at_)anakha(_dot_)net
where "xyzzywefvsdfew" doesn't exist? Can we just ignore such a mail?
2. What if people are on mailing-lists? For example, this email
wouldn't match
* ^TO_wouter(_at_)anakha(_dot_)net
. I will ignore this problem for the moment.
needless to say, none of the example recipies that i've found
gave me the answer, and my programming knowledge and ability
for logical thought just isn't up to it.
i've got something that kinda works now, but i still keep getting
duplicate emails. this is my .procmailrc (don't laugh!):
You've made a good start. Here is how I would change it...
:0c
* ^TO_famke(_at_)anakha(_dot_)net
! m(_dot_)mesch(_at_)wanadoo(_dot_)nl
# ...
# several left out
# ...
:0c
* ^TO_matthijs(_at_)anakha(_dot_)net
! matthijs(_dot_)sneijders(_at_)chorusgroup(_dot_)com
:0:
* ^TO_wouter(_at_)anakha(_dot_)net
$DEFAULT
# At this point, mail has been delivered to all known addressees
# (whose addresses have appeared in the header). Also, mail has
# NOT been delivered to $DEFAULT mailbox. So we will now search
# for non-"anahka.net" addresses.
# NOTE: if mail comes addressed as:
# From: collin77(_at_)yahoo(_dot_)com
# To: matthijs(_at_)anakha(_dot_)net
# cc: collin77(_at_)yahoo(_dot_)com
#
# then it will match the first recipe below and go to your mailbox.
# Do you really want this effect?
:0:
* ^TO_(_dot_)*(_at_)[^a]
$DEFAULT
:0:
* ^TO_(_dot_)*(_at_)a[^n]
$DEFAULT
:0:
* ^TO_(_dot_)*(_at_)an[^a]
$DEFAULT
:0:
* ^TO_(_dot_)*(_at_)ana[^k]
$DEFAULT
:0:
* ^TO_(_dot_)*(_at_)anak[^h]
$DEFAULT
:0:
* ^TO_(_dot_)*(_at_)anakh[^a]
$DEFAULT
:0:
* ^TO_(_dot_)*(_at_)anakha[^(_dot_)]
$DEFAULT
:0:
* ^TO_(_dot_)*(_at_)anakha\(_dot_)[^n]
$DEFAULT
:0:
* ^TO_(_dot_)*(_at_)anakha\(_dot_)n[^e]
$DEFAULT
:0:
* ^TO_(_dot_)*(_at_)anakha\(_dot_)ne[^t]
$DEFAULT
:0:
* ^TO_(_dot_)*(_at_)anakha\(_dot_)net[-_(_dot_)a-z0-9]
$DEFAULT
hth,
--
Neither I nor my employer will accept any liability for any problems
or consequential loss caused by relying on this information. Sorry.
Collin Park Not a statement of my employer.
_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail