Jesse Ferrell (CASI) <news(_at_)weatherwatchers(_dot_)org> wrote:
The second adressee (i.e. me) never gets the message.
Any ideas what's going on here, or how I can fix it?
Let me see if I understand this correctly.
If a mail is addressed to xxxx(_at_)weatherwatchers(_dot_)org you
want it to go to your wife. If it's addressed to anything
other than xxxx, you want it to come to you. Correct?
If so, here are a couple of recommendations.
First, if you forward, you should use a loop breaking
mechanism (like X-Loop: -- see procmailex(1)).
Second, rather than explicitly saying "To:" and "Cc:"
I suggest using ^TO_ or ^TO (see procmailrc(1) for what
these mean).
Finally, and this answers your original question, your recipes
forward the message to your wife, and are thus _delivering_
recipes. As the procmailrc(1) manpage says:
| ering recipes. If a delivering recipe is found to match,
| procmail considers the mail (you guessed it) delivered and
| will cease processing the rcfile after having successfully
| executed the action line of the recipe. If a non-deliverュ
So after delivering the message, procmail "will cease processing"
the message, so it won't get forwarded to you. How to fix it?
Prof. Salmi probably has a nicer solution than this, but here's
something that might work. This also includes the other 2
recommendations. It isn't tested, use at your own risk, etc.
For purposes of illustration I'm gonna assume your wife's
account on weatherwatchers.org is "Nora".
This fragment is of course untested; use it at your own risk.
# break mail loops
:0
* ^X-Loop: (_dot_)*(_at_)weatherwatchers(_dot_)org
/dev/null
# Forward to wife?
# NOTE: depending on your version of procmail you
# might have to use "^TOnora" instead of "^TO_nora"
:0
* ^TO_nora(_at_)weatherwatchers(_dot_)org
{
# Yes, forward it!
# First, prevent mail loops.
:0 fhw
| formail -i "X-Loop: nora(_at_)weatherwatchers(_dot_)org"
# Forward a copy to wife
:0c
! WifeRealAccount(_at_)home(_dot_)com
# If NOT addressed to anyone else too, then send to /dev/null
:0
* ! ^TO_[-a-zA-Z0-9(_dot_)_]{1-3}(_at_)weatherwatchers(_dot_)org
* ! ^TO_[-a-zA-Z0-9(_dot_)_]{5-99}(_at_)weatherwatchers(_dot_)org
* ! ^TO_[^n][-a-zA-Z0-9(_dot_)_]{3}(_at_)weatherwatchers(_dot_)org
* !
^TO_[-a-zA-Z0-9(_dot_)_][^o][-a-zA-Z0-9(_dot_)_]{2}(_at_)weatherwatchers(_dot_)org
* !
^TO_[-a-zA-Z0-9(_dot_)_]+[^r][-a-zA-Z0-9(_dot_)_](_at_)weatherwatchers(_dot_)org
* ! ^TO_[-a-zA-Z0-9(_dot_)_]+[^a](_at_)weatherwatchers(_dot_)org
/dev/null
# If we get here, it musta been addressed to someone else since
# if it wasn't, it woulda gone to /dev/null. So just fall through.
}
# At this point, either it wasn't addressed to my wife (in which case
# I'll take it) or it was addressed to my wife, but it was ALSO
# addressed to someone else -- again, I'll take it.
and then continue with the processing you do for yourself.
One issue with this is that if mail isn't addressed at all, e.g., if
mail is sent to mailing-list, then will it contain the string
"weatherwatchers.org" in neither the "To:" nor "Cc:" header line
(but maybe there'll be a "Received...for <xxx(_at_)weatherwatchers(_dot_)org>"
line)... in which case the above recipe won't work very well.
hth
collin
--
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