Automatic delivery cyrus-imap subfolders

2012-06-08 Thread James B. Byrne
I am new to Postfix and I am having trouble getting a feature that I
have working on our existing Sendmail delivery system to function on
the new Postfix delivery system.

Basically, I want all incoming email that does not have a + extension
such as localu...@example.com to deliver to
/var/spool/imap/l/user/localuser/delivery  instead of just
/var/spool/imap/l/user/localuser.

On the other hand, anything that has a + address portion still gets
delivered directly to that subtree. For example
localuser+contract.q201...@example.com delivers to
/var/spool/imap/l/user/localuser/contract/q201110.

This works for our local and our virtual domains.  Since the number of
actual users is quite small we use local system accounts (passwd) for
authentication.

The cyrus-imap configuration files cyrus.conf and imapd.conf on the
new Postfix server are in all respects identical to those on the
present Sendmail delivery server.

It took me a very long time to get this to work in Sendmail and it is
so long ago that I cannot remember much of the process.  However, our
existing Sendmail virtusertable looks like this:

localu...@example.com  localuser.delivery
realname.localu...@example.com localu...@example.com
deepn...@example.com   deepuser.contract.other

On the Postfix system the virtual domain example.com is listed in the
virtual_domains file and the map is built with postmap.

example.com  -
.example.com -

I have experimented with regexp mappings for virtual aliases but these
have all been removed.  For the moment we are just using the virtual
alias map. The contents of /etc/postfix/virtual are:

tes...@example.com bylmbx003
tes...@example.com bylmbx003.delivery
tes...@example.com bylmbx003+delivery

The relevant settings in /etc/postfix/main.cf are:

soft_bounce = yes
mydestination = $myhostname, localhost.$mydomain,
 hash:/etc/postfix/local_domains
unknown_local_recipient_reject_code = 550
alias_maps = hash:/etc/postfix/aliases.main
alias_database = hash:/etc/postfix/aliases.main
recipient_delimiter = +
mailbox_transport = lmtp:unix:/var/lib/imap/socket/lmtp
transport_maps = hash:/etc/postfix/transport
virtual_alias_domains = hash:/etc/postfix/virtual_domains
virtual_alias_maps= regexp:/etc/postfix/virtual_aliases_regexp,
hash:/etc/postfix/virtual

The results of sendmail -bv are:

***

test1@
This is the mail system at host inet17.hamilton.harte-lyne.ca.

Enclosed is the mail delivery report that you requested.

   The mail system

bylmbx...@inet17.hamilton.harte-lyne.ca (expanded from test1@xxx):
delivery via
inet17.hamilton.harte-lyne.ca[/var/lib/imap/socket/lmtp]: 250 
2.1.5 ok

*

test2@
This is the mail system at host inet17.hamilton.harte-lyne.ca.

Enclosed is the mail delivery report that you requested.

   The mail system

bylmbx003.deliv...@inet17.hamilton.harte-lyne.ca (expanded from
test2@xxx): delivery via
inet17.hamilton.harte-lyne.ca[/var/lib/imap/socket/lmtp]: 250
2.1.5 ok

However, the mail ends up in b/user/bylmbx003 and not
b/usr/bylmbx003/delivery

*

test3@
This is the mail system at host inet17.hamilton.harte-lyne.ca.

Enclosed is the mail delivery report that you requested.

   The mail system

bylmbx003+deliv...@inet17.hamilton.harte-lyne.ca (expanded from
test3@xxx): delivery via
inet17.hamilton.harte-lyne.ca[/var/lib/imap/socket/lmtp]: 250
2.1.5 ok

This also ends up in the imap INBOX and not in the subfolder.



test1+delivery@
This is the mail system at host inet17.hamilton.harte-lyne.ca.

Enclosed is the mail delivery report that you requested.

   The mail system

bylmbx003+deliv...@inet17.hamilton.harte-lyne.ca (expanded from
test1+delivery@xxx): delivery via
inet17.hamilton.harte-lyne.ca[/var/lib/imap/socket/lmtp]: 250
2.1.5 ok

This does not arrive in the delivery folder either



Evidently, my first difficulty is getting Postfix and Cyrus-imap to
agree on the + delivery semantics.  However, I have exhausted my own
resources in pursuit of a solution.  As far as I can tell I have
configured Postfix to deliver extended addresses properly and I have
made no changes to the cyrus-imapd configuration as they exist on the
Sendmail server, where the extended mailbox addresses work as I
expect. In fact, these files were copied over from there and compared
to the clean distribution copies before replacing those.

If another pair of eyes sees anything I am doing that is wrong I would
appreciate being told what it is.

-- 
***  E-Mail is NOT a SECURE channel  ***
James B. Byrnemailto:byrn...@harte-lyne.ca
Harte  Lyne Limited  http://www.harte-lyne.ca
9 Brockley Drive  vox: +1 905 561 1241
Hamilton, Ontario fax: +1 905 561 0757
Canada  L8E 3C3



[SOLVED] Automatic delivery cyrus-imap subfolders

2012-06-08 Thread James B. Byrne

This problem has nothing to do with Postfix.  I apologize for taking
your time. Nonetheless I am posting the solution here in case someone
else runs into this.

As this is a new server host the appropriate access control list had not
been set on the direct delivery mailboxes for each user.  For the
PLUS+ addressing mechanism to work with Cyrus-imap the acl _p_
for the user id _anyone_ is required on each folder in the directory
tree containing the target mailbox.

-- 
***  E-Mail is NOT a SECURE channel  ***
James B. Byrnemailto:byrn...@harte-lyne.ca
Harte  Lyne Limited  http://www.harte-lyne.ca
9 Brockley Drive  vox: +1 905 561 1241
Hamilton, Ontario fax: +1 905 561 0757
Canada  L8E 3C3