Hello,

I'm setting up a new mail server with Exim and try to get the Sieve filter working as it does on another server. But it doesn't. And I don't know why.

Here's a sieve script for [email protected]:

if header :contains ["Subject"] "Newsletter" {
  redirect "[email protected]";
}

I'm sending a message from [email protected] to [email protected] with the subject "Newsletter". The message is delivered in the inbox of the original recipient and not forwarded.

Here's another sieve script:

redirect "[email protected]";
stop;

The same message is now both delivered in the original inbox and forwarded to demo2. It looks like this time the filter action was at least considered, but the implicit keep should not be effective, but is.

The Exim version is 4.93 on Ubuntu Linux 20.04.

This is a part of my Exim config. All addresses with maildirs and sieve data is stored in a database.

SQL_FILTER = \
        select E'# Sieve filter\n' || sieve_filter \
        from mail_entries \
        where local = '${quote_pgsql:$local_part}' and domain = '${quote_pgsql:$domain}' 
and maildir <> '' and sieve_filter <> ''
>
begin routers
>
virtual_user_filter:
        driver = redirect
        allow_fail
        allow_defer
        allow_filter
        user = Debian-exim
        data = ${lookup pgsql{SQL_FILTER}{$value}}
        address_data = ${lookup pgsql{SQL_QUOTA}{$value}fail}
        file_transport = address_directory

begin transports

address_directory:
        driver = appendfile
        directory = ${if eq{$address_file}{inbox} \
                {${lookup pgsql{SQL_MAILDIR}{$value}fail}} \
                {${if eq{${substr_0_1:$address_file}}{/} \
                        {$address_file} \
                        {${lookup 
pgsql{SQL_MAILDIR}{$value}fail}/.$address_file} \
                }} \
        }
        user = mail
        maildir_format
        delivery_date_add
        envelope_to_add
        return_path_add

The mainlog doesn't show more than the in and out events. There are especially no errors. (I can have errors when I leave out the Sieve filter comment prefix or use an invalid database query or break the database permissions. I've seen all of this but they're fixed and the messages are gone.)

How can I debug or fix the Sieve filter in Exim? I thought that the config I have here is about the same as what's already working with the Exim from Ubuntu 16.04.

-Yves

--
## List details at https://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/

Reply via email to