procmail
[Top] [All Lists]

Re: procmail as sendmail local agent, without local users?

2005-09-20 10:21:27
On 9/20/05, Roberto S. G. <roberto(_dot_)santos(_at_)unileon(_dot_)es> wrote:
I'd like to maintain sendmail+procmail, but without local users...

The following from the procmail archives covers most of the same
ground.  You probably won't need separate procmailrc blocks for each
alias because you can most likely derive the delivery mailbox name
from $1, but this should point you in the right direction.

---------- Forwarded message ----------
From: Bart Schaefer <barton(_dot_)schaefer(_at_)gmail(_dot_)com>
Date: Jun 28, 2005 9:50 AM
Subject: Re: Procmail, sendmail and external forwarding from /etc/aliases
To: Evgeni Vachkov
Cc: procmail(_at_)lists(_dot_)rwth-aachen(_dot_)de


On 6/28/05, Evgeni Vachkov 
<evgeni(_dot_)vachkov(_at_)orthogonsystems(_dot_)com> wrote:

What I am trying to achieve is that all [SPAM] mail is delivered locally to
$HOME/spam and not forwarded to any external accounts (from /etc/aliases).

This is really a sendmail question, not a procmail question.

The short answer is that you must not rely on /etc/aliases; you need
/etc/mail/virtusertable instead (or as well).

Create a dummy user (named, in the example below, "procmail") that can
be used to run procmail.  Use virtusertable to map the aliases onto
this dummy user like so, one such line for each alias:

aliasname           procmail+aliasname

The .procmailrc file for the "procmail" user then becomes the
repository for what would otherwise go in /etc/aliases:  sendmail will
run procmail with $1 set to the stuff after the plus sign ("aliasname"
in this example), so in the .procmailrc you'll do something like:

ALIAS=$1
:0
* ALIAS ?? aliasname
! aliasaddress(_at_)otherdomain(_dot_)com
:0
* ALIAS ?? othername
! otheraddress(_at_)thirddomain(_dot_)com

(One recipe block for each possible value of ALIAS.)

Don't forget to rebuild the virtusertable.db file after editing virtusertable.


____________________________________________________________
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>