Re: [Dovecot] Dovecot LDA
On Sun, Oct 08, 2006 at 10:25:53PM +0300, Timo Sirainen wrote:
On Fri, 2006-10-06 at 21:00 -0500, Steven F Siirila wrote:
I am running Dovecot 1.0-rc6 along with dovecot-sieve from 2006-10-05 CVS. I am calling dovecot deliver from Postfix (main.cf):
mailbox_command = /opt/dovecot/libexec/dovecot/deliver
Upon switching to dovecot deliver, I observed two problems:
- An extraneous "From " header now appears at the top of each message delivered, e.g.:
From dovecot.deliver Fri Oct 06 19:59:57 2006 From sfs@tc.umn.edu Fri Oct 6 19:59:57 2006 Return-Path: sfs@tc.umn.edu
Using Postfix delivery the first of these lines does not appear. This, of course, confuses MUAs.
Don't give F flag to Postfix's pipe command.
In looking into this further, I see what you're getting at. There are commands in postfix/master.cf which specify different flags depending on what external delivery program is used. However, I haven't touched that and none of the entries that came with the standard master.cf file reference Dovecot, so I'm not sure if any of those entries even apply. What I changed to cause Dovecot delivery to be initiated was simply the mailbox_command in postfix/main.cf:
mailbox_command = /opt/dovecot/libexec/dovecot/deliver
I have been unable to determine what, if any, changes are necessary in the master.cf file to customize what parameters are sent to Dovecot deliver.
Anyone?
Although this reminds me that the "dovecot.deliver" is wrong in there.. Hmm. I think I'll add a maildrop-compatible -f <envelope> parameter here.
Great. Now if I could only figure out how to get Postfix to specify that. :)
There, done in CVS. I'll also make 1.0rc8 release today.
- The "Content-Length:" header appears after a blank line, essentially putting it into the RFC822 body, e.g.:
User-Agent: Mutt/1.4.2.1i X-UID: 11510 Status: X-Keywords:
Content-Length: 200
test
Are you sure it's a blank line? Dovecot adds lots of spaces after X-Keywords which could just make it look like that.
If it really is a blank line, then it's most likely something else than Dovecot that changes the spaces that way.
--
Steven F. Siirila Office: Lind Hall, Room 130B Internet Services E-mail: sfs@umn.edu Office of Information Technology Voice: (612) 626-0244 University of Minnesota Fax: (612) 626-7593
On Mon, 2006-10-09 at 13:15 -0500, Steven F Siirila wrote:
On Sun, Oct 08, 2006 at 10:25:53PM +0300, Timo Sirainen wrote:
On Fri, 2006-10-06 at 21:00 -0500, Steven F Siirila wrote:
I am running Dovecot 1.0-rc6 along with dovecot-sieve from 2006-10-05 CVS. I am calling dovecot deliver from Postfix (main.cf):
mailbox_command = /opt/dovecot/libexec/dovecot/deliver
Upon switching to dovecot deliver, I observed two problems:
- An extraneous "From " header now appears at the top of each message delivered, e.g.:
From dovecot.deliver Fri Oct 06 19:59:57 2006 From sfs@tc.umn.edu Fri Oct 6 19:59:57 2006 Return-Path: sfs@tc.umn.edu
Using Postfix delivery the first of these lines does not appear. This, of course, confuses MUAs.
Don't give F flag to Postfix's pipe command.
In looking into this further, I see what you're getting at. There are commands in postfix/master.cf which specify different flags depending on what external delivery program is used. However, I haven't touched that and none of the entries that came with the standard master.cf file reference Dovecot, so I'm not sure if any of those entries even apply. What I changed to cause Dovecot delivery to be initiated was simply the mailbox_command in postfix/main.cf:
mailbox_command = /opt/dovecot/libexec/dovecot/deliver
There are two ways to deliver mail. Either with this mailbox_command, or by creating a pipe transport into master.cf and using it. You could try if the transport way works better, see http://wiki.dovecot.org/LDA
I don't know what inserts the extra From_-line with mailbox_command though. I don't think it's normal..
Anyway, I think this should also be fixed in deliver in some way. It really shouldn't allow inserting From_-lines inside headers.
On Mon, Oct 09, 2006 at 09:30:09PM +0300, Timo Sirainen wrote:
There are two ways to deliver mail. Either with this mailbox_command, or by creating a pipe transport into master.cf and using it. You could try if the transport way works better, see http://wiki.dovecot.org/LDA
Using mailbox_command causes an extra (badly-formed) "From " line as described previously. I can't see how anyone could be using this successfully with Postfix (I'm running version 2.3.3).
As you suggested, I tried the alternate approach of using the pipe transport:
- In postfix/main.cf
- Commented-out "mailbox_command"
- Added "mailbox_transport = dovecot"
- Added "dovecot_destination_recipient_limit = 1"
- In postfix/master.cf I added: # Dovecot LDA dovecot unix - n n - - pipe flags=DRhu user=dovecot argv=/opt/dovecot/libexec/dovecot/deliver -d ${recipient}
After running "postfix reload", I got this error on the console: deliver(syst0003@diamond.tc.umn.edu): net_connect(/var/opt/dovecot/run/dovecot/auth-master) failed: Permission denied
As such, I then added this to the dovecot.conf auth{} section: socket listen { master { path = /var/opt/dovecot/run/dovecot/auth-master mode = 0600 user = dovecot group = dovecot } }
After doing this, Postfix is still unable to deliver, and the mailq command shows my attempts there with (temporary failure). I see no error messages anywhere that would help me determine what's going on.
Can anyone who is running Postfix+Dovecot LDA give me some pointers here?
I don't know what inserts the extra From_-line with mailbox_command though. I don't think it's normal..
I assume that you believe Postfix is doing it, right?
Anyway, I think this should also be fixed in deliver in some way. It really shouldn't allow inserting From_-lines inside headers.
I'm confused. I thought you just made changes to the Dovecot deliver program to SET the FROM address to place in "From " headers that it adds...?
--
Steven F. Siirila Office: Lind Hall, Room 130B Internet Services E-mail: sfs@umn.edu Office of Information Technology Voice: (612) 626-0244 University of Minnesota Fax: (612) 626-7593
On Mon, 2006-10-09 at 14:38 -0500, Steven F Siirila wrote:
After doing this, Postfix is still unable to deliver, and the mailq command shows my attempts there with (temporary failure). I see no error messages anywhere that would help me determine what's going on.
The problem is probably that deliver doesn't have write access to your log files. You could fix log files' permissions to allow it to write to them, or alternatively (especially if you're using syslog) you could make deliver use different log file:
protocol lda { .. log_path = /var/log/dovecot-lda.log }
And make sure it has write access to it :)
I don't know what inserts the extra From_-line with mailbox_command though. I don't think it's normal..
I assume that you believe Postfix is doing it, right?
So it seems. Maybe others haven't noticed it being a problem because they're using maildir and having extra From_-line at the beginning of a maildir file doesn't matter that much..
Anyway, I think this should also be fixed in deliver in some way. It really shouldn't allow inserting From_-lines inside headers.
I'm confused. I thought you just made changes to the Dovecot deliver program to SET the FROM address to place in "From " headers that it adds...?
Yes, I did that. I just mean that currently Dovecot doesn't filter out any From_-lines that it sees. In message body that's not a problem, but in headers it is a problem, because then saving the mail to mbox could cause Dovecot to parse it as two different mails. This isn't a problem with just deliver, but also when saving new mails via IMAP. Although there's really no reason why anyone would try to do that via IMAP.. And I don't know if SMTP servers already do any checks that remove the extra From_-lines.
On October 9, 2006 2:38:46 PM -0500 Steven F Siirila sfs@tc.umn.edu wrote:
On Mon, Oct 09, 2006 at 09:30:09PM +0300, Timo Sirainen wrote:
There are two ways to deliver mail. Either with this mailbox_command, or by creating a pipe transport into master.cf and using it. You could try if the transport way works better, see http://wiki.dovecot.org/LDA
Using mailbox_command causes an extra (badly-formed) "From " line as described previously. I can't see how anyone could be using this successfully with Postfix (I'm running version 2.3.3).
Works for me. Here is the entirety of my postfix config.
$ postconf -n alias_maps = dbm:/etc/postfix/aliases command_directory = /usr/sbin config_directory = /etc/postfix daemon_directory = /usr/libexec/postfix debug_peer_level = 2 html_directory = /usr/share/doc/postfix-2.3.3/HTML_FILES mail_owner = postfix mailbox_command = /usr/libexec/dovecot/deliver mailq_path = /usr/bin/mailq manpage_directory = /usr/share/man mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain mynetworks_style = host myorigin = $mydomain newaliases_path = /usr/sbin/newaliases queue_directory = /var/spool/postfix readme_directory = /usr/share/doc/postfix-2.3.3/README_FILES relay_domains = sample_directory = no sendmail_path = /usr/sbin/sendmail setgid_group = postdrop unknown_local_recipient_reject_code = 550 virtual_alias_domains = dbm:/etc/postfix/virtual_alias_domains virtual_alias_maps = dbm:/etc/postfix/virtual_alias_maps $
I'm using dovecot-1.0.beta8 and dovecot-deliver from CVS. Don't know how different that is from rc2+ and the sieve plugin.
-frank
On October 9, 2006 1:17:09 PM -0700 Frank Cusack fcusack@fcusack.com wrote:
On October 9, 2006 2:38:46 PM -0500 Steven F Siirila sfs@tc.umn.edu wrote:
On Mon, Oct 09, 2006 at 09:30:09PM +0300, Timo Sirainen wrote:
There are two ways to deliver mail. Either with this mailbox_command, or by creating a pipe transport into master.cf and using it. You could try if the transport way works better, see http://wiki.dovecot.org/LDA
Using mailbox_command causes an extra (badly-formed) "From " line as described previously. I can't see how anyone could be using this successfully with Postfix (I'm running version 2.3.3).
Works for me.
Oh sorry, I'm using maildir, not mbox.
-frank
On Monday 09 October 2006 15:38, Steven F Siirila wrote:
Using mailbox_command causes an extra (badly-formed) "From " line as described previously. I can't see how anyone could be using this successfully with Postfix (I'm running version 2.3.3).
I have Postfix 2.4-20060930 installed on a FreeBSD 6.1 machine and have dovecot working as an LDA without problem. This is using an MBOX. The mail is accessed by several different MUAs and none have complained.
-- Gerard Seibert gerard@seibercom.net
Paradise is exactly like where you are right now ... only much, much better.
Laurie Anderson
On Mon, Oct 09, 2006 at 05:17:39PM -0400, Gerard Seibert wrote:
On Monday 09 October 2006 15:38, Steven F Siirila wrote:
Using mailbox_command causes an extra (badly-formed) "From " line as described previously. �I can't see how anyone could be using this successfully with Postfix (I'm running version 2.3.3).
I have Postfix 2.4-20060930 installed on a FreeBSD 6.1 machine and have dovecot working as an LDA without problem. This is using an MBOX. The mail is accessed by several different MUAs and none have complained.
Okay, but can you tell me what the first three lines of a mailbox looks like on your system? Are there TWO "From " lines? We have mbox-handling scripts at the very least that will break if they start seeing two "From " lines.
--
Steven F. Siirila Office: Lind Hall, Room 130B Internet Services E-mail: sfs@umn.edu Office of Information Technology Voice: (612) 626-0244 University of Minnesota Fax: (612) 626-7593
On Monday 09 October 2006 17:24, Steven F Siirila wrote:
On Mon, Oct 09, 2006 at 05:17:39PM -0400, Gerard Seibert wrote:
On Monday 09 October 2006 15:38, Steven F Siirila wrote:
Using mailbox_command causes an extra (badly-formed) "From " line as described previously. I can't see how anyone could be using this successfully with Postfix (I'm running version 2.3.3).
I have Postfix 2.4-20060930 installed on a FreeBSD 6.1 machine and have dovecot working as an LDA without problem. This is using an MBOX. The mail is accessed by several different MUAs and none have complained.
Okay, but can you tell me what the first three lines of a mailbox looks like on your system? Are there TWO "From " lines? We have mbox-handling scripts at the very least that will break if they start seeing two "From " lines.
This is the RAW header as it appears in the MBOX:
From dovecot.deliver Mon Oct 09 17:28:37 2006
From sfs@tc.umn.edu Mon Oct 9 17:28:37 2006
Return-Path: <sfs@tc.umn.edu>
This is how it looks after being handled by KMail:
From sfs@tc.umn.edu Mon Oct 9 17: 28:37 2006
Return-Path: <sfs@tc.umn.edu>
The extra 'From' header is stripped out either by Dovecot when it is accessed via POP or else by KMail. I have accessed MBOX, actually there are more then one, with different POP clients as well as MUAs without incident.
If you have some custom script handling the mail, perhaps you could simply modify it to ignore the first 'From' in the message. Since the header always begins: 'From dovecot.deliver' that should not be that difficult.
-- Gerard Seibert gerard@seibercom.net
I am looking for a honest man.
Diogenes the Cynic
On Mon, Oct 09, 2006 at 06:18:57PM -0400, Gerard Seibert wrote:
On Monday 09 October 2006 17:24, Steven F Siirila wrote:
On Mon, Oct 09, 2006 at 05:17:39PM -0400, Gerard Seibert wrote:
On Monday 09 October 2006 15:38, Steven F Siirila wrote:
Using mailbox_command causes an extra (badly-formed) "From " line as described previously. �I can't see how anyone could be using this successfully with Postfix (I'm running version 2.3.3).
I have Postfix 2.4-20060930 installed on a FreeBSD 6.1 machine and have dovecot working as an LDA without problem. This is using an MBOX. The mail is accessed by several different MUAs and none have complained.
Okay, but can you tell me what the first three lines of a mailbox looks like on your system? Are there TWO "From " lines? We have mbox-handling scripts at the very least that will break if they start seeing two "From " lines.
This is the RAW header as it appears in the MBOX:
From dovecot.deliver Mon Oct 09 17:28:37 2006 From sfs@tc.umn.edu Mon Oct 9 17:28:37 2006 Return-Path: sfs@tc.umn.edu
This matches up with what I'm seeing in our raw mailboxes.
This is how it looks after being handled by KMail:
From sfs@tc.umn.edu Mon Oct 9 17: 28:37 2006 Return-Path: sfs@tc.umn.edu
I verified that this is the case; it appears that Dovecot itself is perhaps taking only the most-recently-encountered "From_" header when returning the message to the MUA.
The extra 'From' header is stripped out either by Dovecot when it is accessed via POP or else by KMail. I have accessed MBOX, actually there are more then one, with different POP clients as well as MUAs without incident.
This is foreign behavior to me, but it does seem that all clients thus far (even command-line mutt) work fine. Of course, "mutt" accesses the inbox directly and does show me BOTH "From_" lines.
If you have some custom script handling the mail, perhaps you could simply modify it to ignore the first 'From' in the message. Since the header always begins: 'From dovecot.deliver' that should not be that difficult.
We currently have some archival scripts that look for "From_" headers in order to determine when the next message starts. We may have to modify them. It seems that the delimiter between messages should be "\n\nFrom ", not just "\nFrom " .
Thanks for helping me sort out this mess. It still seems somewhat broken for both Postfix and Dovecot to be putting out this header, one of which doesn't even contain the proper return path. It would be great if I could somehow tell Dovecot deliver not to write its "From_" header.
-- Gerard Seibert gerard@seibercom.net
I am looking for a honest man.
Diogenes the Cynic
--
Steven F. Siirila Office: Lind Hall, Room 130B Internet Services E-mail: sfs@umn.edu Office of Information Technology Voice: (612) 626-0244 University of Minnesota Fax: (612) 626-7593
On Monday 09 October 2006 18:35, Steven F Siirila wrote:
[...]
Thanks for helping me sort out this mess. It still seems somewhat broken for both Postfix and Dovecot to be putting out this header, one of which doesn't even contain the proper return path. It would be great if I could somehow tell Dovecot deliver not to write its "From_" header.
I am reasonably certain that dovecot is responsible for that additional 'from' header. I doubt that 'postfix' has anything to do with it.
Just to be certain, I would post your question on the postfix forum:
postfix-users@postfix.org
You might be able to gleam some useful information there.
Ciao!
-- Gerard Seibert gerard@seibercom.net
Life is divided into the horrible and the miserable.
Woody Allen, "Annie Hall"
On Mon, 2006-10-09 at 17:35 -0500, Steven F Siirila wrote:
This matches up with what I'm seeing in our raw mailboxes.
This is how it looks after being handled by KMail:
From sfs@tc.umn.edu Mon Oct 9 17: 28:37 2006 Return-Path: sfs@tc.umn.edu
Note that this is wrong. The From_-line shouldn't be sent to clients at all. Looks like most don't care that much though.
I'd anyway really suggest fixing the double-From_-line problem since it most likely is going to cause problems at some point.
I verified that this is the case; it appears that Dovecot itself is perhaps taking only the most-recently-encountered "From_" header when returning the message to the MUA. .. We currently have some archival scripts that look for "From_" headers in order to determine when the next message starts. We may have to modify them. It seems that the delimiter between messages should be "\n\nFrom ", not just "\nFrom " .
Right. This is why it works in Dovecot.
On October 9, 2006 9:30:10 PM +0300 Timo Sirainen tss@iki.fi wrote:
On Mon, 2006-10-09 at 13:15 -0500, Steven F Siirila wrote:
mailbox_command = /opt/dovecot/libexec/dovecot/deliver
There are two ways to deliver mail. Either with this mailbox_command, or by creating a pipe transport into master.cf and using it.
Or content_filter.
-frank
participants (4)
-
Frank Cusack
-
Gerard Seibert
-
Steven F Siirila
-
Timo Sirainen