Autor: Michael J. Tubby B.Sc. G8TIC Data: A: exim-users CC: Phil.Pennock Assumpte: Re: [Exim] Exim + Courier-IMAP delivery of email to shared folders/sub-folders
On 2001-10-09 at 01:10 +0100, Michael J. Tubby B.Sc. G8TIC wrote: > Now what I would like to do is to expand the system to be able to
> deliver into the sub-folders using email addresses like:
Some clues on use of "suffix" in the last example of:
18.5 Using an external local delivery agent
of The Exim Specification.
I suspect that "suffix = .*" and "suffix_optional" on your director, and
then using $local_part_suffix in the transport, with something like:
$local_part never includes the suffix; $local_part_suffix is empty if
not matched. This stuff is in section 21 of the spec ("Additional
generic options for directors"). Since the asterisk is greedy, you
should always be left with $local_part just containing one of your
top-level folders.
> Ideally it should be possible to extend the scheme further to
> support sub-sub-folders and corrosponding email addresses, eg.
>
> software.other.rubbish@???
* should match "other.rubbish", leaving ".other.rubbish" in
$local_part_suffix
> If mail is sent to a non-existent shared folder path, eg.
>
> software.trs80@???
>
> then it should bounce.
Add a "require_files" rule to the director. See section 20 of the Spec.
> Any ideas on a good/scalable way to do this appreciated.
HTH,
--
"The natural course of a spamming business is to go belly-up" - Errol on nanae
Phil,
Thanks for the pointer in the right direction. I took your suggestions and
incorporated them and this works just fine:
#
# This director handles special 'users' (mail addresses) which we want
# delivered directly into Maildir format shared folders.
#
shared_folders:
suffix = ".*"
suffix_optional
require_files = /SharedFolders/.${local_part}${local_part_suffix}/
driver = smartuser
transport = maildir_shared_folder
#
# This transport saves messages in shared folders for special users
# defined in the 'directed_to_shared_folders' director - to allow workgroup
# style mail handling with Courier IMAP server (and clients which support
# shared folders)
#
# The director and transport now use the two-part local address, ie. with
# suffix and are called if the shared folder exists
#
maildir_shared_folder:
driver = appendfile
maildir_format
directory = /SharedFolders/.${local_part}${local_part_suffix}/
create_directory
prefix = ""
suffix = ""
check_string = ""
escape_string = ""
delivery_date_add
envelope_to_add
return_path_add
mode = 777
group = shrmail
user = shrmail
Well, I've tested it for all "top-level" shared folders and sub-folders (one
level down) and the require_files option causes the wanted bounce for
non-existent folders.
Just what was required - saved many hours pulling hair - thanks again.