[Exim] String expansion help needed

Pàgina inicial
Delete this message
Reply to this message
Autor: Rory Campbell-Lange
Data:  
A: exim-users
Assumpte: [Exim] String expansion help needed
I have a rather eccentric requirement for a domain on my server. I need
to store mail in 3 files in their Mail directory using the following
perl-like regex rules:

     $local_part ~= /alec|green/i -> save in alec
     $local_part ~= /eliz/i       -> save in elizabeth
     else                         -> save in main


I imagine something like :

file = /path/to/dir/\
    ${if or
        {
        { match {${lc:$local_part}}{\Nalec|green\N} {alec} }
        { match {${lc:$local_part}}{\Neliz\N} {elizabeth} }
        }
        {$1}{main}}


How do I grab the match ($1 at the end)?
How can I test this? (exim -be seems quite limited)

OR

Should I be using a user filter?

    # Exim filter
    if ${lc:$local_part} contains "alec" or "green"
    then
        save /path/to/dir/alec
        testprint "saving for alec"
    elif ${lc:$local_part} contains "eliz"
    then
        save /path/to/dir/elizabeth
        testprint "saving for elizabeth"
    else
        save /path/to/dir/main
        testprint "saving to main"
    endif


Sorry for the newbie questions
Rory
--
Rory Campbell-Lange
<rory@???>
<www.campbell-lange.net>