Re: [Exim] alias settings and multiple personal mailboxes

Kezdőlap
Üzenet törlése
Válasz az üzenetre
Szerző: Marc Haber
Dátum:  
Címzett: exim-users
Tárgy: Re: [Exim] alias settings and multiple personal mailboxes
On Sun, 20 Jan 2002 20:13:51 +0100, Phil Pennock
<Phil.Pennock@???> wrote:
>On 2002-01-20 at 19:49 +0100, Marc Haber wrote:
>> system_aliases:
>>   driver                = aliasfile
>>   file                  = /etc/aliases
>>   search_type           = lsearch*
>>   suffix                = "-*"
>>   suffix_optional       = yes

>
>"-*" ? Shouldn't that be "+*" for consistency with the rest?


*sigh* Fixed. Which takes care of the main problem. I am an idiot.
Sorry, should've cut'n'wasted these lines.

>> mailbox:    mailbox
>> mailbox+bar:    external@???
>> first.last:    mailbox

>>
>How about changing to a smartuser director? Something like (untested):
>
>system_aliases:
> driver = smartuser
> suffix = "+*"
> suffix_optional = yes
> new_address = ${lookup{$local_part} lsearch* {/etc/aliases} {$value${if def:local_part_suffix {+$local_part_suffix}{}}}fail}
>
>Unless I just messed something up, that should be equivalent to the
>aliasfile director, but passing through the suffix for the subsequent
>director-handling.


*yuck*

This is something that I positively hate with exim: String expansion.
Worse than perl with leaning toothpick syndrome. However, when it does
what I want it to do, it is fine ;)

Since $local_part_suffix contains the "+", your new_address expression
is a little buggy, and can be shortened to $value$local_part_suffix.
This handles the cases "mailbox+foo", "mailbox" and "first.last+foo"
just fine.

For the mailbox+bar case with the explicit alias, a suffixless
director is needed, giving

system_aliases:
   debug_print           = "domain_aliases for $local_part@$domain"
   driver                = aliasfile
   file                  = /etc/aliases
   search_type           = lsearch*
   modemask              = 002


system_aliases2:
  driver                = smartuser
  new_address           = "${\
                                lookup\
                                        {$local_part}\
                                        lsearch*\
                    { /etc/aliases }
                                        {$value$local_part_suffix}\
                                        fail\
                            }"
  suffix                = "+*"
  suffix_optional       = yes


to solve the task presented.

The drawback that I can see is that the system_aliases2 director would
honor the file even if it were world writeable. The smartuser director
doesn't do file, pipe or other special deliveries anyway, right?

Thanks for your assistance. I hope that this solution will do what we
intend, and doesn't have nasty misfeatures.

Greetings
Marc

--
-------------------------------------- !! No courtesy copies, please !! -----
Marc Haber          |   " Questions are the         | Mailadresse im Header
Karlsruhe, Germany  |     Beginning of Wisdom "     | Fon: *49 721 966 32 15
Nordisch by Nature  | Lt. Worf, TNG "Rightful Heir" | Fax: *49 721 966 31 29