Plus notation not working?

Need help? Ask here.

Moderator: Moderators

Post Reply
robnich
Posts: 6
Joined: Fri Sep 07, 2007 2:08 pm
Contact:

Plus notation not working?

Post by robnich »

In a hosted email domain with forwarding enabled, I'm trying to use plus notation addresses, and not having any luck. Every email I send with name+foldername@domain is going directly to the Inbox, no matter what I do. (The folders I tried do exist, and I used matching case.)

I set the recipient delimiter on the domain to "+" to make sure (but of cource I didn't change it before). No change.

Are address extensions supposed to work?
Seth
Site Admin
Posts: 309
Joined: Sun Aug 30, 2009 10:44 pm
Location: Nevada
Contact:

Re: Plus notation not working?

Post by Seth »

They do work, but +foldername is actually not a standard behavior, although some providers make it as such. Our Dovecot is not configured to do that at this time but we have considered adding an option that allows switching between standard behavior (which can be used in Sieve and other post-processing) and the nonstandard "extensions mean a folder name" behavior.

You can find an example in RFC5233.
Seth Mattinen, Roller Network LLC
Seth
Site Admin
Posts: 309
Joined: Sun Aug 30, 2009 10:44 pm
Location: Nevada
Contact:

Re: Plus notation not working?

Post by Seth »

Here's a quick and dirty Sieve script that should duplicate the functionality you're looking for:

Code: Select all

require ["fileinto", "variables"];

if header :matches "Delivered-To" "user+*@example.com" {
  fileinto "${1}";
  stop;
}
else {
  keep;
}
Replace "user" and "example.com" with your address and domain parts. If there's an extension then it will be filed there (remember to subscribe to folders it creates that didn't exist before), if there isn't any extension it will just go the INBOX. By "quick and dirty" I only mean that I wrote it in 5 minutes and only tested it a couple times; any corrections are welcome.

You can use our managesieve interface to add it:
https://acc.rollernet.us/mail/sieve/
Seth Mattinen, Roller Network LLC
robnich
Posts: 6
Joined: Fri Sep 07, 2007 2:08 pm
Contact:

Re: Plus notation not working?

Post by robnich »

Makes sense...for some reason I always assumed that delivering into folders was the standard configuration.

That sieve script works great, but I changed it to be completely generic:

Code: Select all

require ["fileinto", "variables", "regex"];

if header :regex "Delivered-To" ".+\\+(.+)@.+" {
  fileinto "${1}";
  stop;
}
else {
  keep;
}
Thanks Seth!
Post Reply