Re: [Exim] exim filter and Maildir

Página Principal
Apagar esta mensagem
Responder a esta mensagem
Autor: Nigel Wade
Data:  
Para: Xander D Harkness
CC: EximUser List
Assunto: Re: [Exim] exim filter and Maildir
Xander D Harkness wrote:
> Odhiambo Washington wrote:
>
>> * Xander D Harkness <xander@???> [20040623 21:00]: wrote:
>>
>>
>>> Please can someone point to what I am missing
>>>
>>> I have an exim filter file in my home directory that worked before I
>>> migrated to Maildir. The contents are:
>>>
>>> # Exim filter
>>> logfile $home/filter.log
>>> if $message_body matches helloxander
>>> then
>>> save $home/Maildir/.INBOX.testme/
>>> endif
>>>
>>> I send an email that has helloxander in the body.
>>>
>>> If I test the filter on the command line it says it works:
>>>
>>> /usr/sbin/exim -f bert@??? -bf /home2/xander/.eximforward
>>> <filtertest
>>> Return-path taken from "Return-path:" header line
>>> Return-path = exim-users-admin@???
>>> Sender      = bert@???
>>> Recipient   = root@???
>>> Testing Exim filter file "/home2/xander/.eximforward"

>>>
>>> Logfile /root/filter.log
>>> Save message to: /root/Maildir/.INBOX.testme/
>>> Filtering set up at least one significant delivery or other action.
>>> No other deliveries will occur.
>>>
>>> I then send an email with helloxander in the body and while exim -bd
>>> -d+all suggests that it would like to use
>>> /home/xander/Maildir/INBOX.testme/ as a delivery location, it dumps
>>> every message in my inbox.
>>>
>>>
>>
>>
>>
> Thanks for the fast response :-)
>
>> You need to define the following in your exim configure (for
>> the system filter):
>>
>> system_filter_directory_transport = address_directory2
>>
>>
>>
> This is not a system filter it is in essence the .forward file with exim
> filtering allowed. I have tried
>
> #This is to allow the use of exim filter files.
> userfilter:
> driver = redirect
> check_local_user
> file = $home/.eximforward
> no_verify
> no_expn
> check_ancestor
> allow_filter
> file_transport = address_file
> pipe_transport = address_pipe
> reply_transport = address_reply
> directory_transport = local_delivery
> local_part_suffix = +*
> local_part_suffix_optional
> modemask = 002
> allow_defer
>
> #Transports section
> local_delivery:
> driver = appendfile
> delivery_date_add
> envelope_to_add
> return_path_add
> group = mail
> mode = 0660
> directory=/home2/${local_part}/Maildir
> maildir_format = true
>
>> Then create the address_directory2 transport. Just make
>> a copy of the default address_directory transport and then add
>> maildir_format rule to it.
>>
>> Then modify your filter to end with double slash, as in
>>
>> save $home/Maildir/.INBOX.testme//
>>
>> Now run a test (sending mail) and see if it works. Ask me
>> if it doesn't ;-)
>>
>>
>>
>>
> I have tried a number of things trying address_directory: within    the
> transports section as many available via google have suggested.

>
> The exim documentation states that there are five default local
> transports, the default configuration file does notcontain the
> address_directory transport. I have attached some more information
> thinking that I should probably have sent this originally :-)
>
> Kind regards
> Xander
>
>
> --
>
> ## List details at http://www.exim.org/mailman/listinfo/exim-users Exim
> details at http://www.exim.org/ ##
>


I think what is happening is that your filter tells exim to deliver the
message using the local_delivery transport (directory_transport =
local_delivery in userfilter) and sets the delivery directory to
$home/Maildir/.INBOX.testme/. However, the local_delivery transport sets the
directory to /home2/${local_part}/Maildir overriding the user filter.

I think you need to provide a separate transport for the user filter which
doesn't set the directory, but uses the one set in the filter.


--
Nigel Wade, System Administrator, Space Plasma Physics Group,
             University of Leicester, Leicester, LE1 7RH, UK
E-mail :    nmw@???
Phone :     +44 (0)116 2523548, Fax : +44 (0)116 2523555