I'll do my best ...
uwe(_at_)uweklaus(_dot_)de wrote:
OK, thank you, but can you explain me something about that?
^.*for\ *<?
is there to catch mail that has been forwarded (e.g by procmail on another
machine :-)
to one of your recipients (e.g aaa(_at_)domain(_dot_)de). The address
(aaa(_at_)domain(_dot_)de)
will not appear in the To:, Cc: fields of the header then, but it can be found
in the
"routing part" of the header (which normally says something like "... for
<aaa(_at_)domain(_dot_)de> ...".
The above regex finds such a match.
The ^.*for\ *<? matchs the BCC too?
I'm not sure, however, about Bcc:, but I __think__ it will catch such mail.
Expanding the TO_ macro indicates that it should match on Bcc:, but I've never
seen a header Bcc: in a mail (and why should I, I mean, you normally use Bcc:
to make the address "invisible" to other recipients of the mail).
But the mail gets routed to the correct mailbox and that ought to be reflected
by the routing part of the header, so yes, it should catch Bcc'ed mail as
well.
Maybe one of the Gurus of this mailing-list can enlighten us?
Who's Homedirectory is, in this case, $HOME ??
$HOME is the home directory of the user to whose mailaccount all
mail to domain domain.de is forwarded by the MTA. Procmail is
used by this user as the LDA (invoked by a .forward-file
in the users home directory).
Is this correct?: The first $MATCH = aaa(_at_)domain(_dot_)de
Correct!
Thank You
Uwe KLAUS
Hope that helps,
Klas
--
Klas Brink GSM: +46 701 808 502
BitSim AB Office: +46 8 54 55 56 00
St Eriksgatan 33 Fax: +46 8 54 55 56 11
112 39 Stockholm Work: +46 8 719 54 52
Sweden WWW: www.bitsim.com
Klas Brink <qtxklas(_at_)etxb(_dot_)ericsson(_dot_)se> wrote ..
Here is one suggestion:
------------------
:0 c
* (^TO_|^.*for\ *<?)\/(aaa(_at_)domain\(_dot_)de)
{
# Remove duplicates:
:0 Wh: msgid.lock
| formail -D 8192 $HOME/$MATCH/msgid_cache
:0 E
! $MATCH
}
:0 c
* (^TO_|^.*for\ *<?)\/(bbb(_at_)domain\(_dot_)de)
{
# Remove duplicates:
:0 Wh: msgid.lock
| formail -D 8192 $HOME/$MATCH/msgid_cache
:0 E
! $MATCH
}
:0
* (^TO_|^.*for\ *<?)\/(ccc(_at_)domain\(_dot_)de)
{
# Remove duplicates:
:0 Wh: msgid.lock
| formail -D 8192 $HOME/$MATCH/msgid_cache
:0 E
! $MATCH
}
Best regards,
Klas
--
Klas Brink GSM: +46 701 808 502
BitSim AB Office: +46 8 54 55 56 00
St Eriksgatan 33 Fax: +46 8 54 55 56 11
112 39 Stockholm Work: +46 8 719 54 52
Sweden www: www.bitsim.com
Uwe KLAUS wrote:
Hi,
We have a collective mailbox by our ISP (all mail to
xyz(_at_)domain(_dot_)de goes
in this box).
User ddd fetches all messages. His procmailrc is as this:
VERBOSE=on
LOGABSTRACT=all
LOGFILE=/home/ddd/procmail
MAILDIR=/var/spool/mail
:0
* ^TO_aaa
! aaa
:0
* ^TO_bbb
! bbb
:0
* ^TO_ccc
! ccc
#the rest is for user ddd himself.
This rule works fin, but - when someone writes a messages to two users
in our domain, in example to aaa(_at_)domain(_dot_)de AND
bbb(_at_)domain(_dot_)de, the both
adresses are in two mails. Therefore rule one matches by both mail and
so user aaa becomes two mails and user bbb none.
When I change the rules, not to move the mails but to copy them, both
users become the mail twice.
Do you have any Solution?
Thank You
Uwe KLAUS
and
PLEASE FORGIVE MY STUPID ENGLISH