procmail
[Top] [All Lists]

Re: Multiple Users with one login

2002-02-28 19:20:12
I got it work with the following setup. At least it passed all the tests I
put to it. I am sure there is a way to simplify it, not to mention I have to
add a new ruleset for each To: I plan to filter. I need to add some loop
checks, etc...

I am glad to just get it working.

-----code-------
SHELL=/bin/sh
MAILDIR=${HOME}/Mail
LOGFILE=${HOME}/procmail.log
LOG="--- Logging ${LOGFILE} for ${LOGNAME}, "
# VERBOSE=YES

# FIRST RULE
:0
* ^To: (_dot_)email1(_at_)mydomain(_dot_)net
 {
  :0c
  /usr/home/email/email1
   :0
{
:0
* ^Cc: (_dot_)email2(_at_)mydomain(_dot_)net
/usr/home/email/email2
}
   :0
{
:0
* ^Cc: (_dot_)email3(_at_)mydomain\(_dot_)net
/usr/home/email/email3
}
 }
# SECOND RULE
:0
* ^To: (_dot_)email2(_at_)mydomain(_dot_)net
  {
  :0c
  /usr/home/email/email2
   :0
{
:0
* ^Cc: (_dot_)email1(_at_)mydomain(_dot_)net
/usr/home/email/email1
}
  :0
{
:0
* ^Cc: (_dot_)email3(_at_)mydomain\(_dot_)net
/usr/home/email/email3
}
  }

# THIRD RULE
:0
* ^To: (_dot_)email3(_at_)mydomain(_dot_)net
 {
  :0c
 /usr/home/email/email3
  :0
{
:0
* ^Cc: (_dot_)email1(_at_)mydomain(_dot_)net
/usr/home/email/email1
}
  :0
{
:0
* ^Cc: (_dot_)email2(_at_)mydomain\(_dot_)net
/usr/home/email/email2
}
 }

:0:
${HOME}/sort.me
-------end code------



----- Original Message -----
From: "chris" <lists(_at_)powernet(_dot_)net>
To: <procmail(_at_)Lists(_dot_)RWTH-Aachen(_dot_)DE>
Sent: Thursday, February 28, 2002 10:55 AM
Subject: Multiple Users with one login


I am trying to setup the following senerio:

email1
email2
email3
allemail - email{1|2|3} all get forwarded to here

I have 3 email addresses that I want to check from one login. Thats not an
issue as I could just place a .forward or use the aliases file to get the
job done. The problem I have comes once the email is sent to my 'allemail'
account. I want to use procmail to filter who the mail is being sent to
and
put it in the proper folder
To|Cc: email1 would goto $HOME/email1
To|Cc: email2 would goto $HOME/email2
To|Cc: email3 would goto $HOME/email3
Any mail that doesnt specifically fall in the above senerio would be sent
to
$HOME/sort

If I get an email, for example, that is To:email1 Cc:email2 it doesnt seem
to filter it out properly.
 This is my first time messing with procmail. I have tried several combos
in
the procmailrc and nothing seems to work just right. If it matches email1
on
the To: field
it might skip the Cc it has for email2.  I might also get a copy(or two)
in
the sort box. *scratches his head* Where can I find some good examples of
what I am trying to do here? Maybe, what I am trying to do is all wrong?
Should I place a .procmailrc in email1|2|3 HOME dir and just have them all
write to the allmail home directory? Whats the best way to get this done?

Here is close to what I have(it changes slightly as I try new things):

SHELL=/bin/sh
MAILDIR=${HOME}/Mail
LOGFILE=${HOME}/procmail.log
LOG="--- Logging ${LOGFILE} for ${LOGNAME}, "
{
:0
* ^(To|Cc): (_dot_)email1(_at_)my(_dot_)domain
${HOME}/email1

:0 A
* ^(To|Cc): (_dot_)email2(_at_)my(_dot_)domain
${HOME}/email2

:0 A
* ^(To|Cc): (_dot_)email3(_at_)my(_dot_)domain
${HOME}/email3
}

:0:
$HOME/sort

TIA,
 Chris

_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail


_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

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