Re: [EXIM] Support for username+extension@domain.com?

Page principale
Supprimer ce message
Répondre à ce message
Auteur: Peter Radcliffe
Date:  
À: exim-users
Sujet: Re: [EXIM] Support for username+extension@domain.com?
Philip Hazel <ph10@???> probably said:
> On Fri, 18 Sep 1998, Tabor J. Wells wrote:
> > One of our customers is looking for us to support addresses of the form
> > username+extension@???, primarily for use with procmail (I'll
> > enclose the section of the procmail documentation that details it's use in
> > sendmail). Has anyone done this already?
> Look up the "prefix" and "suffix" options of directors. A smartuser
> director with options along the lines of
>
>   suffix = +extension
>   new_address = some kind of lookup to get the rewrite, and then 
>                 manipulation involving the use of $local_part_suffix
>                 to put the extension back. Depending on your lookup,
>                 could be messy...


Thats what I was doing before I saw this ;)
If this isn't clear and you want an explanation, ask ...

Note to Tabor: I added qualify_preserve_domain to the virtual director.
This is not what you have now and will break things, you'll have to remove
it and alter the virtual suffix as it says.

# macros

EBASE = /usr/local/etc/exim
DSUFFIX = -
# DSUFFIX = +
DBEXT = .db
#DBEXT =

## transports

# delivery by procmail, local users with .procmailrc files only
procmail_pipe:
driver = pipe
delivery_date_add = true
envelope_to_add = true
return_path_add = true
path = "/usr/local/bin:/usr/bin"
command = "procmail -a ${substr_1:${local_part_suffix}} -d ${local_part}"
from_hack
user = ${local_part}


## directors

# deal with virtual domains - just for virtual domains, look them up
virtual:
driver = aliasfile
domains = dbm;EBASE/dbm/virtualDBEXT
file = EBASE/domains/${lc:${length_1:${domain}}/${domain}}DBEXT
search_type = dbm*
forbid_file
forbid_pipe
qualify_preserve_domain


# if the virtual domain has no postmaster or root alias, throw them at
# the default domain
virtualpostmaster:
driver = smartuser
domains = dbm;EBASE/dbm/virtualDBEXT
local_parts = "postmaster:root"
new_address = ${local_part}@${qualify_recipient}


# and if there is a -something suffix, send it to the right place
virtualsuffix:
  driver = smartuser
  domains = dbm;EBASE/dbm/virtualDBEXT
  no_more
  suffix = DSUFFIX*
# if you want this to not do qualify_preserve_domain replace ' {$domain} '
# with ' {$qualify_recipient} ' in the 7th line.
  new_address = "\
    ${lookup{$local_part} dbm \
      {EBASE/domains/${lc:${length_1:${domain}}/${domain}}DBEXT} \
      {\
        ${if !match {$value}{^:(defer|fail|blackhole|include):} \
          {${local_part:$value}${local_part_suffix}@\
           ${if eq {${domain:$value}} {} {$domain} {${domain:$value}}}}\
        fail}\
      }\
    fail}"


.
.
.

userforward:
driver = forwardfile
no_verify
check_ancestor
file = .forward${local_part_suffix}
filter
suffix = DSUFFIX*
suffix_optional


# Use procmail only if a ~/.procmailrc file exists, and procmail exists.
# If sending to a username-suffix and $HOME/.forward-suffix exists,
# its valid.
procmail:
driver = localuser
transport = procmail_pipe
require_files = "${local_part}:${home}/.procmailrc:+/usr/local/bin/procmail"
suffix = DSUFFIX*
suffix_optional

P.

-- 
pir               pir@???      pir@???      pir@???



--
*** Exim information can be found at http://www.exim.org/ ***