All,
I'm running Exim and Courier-IMAP on a production mail
system for our company and we want to expand the way in
which we use shared IMAP folders.
We have a number of customers (sales), a number of customer-
projects, a number of software projects etc. Each is now
grouped by shared folder, sub-folder, etc. sort of like this:
SharedFolder
|
|
+--sales
| |
| |-customer1
| |-customer2
| |-customer3
|
+--project
| |
| |-widget
| |-fred
| |-bert
| |-jim
|
+--software
| |
| |-microsnot
| |-linux
| |-thorcom
| |-gnu
| |-other
| |
| |-goodstuff
| |-rubbish
|
+--sysadmin
and I have Courier-IMAP serving this heirarchy well.
Currently I have Exim able to deliver email to the upper-
level of the shared folders directly using an email address
like:
sales@???
projects@???
software@@our-domain.org
I have done this my creating a director and a transport for
the purpose as follows:
#
# This director handles special 'users' (mail addresses) which we want
# delivered directly into Maildir format shared folders.
#
# This is after system_aliases so that the aliases file can group things
# to fewer folders here
#
shared_folders:
local_parts = "sales:project:software:sysadmin"
driver = smartuser
transport = maildir_shared_folder
#
# This transport saves messages in shared folders for special users
# defined in the 'shared_folders' director - to allow workgroup
# style mail handling with Courier IMAP server (and clients which support
# shared folders)
#
maildir_shared_folder:
driver = appendfile
maildir_format
directory = /SharedFolders/.${local_part}/
create_directory
prefix = ""
suffix = ""
check_string = ""
escape_string = ""
delivery_date_add
envelope_to_add
return_path_add
mode = 777
group = shrmail
user = shrmail
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:
project.widget@???
software.microsnot@???
preferrably without having to specify them all in the "local_parts"
in the director (since there may be hundreds of them in time), ie.
I'd like to come up with a way in which $local_part was matched
against a prefix list "project, sales, software" and if successful
stripped for the second part and a delivery then attempted on the
resulting shared folder path.
Courier IMAP stores its folder heirarchy using dots, eg.
.../SharedFolder/.project
.../SharedFolder/.project.widget
.../SharedFolder/.software
.../SharedFolder/.software.microsnot
.../SharedFolder/.software.other
.../SharedFolder/.software.other.goodstuff
.../SharedFolder/.software.other.rubbish
Ideally it should be possible to extend the scheme further to
support sub-sub-folders and corrosponding email addresses, eg.
software.other.rubbish@???
If mail is sent to a non-existent shared folder path, eg.
software.trs80@???
then it should bounce.
Any ideas on a good/scalable way to do this appreciated.
Regards
Mike Tubby