At 12:47 PM 2/12/2009, Victor Duchovni wrote:
On Thu, Feb 12, 2009 at 12:33:57PM -0500, post...@corwyn.net wrote:

> At 04:28 AM 2/12/2009, mouss wrote:
>> recipient_delimiter works "out of the box". there is no need to change
>> your tables, your sql statements nor add users.
This up to your LDA. No LDA bundled with Postfix understands "folders".

So while recipient_delimited works "out of the box" it doesn't quite do what I want (hence why I provided not only what wasn't working, but a detailed explanation of what I wanted to solve.)

These issues are dealt with by Mailstore aware delivery agents, not
the MTA. Deploy a delivery agent that co-operates with your mailstore
(Cyrus, Dovecot, ...). Postfix will pass the address and extension to
the delivery agent.

Thank you, that answers that receipient_delimiter alone will not solve the thing I want it to.

Well, I tinkered with it for a while, and changed mysql_virtual_user_maps SQL to: query = select if(instr('%s','+'),concat(maildir,'Maildir/.',mid('%s',instr('%s','+')+1,instr('%s','@') - instr('%s','+')-1),'/'),CONCAT(maildir,'Maildir/')) from mailbox where username=if(instr('%s','+'),concat(left('%s',instr('%s','+')-1),right('%s',length('%s') - instr('%s','@')+1)),'%s') AND active=1;

My previous sql I had managed to remove all references to the input address, but with recipient_delimiter, the first query to validate deliver is as user+...@example.com, but the second query is to u...@example.com, thus I no longer have available what the +foo part is for evaulation.


While this new SQL does permit random folders be created on the drive, they're forced into the appropriate mail structure and everything works as per my desired solution. Mail sent to u...@example.com delivers to inbox, mail sent to user+...@example.com will deliver to the foo folder. It doesn't exactly what I want it to (potential vulnerabilities aside, but everything looks like it escapes out properly to inhibit SQL injection issues).

Off to go see if I can find a "better" way with dovecot. Thanks.

Rick

Reply via email to