[Dovecot] Caseless folder delivery?
Jay Levitt
lists-dovecot at jay.fm
Sat Jun 14 15:03:34 EEST 2008
I'm using exim4 to deliver into dovecot 1.1, and using plus-addressing to
deliver mailing lists directly to appropriate folders in my "lists" mailbox.
I created a file called /folder-map.lists that looks like
## folder-map.lists
dovecot: Dovecot
lpedge: Linux PowerEdge
... and so on. So mail to lists-lpedge at jay.fm goes to the "Linux PowerEdge"
folder.
The one annoying thing: I'd like to avoid creating explicit folder-map
entries where the plus-address suffix is identical an existing folder name.
That *almost* works, but I like to name my folders with appropriate
capitalization, and deliver doesn't seem to have a way to do "caseless"
delivery.
For instance, ideally, I wouldn't have to create the "dovecot: Dovecot"
entry; mail to my lists-dovecot at jay.fm address would go into the "Dovecot"
folder.
I can't figure out how to do this. Is there a way to do that using deliver?
Could there be? Relevant portions of the exim configuration follow.
(And, p.s., am I using the new -a and -m options correctly? Are they used
for anything yet?)
Jay Levitt
## exim.conf
...begin routers
ORIG_FOLDER = ${substr_1:$local_part_suffix}
FOLDER_MAP = /etc/exim/folder-map.$local_part
MAPPED_FOLDER = ${lookup{ORIG_FOLDER}lsearch{FOLDER_MAP}{$value}{ORIG_FOLDER}}
# Mailboxes whose localparts are folders
foldered_mailboxes:
driver = accept
local_part_suffix = +* : -*
local_part_suffix_optional
local_parts = +foldered_mailboxes
address_data = user=$local_part folder="MAPPED_FOLDER"
transport = dovecot_virtual_delivery
...begin transports
dovecot_virtual_delivery:
driver = pipe
command = /usr/local/libexec/dovecot/deliver \
-f $return_path \
-a $local_part$local_part_suffix@$domain \
-d ${extract{user}{$address_data}} \
-m "${extract{folder}{$address_data}}" -n
message_prefix =
message_suffix =
log_output
return_path_add
user = vmail
More information about the dovecot
mailing list