I just reinstalled gentoo and noticed that delivering mail through procmail delivers mail into files like ~/.maildir/msg.xvH and not into ~/.maildir/new, as it should. The last time I installed procmail (about a month ago), it worked. My system: gentoo 1.4 beta MTA: procmail, configured to use /usr/bin/procmail as delivery agent My .procmailrc: VERBOSE=on MAILDIR=$HOME/.maildir LOGFILE=$MAILDIR/from <insert here my mailing lists> My USE: USE="-apm -arts -cups dga doc guile icc icc-pgo imap mozilla perl \ ruby samba sse tcltk tetex tiff nls -sasl maildir" An extract from ~/.maildir/from: procmail: No match on "gentoo-user" procmail: No match on "gentoo-dev" procmail: No match on "gentoo" procmail: No match on "ohjelmisto200" <insert lines for each rule I have in .procmailrc> procmail: Assigning "LASTFOLDER=/home/jsykari/.maildir/msg.azH" procmail: Opening "/home/jsykari/.maildir/msg.azH" procmail: Acquiring kernel-lock procmail: Notified comsat: "jsykari@0:/home/jsykari/.maildir/msg.azH" Subject: feh Folder: /home/jsykari/.maildir/msg.azH 85 I installed procmail with "USE=maildir emerge procmail". In addition to this, I have "maildir" set in /etc/make.conf. I also tried: export USE=maildir emerge procmail Nothing works. Whooppps... I just noticed one thing: USE="-mbox" emerge procmail causes it to deliver in the .maildir as it should. But is this what is desired? Shouldn't the use variable which affects this be "maildir"?
Well, "-mbox" and "maildir" should mean the same thing for Gentoo. That said, I get the same errors even though I built procmail using USE="-*".
I ran into the same problems as the orginal poster of this bug. I dug around in the ebuild a little and I think I solved the USE="maildir" problem, well three of them... First, in the ebuild itself. It seems like the ebuild looks for the mbox flag only and it is a little counter intuitive. If the mbox flag is defined, "maildir" block executes, and if the mbox flag is not defined, the "mbox" block execute. Second, is in the patch file, gentoo-maildir.diff. In authenticate.c, you can define a "fail-safe" delivery path for procmail. When the "maildir" block executes, the MAILSPOOLDIR is removed and MAILSPOOLHOME is defined, this is what you want for a maildir type system. All well and good, but a trailing "/" is left off MAILSPOOLHOME. I think you need the trailing slash for proper maildir delivery, at least with Postfix. Now this is my guess at what happens: procmail gets the message, sees there is no valid delivery parh; fails back to MAILSPOOLHOME; preps for a maildir delilvery to MAILSPOOLHOME, but the path tells procmail that it is a mbox file. Thus thus procmail writes the message to ~/.maildir/msg.xxx, rather than normal maildir "thing" (put message into ~/.maildir/tmp/msg.xxx, then move to ~/.maildir/new/1234567890.0000_0.host.domain). I assume this last bit is because ".maildir" exists as a directory. If ".maildir" did not exist, procmail would create a mbox-style file ".maildir" and not a directory. Third, in an ebuild prior to procmail-3.22-r4, the "maildir" block of commands created an /etc/procmailrc that set "DEFAULT=$HOME/.maildir/". It looks like this was used in place of patching the procmail sources. It works, but only if a user has a home directory. If a mail user doesn't have a home directory, then procmail goes to the failsafe delivery path. Since the source are not patched, this is /var/mail/$USER (or /var/spool/mail/$USER) can't remember which. Now procmail-3.22-r4.ebuild fixed this by reverting to patching the source. Also r4 commented out lines creating /etc/procmailrc. If you didn't have "DEFAULT=$HOME/.maildir/" in .procmailrc, when you upgraded then the bad MAILSPOOLHOME path takes effect. You can fix this by adding "DEFAULT=$HOME/.maildir/" to either .procmailrc or /etc/procmail. The trailing "/" is important, without it procmail assumes a mbox-style file. I also have a reworked ebuild and patch file that fixes these issues. I post them shortly.
Created attachment 5082 [details] New procmail ebuild and patch Here is the ebuild and patch that I promissed. This fixes the confusing USE mbox flag means maildir. Just make sure maildir is in your USE variable somewhere. The ebuild now creates /etc/procmailrc that sets "DEFAULT=$HOME/.maildir/". Finally the patch provides the correct MAILSPOOLHOME path for maildir delivery.
There seems to be a bug in the r5 ebuild. It says else echo '# Use mbox-style mailbox in /var/spool/mail' > ${S}/procmail echo 'DEFAULT=/var/spool/mail/$LOGNAME' >> ${S}/procmailrc fi instead of else echo '# Use mbox-style mailbox in /var/spool/mail' > ${S}/procmailrc echo 'DEFAULT=/var/spool/mail/$LOGNAME' >> ${S}/procmailrc fi
procmail-3.22-r5 is currently in portage with maildir/mbox related fixes.