Sean Kamath
2012-Jul-15 08:50 UTC
[Dovecot] Issues with Plus addressing and detail part of subaddress.
Hi all, So, it's been a while. I'm just ramping back up with Dovecot after a hiatus of a few years. I've been using it fine, complete with Sieve, for about a year, with little or no issues. I finally got around to setting up a second account, to start figuring out how I want to do some plus address filtering. In a nutshell, I want to put mail for foo+bar in foo's 'bar' folder. That's in the wiki. I did this: require ["fileinto", "envelope", "subaddress"]; if header :contains "subject" ["test"] { fileinto "Test"; } if envelope :detail "to" "test" { fileinto "test"; stop; } So, this fails miserably. No error message, nothing in the logs, no nothing. Yet, when I run sieve-test .dovecot.sieve /path/to/testmessage it works just fine. I even run sieve-test -e .dovecot.sieve /path/to/testmessage and it files it just fine into the folder. I tried adding some debug logging, but it looks like vnd.dovecot.debug isn't in my version. I searched the archives, and found a bit about adding (explicitly) the delimiter to the plugin section of 90-sieve.conf. So I did that. I'm running 2.0.13 of dovecot, and pigeonhole 0.2.3 on Solaris 10. Before I dive in and upgrade everything, am I missing something simple? The "test" bit works just fine (and in another account as well), so I think something's just not seeing the detail in subaddressing when mail is delivered (even though it works just fine with sieve-test). Thanks, Sean
Charles Marcus
2012-Jul-15 11:34 UTC
[Dovecot] Issues with Plus addressing and detail part of subaddress.
On 2012-07-15 4:50 AM, Sean Kamath <kamath at moltingpenguin.com> wrote:> Before I dive in and upgrade everything, am I missing something simple?dovecot -n output maybe?
Sean Kamath
2012-Jul-15 22:24 UTC
[Dovecot] Issues with Plus addressing and detail part of subaddress.
On Jul 15, 2012, at 4:34 AM, Charles Marcus wrote:> On 2012-07-15 4:50 AM, Sean Kamath <kamath at moltingpenguin.com> wrote: >> Before I dive in and upgrade everything, am I missing something simple? > > dovecot -n output maybe?Certainly (wasn't on the list of "things to put in a post" on the web site, so I missed it): # 2.0.13: /etc/dovecot/dovecot.conf # OS: SunOS 5.10 sun4u base_dir = /var/run/dovecot/ hostname = mail.enoent.net lda_mailbox_autocreate = yes lda_mailbox_autosubscribe = yes lda_original_recipient_header = X-Original-To lmtp_save_to_detail_mailbox = yes mail_location = sdbox:~/Mail:INDEX=/var/dovecot/indices/%u managesieve_notify_capability = mailto managesieve_sieve_capability = fileinto reject envelope encoded-character vacation subaddress comparator-i;ascii-numeric relational regex imap4flags copy include variables body enotify environment mailbox date passdb { driver = pam } plugin { recipient_delimiter = + sieve = ~/.dovecot.sieve sieve_dir = ~/.sieve } protocols = imap sieve ssl_cert = </etc/mail/certs/server.crt ssl_key = </etc/mail/certs/server.key userdb { driver = passwd } protocol lda { mail_plugins = " sieve" } Sean
Sean Kamath
2012-Jul-18 07:51 UTC
[Dovecot] Issues with Plus addressing and detail part of subaddress.
On Jul 17, 2012, at 3:18 AM, Charles Marcus wrote:>> I really thought it would be a simple "here's what you missed", since >> the logs are relatively uninformative... > > The point is, what may appear to be uninformative to you may tell Timo (or someone else who knows what to look for) all they need to know to pinpoint the problem.Whilst I would normally agree, at the same time I've had a fair amount of experience with dovecot and sendmail (been running them for over 10 years). Pigeonhole is new to me, however. . .> One thing I did notice is that you are sending this mail from an internal IP... since most people use very different checks for such mail (bypassing many/most checks), maybe you should be testing from an external address (one that comes in from outside your network)?So I have a DMZ that houses the mail server for my domain, which is where the private addresses are. Connections are passed through the OpenBSD router to the mail server. So testing from an external address would be essentially the same (since the connection to the SMTP server talks to the sendmail process as the /usr/lib/sendmail process). Regardless, my original tests were sending mail from the Mac off-network.> Also, it is always recommended when setting up a new server to start with the latest version... for 2.0.x that would be 2.0.19, but the latest is 2.1.8...When I set it up, 2.0.13 _was_ the latest. :-) I was hoping to avoid the pain of recompiling dovecot and pigeonhole. Not that big a deal, I guess. . .>> lda_original_recipient_header = X-Original-To >> lmtp_save_to_detail_mailbox = yes > > Ok, I think this is the problem... > > Dovecot's LMTP currently does NOT preserve the x-original-to header... in fact, brought this up recently (I was one of the ones interested in Timo adding support for it) on this (and the postfix, which is what I use) on this very list: > > http://www.dovecot.org/list/dovecot/2012-April/065075.html > > Apparently, after Timo discussed this on the postfix list, he determined that it would not be a very significant change for him to make to add support for this header in LMTP and that he would get to it sooner than later, but as of now, it has not been added.Actually, I'm not using lmtp. I whacked the lmtp_save_to_detail_mailbox in an effort to see if that was the issue before I realized I don't have it turned on. dovecot.conf has: protocols = imap though in 20-managesieve.conf I have: protocols = $protocols sieve I just turned it off and restarted dovecot (though lmtp was not running) and re-ran the test with the same result. So, I think what's going on is pretty straightforward. The local mailer definition in the sendmail.cf file is: Mlocal, P=/usr/local/libexec/dovecot/dovecot-lda, F=lsDFMAw5:/|@qSPhn9, S=EnvFromL/HdrFromL, R=EnvToL/HdrToL, T=DNS/RFC822/X-Unix, A=/usr/local/libexec/dovecot/dovecot-lda -d $u This is more or less right out of the wiki. Since dovecot-lda is passed the -d option, it's using that (and only that) for delivery. Since there's no X-Original-To: header, it doesn't really have any option (since the non-envelope-to address might not exist, or point to something other than the end user's mailbox, etc). It would appear that I have two options: 1) Figure out what macro(s) is(are) valid to pass to dovecot-lda with the -a option in the sendmail config file (sendmail.cf). 2) Get sendmail to put "X-Original-To: <address>" in the header. Both would appear to be a sendmail issue, not a dovecot/pigeonhole issue. Everything I find on the web seems to center around how to use plus addressing to accept mail from multiple email address and filter it into a single address for delivery, only to have the local delivery agent break it back out again. That's not my issue. :-( Sean Sean