procmail
[Top] [All Lists]

Re: newbie - help with a simple filtering recipe

2006-01-03 01:46:46
On Mon, 2 Jan 2006, arbatax wrote:

Hi all,

I have a small server with 6 users and I am looking for a simple filter that 
can
sort the mail that is downloaded to one single account via fetchmail.

Mail should be sorted based on the "to" headers and copied to the relevant
mailboxes. With one exception: user1 should be able to get his own mail and
user2's mail as well.

The recipe kind of works as it is, but there are a couple of problems:

- if I send mail to user1, he gets 2 copies of the same message
- if I send mail to user2, he gets the mail, but user1 doesn't and the 
following
error is displayed in the log:

Error while writing to "/var/spool/mail/user1"

I have been struglging with the documentation for a couple of days bu this is 
as
far as I was able to get. Any help will be greatly appreciated.

RECIPE:



PATH = $HOME/bin
SHELL=/bin/sh
LOGFILE=/var/log/procmaillog
VERBOSE=yes
MAILDIR=$HOME/mail

:0Hc:
* 
^(for|Cc|To)(_dot_)*user1(_at_)mydomain\(_dot_)com|(_dot_)*user2(_at_)mydomain\(_dot_)com
/var/spool/mail/user1

        Omit the "H".  And you have error:

:0c:
* 
^(for|Cc|To).*(user1(_at_)mydomain\(_dot_)com|(_dot_)*user2(_at_)mydomain\(_dot_)com)
/var/spool/mail/user1

        Or better:

:0c:
* ^(for|Cc|To):.*\<(user1|user2)@mydomain\.com\>
/var/spool/mail/user1

        What does the log say?

Bye,
  Udi




:0H:
* ^(for|Cc|To)(_dot_)*user2(_at_)mydomain\(_dot_)com
/var/spool/mail/user2

:0H:
* ^(for|Cc|To)(_dot_)*user3(_at_)mydomain\(_dot_)com
/var/spool/mail/user3

:0H:
* ^(for|Cc|To)(_dot_)*user4(_at_)mydomain\(_dot_)com
/var/spool/mail/user4

:0H:
* ^(for|Cc|To)(_dot_)*user5(_at_)mydomain\(_dot_)com
/var/spool/mail/user5

:0H:
* ^(for|Cc|To)(_dot_)*user6(_at_)mydomain\(_dot_)com
/var/spool/mail/user6



____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

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