[Dovecot] Maildir, procmail, and locks
I'm using procmail as the local delivery agent for Maildir style mailboxes. I discovered that I was able to send mail to other users but was unable to send mail to myself. Examples from verbose procmail log:
**** Successful message to another user **** procmail: [24589] Fri Jun 2 15:03:34 2006 procmail: Assigning "PATH=/home/david/bin:/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/X11R6/bin" procmail: Assigning "LASTFOLDER=/home/david/Maildir/new/msg.4AAdC" procmail: Opening "/home/david/Maildir/new/msg.4AAdC" procmail: Acquiring kernel-lock procmail: Notified comsat: "david@0:/home/david/Maildir/new/msg.4AAdC" From mark.nienberg@tippingmar.com Fri Jun 2 15:03:34 2006 Subject: test to other user Folder: /home/david/Maildir/new/msg.4AAdC
**** Failed message to myself **** procmail: [24596] Fri Jun 2 15:05:13 2006 procmail: Assigning "PATH=/home/mark/bin:/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/X11R6/bin"
procmail: Couldn't create or rename temp file "/home/mark/Maildir/new/msg.A"
procmail: Assigning "LASTFOLDER=/var/mail/mark" procmail: Opening "/var/mail/mark" procmail: Acquiring kernel-lock procmail: Notified comsat: "mark@686:/var/mail/mark" From mark.nienberg@tippingmar.com Fri Jun 2 15:05:13 2006 Subject: test to self Folder: /var/mail/mark
Anyway, I changed dovecot's lock_method from the default fcntl to flock and the problem disappeared. I'll add this to the wiki unless someone points out an error in my method.
Mark Nienberg
Mark Nienberg wrote:
I'm using procmail as the local delivery agent for Maildir style mailboxes. I discovered that I was able to send mail to other users but was unable to send mail to myself. Examples from verbose procmail log:
Whoops, I spoke too soon. After working for a while, now the problem has returned. Maybe it isn't lock related. Consequently, I'm soliciting suggestions for how to fix it (procmail or dovecot?). Thanks,
Mark Nienberg
* On 02/06/06 15:44 -0700, Mark Nienberg wrote:
| I'm using procmail as the local delivery agent for Maildir style
| mailboxes. I discovered that I was able to send mail to other users but
| was unable to send mail to myself. Examples from verbose procmail log:
|
| **** Successful message to another user ****
| procmail: [24589] Fri Jun 2 15:03:34 2006
| procmail: Assigning
| "PATH=/home/david/bin:/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/X11R6/bin"
| procmail: Assigning "LASTFOLDER=/home/david/Maildir/new/msg.4AAdC"
| procmail: Opening "/home/david/Maildir/new/msg.4AAdC"
| procmail: Acquiring kernel-lock
| procmail: Notified comsat: "david@0:/home/david/Maildir/new/msg.4AAdC"
| From mark.nienberg@tippingmar.com Fri Jun 2 15:03:34 2006
| Subject: test to other user
| Folder: /home/david/Maildir/new/msg.4AAdC
|
|
| **** Failed message to myself ****
| procmail: [24596] Fri Jun 2 15:05:13 2006
| procmail: Assigning
| "PATH=/home/mark/bin:/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/X11R6/bin"
|
| procmail: Couldn't create or rename temp file "/home/mark/Maildir/new/msg.A"
|
| procmail: Assigning "LASTFOLDER=/var/mail/mark"
| procmail: Opening "/var/mail/mark"
| procmail: Acquiring kernel-lock
| procmail: Notified comsat: "mark@686:/var/mail/mark"
| From mark.nienberg@tippingmar.com Fri Jun 2 15:05:13 2006
| Subject: test to self
| Folder: /var/mail/mark
|
|
| Anyway, I changed dovecot's lock_method from the default fcntl to flock
| and the problem disappeared. I'll add this to the wiki unless someone
| points out an error in my method.
This is not a problem with dovecot. It's a procmail issue.
Do you realize that this could be a problem in your .procmailrc?
The mail is being delivered to /var/mail/mark as opposed to
/home/mark/Maildir/new/ ... just check your .procmailrc env settings, I
think.
-Wash
http://www.netmeister.org/news/learn2quote.html
DISCLAIMER: See http://www.wananchi.com/bms/terms.php
--
+======================================================================+
|\ _,,,---,,_ | Odhiambo Washington
Odhiambo WASHINGTON wrote:
- On 02/06/06 15:44 -0700, Mark Nienberg wrote: | I'm using procmail as the local delivery agent for Maildir style | mailboxes. I discovered that I was able to send mail to other users but | was unable to send mail to myself. Examples from verbose procmail log:
This is not a problem with dovecot. It's a procmail issue. Do you realize that this could be a problem in your .procmailrc?
Well it was working for most messages, but not all. I found a cryptic message by googling that implied I should not use the systemwide /etc/procmailrc file to specify delivery to maildir boxes, so I disabled that and put the delivery information into individual .procmailrc files in each user's home directory. That seems to have fixed it. Not very comforting, but it works.
Thanks, Mark
Mark Nienberg gmane@tippingmar.com writes:
I'm using procmail as the local delivery agent for Maildir style mailboxes.
That's the problem. procmail...
"PATH=/home/mark/bin:/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/X11R6/bin"
procmail: Couldn't create or rename temp file "/home/mark/Maildir/new/msg.A"
Why not? Check the permissions on /home/mark/Maildir/new/ and /home/mark/Maildir/tmp/ and /home/mark/Maildir/cur/ (use "ls -ld")
...just falls through to other mailboxes when encountering errors.
The best bet is to get rid of procmail and to replace it by maildrop.
-- Matthias Andree
Matthias Andree wrote:
The best bet is to get rid of procmail and to replace it by maildrop.
I think I've worked around the procmail issue for now (see my msg to Odhiambo), but maildrop looks interesting. I've downloaded and installed it, but I still have to learn how to write filters and how to write the main configuration file (/etc/maildroprc) before I can test it. If you have any samples, including a vacation recipe, I'd love to see them. Thanks, Mark
Mark Nienberg gmane@tippingmar.com writes:
Matthias Andree wrote:
The best bet is to get rid of procmail and to replace it by maildrop.
I think I've worked around the procmail issue for now (see my msg to Odhiambo), but maildrop looks interesting. I've downloaded and installed it, but I still have to learn how to write filters and how to write the main configuration file (/etc/maildroprc) before I can test it. If you have any samples, including a vacation recipe, I'd love to see them. Thanks,
The vacation recipe is in the docs, check the maildropex manual page.
Just a short snippet to detour the dovecot list messages into the "dovecot" Maildir++ folder (includes administrivia):
if (/^List-ID:.*
-- Matthias Andree
Matthias Andree wrote:
Mark Nienberg gmane@tippingmar.com writes:
Matthias Andree wrote:
The best bet is to get rid of procmail and to replace it by maildrop. I think I've worked around the procmail issue for now (see my msg to Odhiambo), but maildrop looks interesting. I've downloaded and installed it, but I still have to learn how to write filters and how to write the main configuration file (/etc/maildroprc) before I can test it. If you have any samples, including a vacation recipe, I'd love to see them. Thanks,
The vacation recipe is in the docs, check the maildropex manual page.
Just a short snippet to detour the dovecot list messages into the "dovecot" Maildir++ folder (includes administrivia):
if (/^List-ID:.*
/) to "Maildir/.dovecot/"
Thanks. I'll study it a bit more and then test it. I get the impression that maildrop is being maintained more actively than procmail so changing now (before my new dovecot server goes into production) might be a good idea. Mark
Mark Nienberg gmane@tippingmar.com writes:
Thanks. I'll study it a bit more and then test it. I get the impression that maildrop is being maintained more actively than procmail so changing now (before my new dovecot server goes into production) might be a good idea.
Definitely. procmail hasn't been touched since the now almost five-year-old v3.22 release. OTOH, the procmail maintainer is happy with the way it works with the fallthrough-behavior; and has to date always responded very quickly when I Cc:d him on some issue.
I recently discovered one thing that procmail does that maildrop can't. (CC'ing Sam Varshavchik on this one): procmail can deliver the same message to several users from the command line. I don't currently know a way do to that with maildrop without copying the message to a temporary file and running maildrop twice. Not that it matters often, the question usually crops up on the fetchmail list when people don't want to install a fully-fledged MTA.
# procmail -d foo bar -> delivers the message from stdin first to the user foo and to the user bar
# maildrop -d foo bar -> delivers to the user foo and sets the variable $1 to "bar".
-- Matthias Andree
participants (3)
-
Mark Nienberg
-
Matthias Andree
-
Odhiambo WASHINGTON