Re: [exim] delivery to IMAP subfolder?

Pàgina inicial
Delete this message
Reply to this message
Autor: Mike Richardson
Data:  
A: exim-users
Assumpte: Re: [exim] delivery to IMAP subfolder?
On Mon, May 09, 2005 at 02:38:43PM +0200, Marco Herrn wrote:
> Hi,
>
> I am using exim for a virtual hosting environment. There are multiple
> domains with multiple email adresses. Everything is set up fine. Now I have
> spamassassin included in it as well.
> Now I want the possibility to deliver mails, that are marked as spam, into
> a subfolder of the normal inbox (the inboxes are Maildirs). Since I am
> using an IMAP-Server the mailboxes are already prepared for this. The only
> problem I see is, that exim doesn't know about the IMAP subfolders.
>
> Any hints how I can still achieve this funktionality?
>


Set up a delivery transport to deliver to the subfolder as you would
delivering the Inbox. Assuming that this this Courier IMAP something like:

i.e. take a standard appendfile transport and replace 'file =' with
directory = $home/Maildir/.SPAM

In a virtual environment you could do something like this, which uses the
standard Courier MySQL format table (with a extra field or two) to extract the data from:

virtual_spam_transport_deliver:
  debug_print = "T: virtual spam (deliver) filter for $local_part@$domain"
  driver=appendfile
  directory=${lookup mysql{select home from passwd \
                        where id='$local_part@$domain'}}/\
            ${lookup mysql{select maildir from passwd \
                        where id='$local_part@$domain'}}/\
            ${lookup mysql{select spam_folder from passwd \
                        where id='$local_part@$domain'}}/
  delivery_date_add
  envelope_to_add
  return_path_add
  maildir_format
  mode = 0660
  user=virtual
  maildir_use_size_file = true
  quota = ${lookup mysql{select quota from passwd where id='$local_part@$domain'}}
  quota_is_inclusive = false
  quota_warn_threshold = ${lookup mysql{select quota_warn_threshold from passwd where id='$local_part@$domain'}}%
  mode_fail_narrower = false


Obviously not, ahem, optimised for speed, or elegance.

Mike
--
Mike Richardson
Messaging and Collaboration
Manchester Computing
Email: mike.richardson@???
ICON FAQ: www.icon.man.ac.uk/support/faqs.php
*Plain text only please - attachments stripped on arrival*