[Exim] Exim deliveries in Maildir format, Courier IMAP and F…

Góra strony
Delete this message
Reply to this message
Autor: Michael J. Tubby
Data:  
Dla: Nigel.Metheringham, exim-users
Nowe tematy: [OT] Eudora IMAP is weak Re: [Exim] Exim deliveries in Maildir format, Courier IMAP and Filtering
Temat: [Exim] Exim deliveries in Maildir format, Courier IMAP and Filtering
All,

We have been using Exim with wu-imapd for several years and IMAP performance
has been poor with wu-imapd and large mailboxes, especially using Eudura with
connections to 8 or 9 mailboxes :-(

I have decided to re-implement using Maildir format, using Exim to do the
deliveries
and Courier-IMAP-1.00 to do the serving.

Incidently system is i386 + RedHat-6.2, Exim 3.16, Courier-IMAP 1.00 built
locally on the machine. Exim has been compiled to support Maildir deliveries.


We have several power users who wish to filter their incoming mail and have it
land directly in the appropriate IMAP folder (ie. sub-directory of the
Maildir).

Courier IMAP expects to find mail and folders in ~/Maildir by default, and
I have
the following transport defined to deliver to the appropriate place:

#
# transport for delivery to 'maildir' format mailboxes
#
local_delivery:
driver = appendfile
maildir_format
directory = /home/${local_part}/Maildir
create_directory = true
check_string = ""
escape_string = ""
prefix = ""
suffix = ""
delivery_date_add
envelope_to_add
return_path_add

which works find for simple users (without filters). Courier can see the mail
and just wors!


Now, the power users want to filter, so we director which supports the .forward
file with Exim's filtering enabled:

#
# director for .forward filtering back to maildir sub-directories
#
userforward:
driver = forwardfile
file = .forward
no_verify
no_expn
check_ancestor
filter
directory_transport = maildir_subdirectory
# file_transport = address_file
pipe_transport = address_pipe
reply_transport = address_reply


and a transport to 'land' the filtered mail and put it back in the
sub-directory
correctly, I came up with this:


#
# transport to deliver to maildir sub-direcories/folders
#
maildir_subdirectory:
driver = appendfile
maildir_format
directory = /home/${local_part}/Maildir/${address_file}
create_directory = true
check_string = ""
escape_string = ""
prefix = ""
suffix = ""
delivery_date_add
envelope_to_add
return_path_add



So, I create a .forward file with something like:

# Exim filter
#
# Mike's incoming mail filtered by exim during delivery
#
if personal alias mike@??? alias mike@??? alias 
mike.tubby@??? alias mike.tubby@???
then
    save personal/
    finish
endif


if $header_to contains "vhf-dx-discuss" or
    $header_cc contains "vhf-dx-discuss"
then
    save vhf-dx-discuss/
    finish
endif


if $header_to contains "vhf-dx-warning" or
    $header_cc contains "vhf-dx-warning"
then
    save vhf-dx-warning/
    finish
endif


if $header_to contains "vhf-contests" or
    $header_cc contains "vhf-contests"
then
    save vhf-contests/
    finish
endif




What I expect (want) to happen is:

Mail message arrives, .forward file is inspected and treated as a filter,
if mail contents
match on one of the filters then the message should be 'delivered' (saved)
into the
appropriate folder if the folder exists, if the folder doesn't exist yet
(user has just added
it to his .forward filder) then the create_directoty option *should* create it.

If the message doesn't match any of the filter items then it should just be
delivered
to the 'default place', ie. the top level folder /home/${local_part}/Maildir


What actually happens:

If the item matches on the filter the mail message just vanishes -
/var/spool/exim/log/mainlog says "Completed" and there are no associated
error messages.

If the message doesn't match on the filter then it goes delivered as expected.



Perhaps I have mis-understood the interaction between the directors and
transports
for this?

I am not confident that I understand the operation of the forward file
fully and that
my guess at the configuration is correct... In the .forward file I have a
'save' directive
with a directory name which ends in a slash. This should be recognised as a
directory name.

Since my version of the userforward director invokes maildir_subdirectory I
would
have expected this to do the trick.


Questions:

1.  does the directory name in the 'save [dirname]/' end up back in the 
$address_file
     variable as I am expecting?


2.  if not, then how do I communicate the name of the directory back to the 
transport
     which has to deliver it?


3. where is my mail going when it vanishes?


Any help with correcting my configuration appreciated...


Regards

Mike Tubby