[Dovecot] plus-address delivery
Forgive me, if this has been previously discussed. I researched as
best I could. I couldn't find anyone mentioning it.
Please treat me as a newbie.
I've recently set up postfix, amavisd-new/SpamAssassin, and dovecot.
All three utilize a user database in a MySQL db (on the same host). So
far, so good.
The problem: I wanted amavisd-new to deliver an e-mail above the
"$sa_tag2_level_deflt" to the spam mailbox inside each user account.
To accomplish this, I've instituted (best as I can tell) "plus
addressing." The idea, if I have this correct, is that if a spam
message is being sent to "<user>@<domain>.<tld>", amavisd-new will
change the receiving address to "<user>+spam@<domain>.<tld>". The
"+spam" will translate to the mailbox named "spam" within the
structure of "<user>"'s mailbox.
I think the important lines from the amavisd-new config are:
@addr_extension_spam_maps = ('spam'); $recipient_delimiter = '+';
Long story short, (too late) the e-mails are being delivered, but to a
completely new mailbox called "<user>+spam". For example, when I list
the directory "<domain>.<tld>", I now see two mailboxes (as opposed to
one): "<user>" and "<user>+spam".
Is there something I need to configure within dovecot to have it
recognize "plus addressing", or should it do so by default? I'm
certain I've just missed something really simple. Any thoughts would
be appreciated. Thanks!
- Jon
On Monday 21 January 2008 18:31:01 Jon Fullmer wrote:
I've recently set up postfix, amavisd-new/SpamAssassin, and dovecot.
@addr_extension_spam_maps = ('spam'); $recipient_delimiter = '+';
It is unclear if you are using Dovecot deliver or Postfix as your LDA.
The solution might be simply adding
recipient_delimiter = +
to Postfix's main.cf.
On the other hand, we are calling Dovecot deliver from Postfix from the master.cf file. deliver puts the mail into the extension folder or INBOX if the extension does not exist.
dovecot unix - n n - - pipe flags=DOR user=vuser:vuser argv=/usr/local/libexec/dovecot/deliver -d ${user}@${nexthop} -n -m ${extension}
If you are using Dovecot deliver, I think you can do the same thing using sieve filters but from memory we ruled that out because it requires every user to have a sieve script. There was talk of implementing a global sieve script but that would only work from an include (which could get deleted) and every user would still need a sieve script.
Jim
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On Tue, 22 Jan 2008, Jim Horner wrote:
dovecot unix - n n - - pipe flags=DOR user=vuser:vuser argv=/usr/local/libexec/dovecot/deliver -d ${user}@${nexthop} -n -m ${extension}
- -m <mailbox>: Destination mailbox (default is INBOX). If the mailbox doesn't exist, it's created (unless -n is used). If message couldn't be saved to the mailbox for any reason, it's delivered to INBOX instead. If Sieve plugin is used, this mailbox is used as the "keep" action's mailbox. It's also used if there is no Sieve script or if the script fails for some reason.
(Note the -n note)
Bye,
Steffen Kaiser -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux)
iD8DBQFHldjfVJMDrex4hCIRAkKaAJ9+zTrP8tEHt3FBDaM0SfL20FFH6ACfcVo1 phgOh0kaXpN9La5H9cIGzDg= =m1hx -----END PGP SIGNATURE-----
Hmm... but it says "if the mailbox doesn't exist, it's created (unless
-n is used)". The mailbox does exist.
UNLESS, let me ask you this. I notice that the mailboxes are created
with a "." before them. For example, if I "ls -la" in the users
INBOX, I see user-created mailboxes, but they all start with a "."
The mailbox that I'm trying to deliver is named ".spam" by the
filesystem. I'm calling it "spam" in the amavisd-new config. Might
that be the problem? Should I be calling it ".spam"? Would it
actually be "<user>+.spam"?
- Jon
On Jan 22, 2008, at 4:51 AM, Steffen Kaiser wrote:
- -m <mailbox>: Destination mailbox (default is INBOX). If the
mailbox doesn't exist, it's created (unless -n is used). If message
couldn't be saved to the mailbox for any reason, it's delivered to
INBOX instead. If Sieve plugin is used, this mailbox is used as the "keep" action's
mailbox. It's also used if there is no Sieve script or if the script
fails for some reason.(Note the -n note)
Bye,
- -- Steffen Kaiser
I'm sorry I didn't clarify that. Yes, I am using Dovecot deliver as my
LDA. Here's the line I have in Postfix's master.cf:
dovecot unix - n n - - pipe flags=DRhu user=vmail:vmail argv=/usr/lib/dovecot/deliver -f $ {sender} -d ${u ser}@${nexthop} -n -m ${extension}
I didn't think I had the "-m ${extension}", but it turns out I did.
Any other thoughts?
- Jon
On Jan 21, 2008, at 11:58 PM, Jim Horner wrote:
It is unclear if you are using Dovecot deliver or Postfix as your LDA.
The solution might be simply adding
recipient_delimiter = +
to Postfix's main.cf.
On the other hand, we are calling Dovecot deliver from Postfix from
the master.cf file. deliver puts the mail into the extension folder or
INBOX if the extension does not exist.dovecot unix - n n - - pipe flags=DOR user=vuser:vuser argv=/usr/local/libexec/dovecot/deliver -d ${user}@${nexthop} -n -m ${extension}
If you are using Dovecot deliver, I think you can do the same thing
using sieve filters but from memory we ruled that out because it requires
every user to have a sieve script. There was talk of implementing a global
sieve script but that would only work from an include (which could get
deleted) and every user would still need a sieve script.Jim
On Tuesday 22 January 2008 22:02:26 Jon Fullmer wrote:
I'm sorry I didn't clarify that. Yes, I am using Dovecot deliver as my LDA. Here's the line I have in Postfix's master.cf:
dovecot unix - n n - - pipe flags=DRhu user=vmail:vmail argv=/usr/lib/dovecot/deliver -f $ {sender} -d ${user}@${nexthop} -n -m ${extension}
Long story short, (too late) the e-mails are being delivered, but to a
completely new mailbox called "<user>+spam". For example, when I list
the directory "<domain>.<tld>", I now see two mailboxes (as opposed to
one): "<user>" and "<user>+spam".
I re-read the original... are you sure you are using Dovecot deliver? I didn't think it created mailboxes for non-existent users? I mean is "<user>+spam" a user? If not then why is a directory being created? Just seems weird but maybe deliver does that.
My only thought is make sure these lines (or something appropriate for your setup) is in Postfix's main.cf.
recipient_delimiter = + dovecot_destination_recipient_limit = 1 virtual_mailbox_domains = your.domain.here virtual_transport = dovecot
You were right. The problem lay in the Postfix config, not the dovecot
(sorry to trouble the wrong list). The missing line was the
"recipient_delimiter = +". This line was in the amavisd-new config,
but not the Postfix. I put it in there. All is well.
For those curious, under my "userdb static" config, I chose the
argument "allow_all_users=yes". This is why Dovecot created the "<user>
+spam" mailboxes.
Thanks for your help!
- Jon
On Jan 22, 2008, at 9:16 PM, Jim Horner wrote:
My only thought is make sure these lines (or something appropriate
for your setup) is in Postfix's main.cf.recipient_delimiter = + dovecot_destination_recipient_limit = 1 virtual_mailbox_domains = your.domain.here virtual_transport = dovecot
participants (4)
-
Charles Marcus
-
Jim Horner
-
Jon Fullmer
-
Steffen Kaiser