procmail
[Top] [All Lists]

Re: Comments on this way to use procmail with virtual domains

2007-06-02 17:34:43
On 2-Jun-2007, at 03:15, M. Fioretti wrote:
On Sat, Jun 02, 2007 02:24:35 AM -0600, LuKreme (kremels(_at_)kreme(_dot_)com)
wrote:
On 2-Jun-2007, at 01:57, LuKreme wrote:
On 1-Jun-2007, at 05:17, Marco Fioretti wrote:
me(_at_)virtualdomain1(_dot_)net   : "|/absolute/path/to/procmail -m 
/somedir/
me.virtualdomain1.net.procmailrc"
joe(_at_)virtualdomain2(_dot_)com  : "|/absolute/path/to/procmail -m 
/somedir/
joe.virtualdomain2.com.procmailrc"
jane(_at_)virtualdomain1(_dot_)net : "|/absolute/path/to/procmail -m 
/somedir/
jane.virtualdomain1.net.procmailrc"

OK, the more I think about this the more I want to try it out.  I
looked at the forum you linked to, but instructions for postfix
where not to be found. Have you found anyone that is actually doing
this with postfix

Not yet. Actually, I am already using procmail with PostFix virtual
users, but in the other way described below.

Wrt to _this_ approach, I've also asked on the postfix list, but they
reminded me one thing I had forgotten, that is that in PostFix you
can't do the above with virtual aliases... I remain very interested to
figure out how this can be done with PostFix running only virtual
domains, any comment is appreciated.

I saw your post and the reply.  Yes, it's a shame.  However,  
transport = procmail seems to wrok rather well now.

procmail  unix  -       n       n       -       -       pipe
   -o flags=R user=vpopmail argv=/usr/local/bin/procmail -t -m USER=$ 
{recipient} EXTENSION=${extension} /usr/local/etc/procmailrc.common

The trick was using ${recipient} instead of ${user} for me since mail  
is stored in /usr/local/virtual/user(_at_)thedoamin(_dot_)tld

then, in procmailrc.common I just have:

MAILDIR=$HOME/$USER/
DEFAULT=$MAILDIR
LOGFILE=/usr/local/virtual/.procmail/pm.log
NL="
"
WS="    "
SWITCHRC="$HOME/.procmail/$USER"

and in /usr/local/virtual/.procmail/ I have a file named  
'user(_at_)thedmain(_dot_)tld'

I should probably change all of those to  
'(_dot_)procmailrc_user(_at_)thedmain(_dot_)tld' or something, but I'm not 
worring  
about it now.

It all seems to work for now, except that current sending to user 
+list(_at_)thedomain(_dot_)tld causes both MAILDIR and DEFAULT to be set to 
'.',  
so still some work on that score.

I am checking procmails state by adding in

ENV=`env`
LOG=$ENV

in various places, which is how I know that EXTENSION is screwing  
things up:

HOME=/usr/local/virtual
PROCMAIL_VERSION=3.22
SENDMAILFLAGS=-oi
SENDMAIL=/usr/sbin/sendmail
SHELLFLAGS=-c
MSGPREFIX=msg.
LOCKEXT=.lock
SHELLMETAS=&|<>~;?*[
HOST=akane.covisp.net
PATH=/usr/local/virtual/bin:/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
USER=user+procmail(_at_)thedomain(_dot_)tld
EXTENSION=procmail
MAILDIR=.
DEFAULT=.
DATE=20070602
LOGFILE=/usr/local/virtual/.procmail/pm.20070602.log
NL=

WS=
Subject: 342
   Folder: ./msg.1B0R                       731

seems to be ${recipient} should be user(_at_)thedomain and not user 
+extension, but that must be just me as man pipe says it's the whole  
thing, so I need to do some MATCHing on the userename to manually  
parse out the extension since there is no $host} or similar.

my choices seem to be user (user) mailbox (user+extension) or  
recipient (user+extension(_at_)thedomain(_dot_)tld)

so I guess something like

:0
* USER ?? $EXTENSION
{
    :0
    * RECIPIENT ?? ^\/[^+]+
    { SHORTU = $MATCH }

    :0
    * RECIPIENT ?? @\/.*
    { SHORTD = $MATCH }

    :0
    { USER = "${SHORTU}(_at_)${SHORTD}" }
}

-- 
"We're philosophers. We think, therefore we am."
____________________________________________________________
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>