Re: [Exim] Dynamic .forward files : filtering

Αρχική Σελίδα
Delete this message
Reply to this message
Συντάκτης: Alun
Ημερομηνία:  
Προς: exim-users
Υ/ο: Ian Mackey
Αντικείμενο: Re: [Exim] Dynamic .forward files : filtering
--
Ian Mackey (iwm21@???) said, in message
    <Pine.OSF.4.55.0309180817170.22757@???>:

>
> We are running on ye ancient version of Exim (I am building a Exim 4.2
> relay master - nice!) - but it does use older, yet relatively unchanged,
> filtering.


You can do it if you've got perl built in. Rather than using "file = /.../"
in the userforward director, you use "data = ${perl{makefilter}{$local_part}}"
instead.

In your /etc/exim/exim.pl (or whatever) file, you have something like...
(untested code hacked for the example!)

sub makefilter
{
    my $user = shift;
    my $filter =<<EOF;
# Exim filter


# Template content here

EOF
    if (open(F, "</some/path/to/$user/filter"))
    {
        while (<F>)
        {
            $filter .= $_;
        }
        close(F);
    }
    return $filter;
}


You need to arrange for user filter files to be readable by the
exim user.

We did this so we could have separate web pages allowing users to set up
forwarding and tripnotes without the two interfering. Works just fine!

Cheers,
Alun.

--
Alun Jones                       auj@???
Systems Support,                 (01970) 62 2494
Information Services,
University of Wales, Aberystwyth



--
[ Content of type application/pgp-signature deleted ]
--