Re: [Exim] Procmail LDA

Top Page
Delete this message
Reply to this message
Author: John Jetmore
Date:  
To: exim-users
Subject: Re: [Exim] Procmail LDA
I've had several people ask for my configs for using procmail delivery for
virtual users.

let me know if this is useful. Also let me know if I'm doing something
really stupid...

--John

router:
  psp_procmail:
    driver = accept
    # domain must me in domain config file
    domains = dbmnz;PSPF
    # user must be in domain-specific passwd file (looked up from domain
    # file)
    local_parts = lsearch;${extract{4}{:}{$domain_data}}
    transport = psp_procmail
    local_part_suffix = +*
    local_part_suffix_optional
    retry_use_local_part
    no_verify
    # set $home to the special dir that the user has no access to (user
    # specific, base for domain looked up from domain config file)
    router_home_directory = ${extract{3}{:}{$domain_data}}/${substr_0_1:\
                            ${lc:$local_part}}/${lc:$local_part}
    # don't run router if the user doesn't have a procmailrc
    require_files = $home/procmailrc


transport:
  psp_procmail:
    driver = pipe
    check_string = "From "
    escape_string = ">From "
    return_path_add
    delivery_date_add
    envelope_to_add
    # look up this user's GID from his passwd entry
    group = ${extract{3}{:}{$local_part_data}}
    # look up UID
    user = ${extract{2}{:}{$local_part_data}}
    # define the command to run.  Specify vars on command line for user to
    # use.  if no pattern matches, mail will be delivered to $DEFAULT
    command = PROCMAIL -tmp \
        LOGNAME=${lc:$local_part} \
        SHELL=/bin/sh \
        HOME=${extract{5}{:}{$local_part_data}} \
        DEFAULT=${extract{5}{:}{$local_part_data}}/Maildir/ \
        MAILDIR=${extract{5}{:}{$local_part_data}}/Maildir/ \
        MAIL=${extract{5}{:}{$local_part_data}}/Maildir/ \
        $home/procmailrc