procmail
[Top] [All Lists]

Re: Lookup inside a procmail script

2007-02-09 16:40:47
On Fri, Feb 09, 2007 at 12:34:11PM +0800, DR. Lee - NS1 wrote:

I am trying to put an e-mail to proper folder disgrading the use of
aliase e-mail addresses.
For example, Joe.SmithJones is a user who has an aliase Joe.SJ but the
final destination is in /home/joe.smithjones. Just could not think a way
to do it inside prormail, any suggestion appreciated.

I'm not entirely sure I understand your goal.  Certainly a sendmail
(or its clone) alias table is more efficient.  But if you insist:

(Make sure LINEBUF is big enough.)


    ###########################################
    ############## LOGNAME               ALIAS
    ALIAS_TABLE = 'Joe.SmithJones        Joe.SJ  
                   John.Q.Public         JQP
                   Mary.Johnson          Mary.J'
    ###########################################
      
    DROPPRIVS = Y
    :0:
    * $ ALIAS_TABLE ?? ^$\LOGNAME +\/[^ ].*
    * $ ^TO_$\MATCH$
    $DEFAULT

However, there is a flaw, I believe: if there are
multiple users on the To: or Cc: lines, this could
be delivered to the wrong one.  As has been said
many times, procmail is not an MTA.

In any case, the above is untested.

Dallman



____________________________________________________________
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