procmail
[Top] [All Lists]

Re: /var/spool/mail/user ownership

2001-01-08 12:00:27
configuration:
   SuSE Linux 6.3, sendmail, fetchmail, procmail
   5 different email adresses to one mailbox at my ISP.
   user_x dials up the ISP and executes fetchmail, procmail to retrieve the 
mailbox
   /etc/procmailrc contains
      :0:
      * ^TOUser_1
      /var/spool/mail/user_1

      :0:
      * ^TOUser_2
      /var/spool/mail/user_2

Two comments about the fundamental scheme.

First, as has been said here before, it is not possible to reliably
route based on header addresses (To:, cc:, and the like).  For
example, you're reading this e-mail, but you're not in the "To:" or
"cc:" header, correct?  Careful study of the fetchmail manpage might
help here, but unless your ISP cooperates by adding X-Envelope-To: or
similar, you don't have a reliable way to route messages.  

Second, and this one does have a solution, if you get email addressed as
   To: User_1(_at_)yourDomain, User_2(_at_)yourDomain
or maybe
   To: User_1(_at_)yourDomain
   cc: User_2(_at_)yourDomain
then your scheme above will only let User_1 receive it.  Hence I
recommend using the 'c' flag.


What is in the $HOME/.fetchmailrc for those users?

    poll popserver.your.isp protocol pop3 username ISPuser pass ISPpass 
        mda /usr/bin/procmail

maybe?

Are you running sendmail (or equiv.) on your box?  If so, how about
changing .fetchmailrc to be...

    poll popserver.your.isp protocol pop3 username ISPuser pass ISPpass 
        is root here fetchall

?

Alternately, it may be possible to put something like this in
/etc/procmailrc (UNTESTED!!)
        
    # If the mail's been redirected, then we're done.
    :0
    * ^X-filtered-yourDomain:(_dot_)*(_at_)yourDomain
    $DEFAULT

    # Otherwise, mark it as being already redirected...
    :0 fhw
    | formail -A "X-filtered-yourDomain: *$LOGNAME(_at_)yourDomain"

    LASTFOLDER=noMatchesFound

    :0c
    * ^TOUser_1
    ! User_1(_at_)localhost

    :0c
    * ^TOUser_2
    ! User_2(_at_)localhost
    ...

    :0c
    * ^TOUser_5
    ! User_5(_at_)localhost

    # If nobody got it, then send to root for further study.
    :0
    * LASTFOLDER ?? noMatchesFound
    ! root(_at_)localhost

Well, maybe it's a starting point.  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

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