Description of problem: We use procmail as local delivery agent. For more easy administration, we always used procmail possibility to auto-create user mailboxes. (To do this with current FC procmail, either /var/spool/mail should be set to -rwxrwxrwt, or procmail binary should be -rwxr-sr-x ...) As now Fedora has changed mail storage format from mailbox to maildir/, we have started to adapt out mail system to maildir/ format. Certainly, we would like to continue to use auto-creation possibility. Procmail can create all that is necessary for maildir/ format, however there is one very unpleasant problem. Procmail cannot create maildirs under "DEFAULT" directory -- /var/spool/mail (or /var/mail). Old mailboxes are created instead! In other places all is created correctly. Our admins are conservative enough, therefore we would like to continue to store e-mail in the old place (under /var/spool/mail), just storage format should be changed (i.e. instead of files just subdirectories will be used). Version-Release number of selected component (if applicable): procmail-3.22-16 How reproducible: Always Steps to Reproduce: 1. make sure that procmail is "-rwxr-sr-x root mail", and /var/spool/mail is "drwxrwxr-x root mail" . 2. Define a last recipe in /etc/procmail as: :0 $DEFAULT/ (i.e., with "/" at the end. Last "/" means that maildir format must be used). 3. Make sure that a user (choosed for this test) yet has no mailbox/maildir in /var/spool/mail 4. Send an e-mail to this user Actual results: There is a mailbox for the user, with the sent e-mail in it. Expected results: Maildir (a subdirectory with the "user" name) must be created, and the sent e-mail should be somewhere under it. More evident test: Change "$DEFAULT/" to "$DEFAULT.foo/" in the /etc/procmailrc, and repeat all the "steps to reproduce". A maildir named "user.foo/" appears in /var/spool/mail (as it should be). Also, an empty file named "user" appears too. You may specify any other destination (but not $DEFAULT/), in any other directory (with appropriate rights for "mail" group), the result will be the same -- the specified maildir is auto-created, and an empty file appears in /var/spool/mail . Note: if "$DEFAILT/" (/var/spool/mail/user/) maildir already exist, all working OK. The issue appears only when we try to auto-create maildir in default system mail spool directory with the default name (user logname). I have made a patch to resolve this issue. The problem is that procmail want to do some permission checks at early invoking. When a destination (either mailbox or maildir) is yet not exist, procmail always creates a file in the default directory /var/spool/mail (compile time hardcoded), and checks this operation for success. After this test the file remains in /var/spool/mail . When procmail delivers a mail, it sees this file, interprets it as an pre-existing mailbox and works with it in mailbox format, ignoring /etc/procmailrc specifications to use maildir/ format. Unfortunately, it is not obviously possible to change this algorithm somehow. All is too hard coded. And we cannot just remove the empty file after the test, because it leads to impossibility of auto-creation in old mailbox format! (which must be supported too). The idea of patch is to delete the empty file at directory creation time, if such "the same name" file prevents of directory creation. IMHO, it is safely enough and will not lead to any losses.
Created attachment 117578 [details] patch for maildir auto-creation under /var/spool/mail (/var/mail)
If you want the default mailspool to be in Maildir format, you should set the MAILSPOOLSUFFIX define in authenticate.c to "/".
(for comment #2) It is not about changing the default maildir. The issue is an impossibility to autocreate maildir under /var/spool/mail location, both when maildir is default and when it is just caused by procmailrc.
>The issue is an impossibility to autocreate maildir under /var/spool/mail >location, both when maildir is default and when it is just caused by procmailrc. It is not impossible to autocreate maildirs under /var/spool/mail when it is compiled in using MAILSPOOLSUFFIX; I just tried it and it worked just fine. What were your results when you tried that make you say it doesn't work? What is not currently supported by procmail is changing the type or location of the default mailspool without recompilation. The suggested patch is not safe as there is a race condition between the check of the file size and the unlink() and this is not being done under a lock. Locking the mailbox to make this safe would defeat the "maildir doesn't require locking" premise.
> It is not impossible to autocreate maildirs under /var/spool/mail when it is > compiled in using MAILSPOOLSUFFIX; I just tried it and it worked just fine. > What were your results when you tried that make you say it doesn't work? Yes, it autocreates maildirs fine. But compiling with MAILSPOOLSUFFIX="/" leads to impossibility to autocreate mailboxes, in any location. Try such /etc/procmailrc: :0 /var/mail/$LOGNAME and also this one: :0 /var/mail/$LOGNAME.foo and see the results under /var/mail ... I guess Fedora would prefer to handle both maildir/ and mailbox formats by procmail. > The suggested patch is not safe as there is a race condition between the check > of the file size and the unlink() I originally wanted to unlink() the preventing file unconditionally, but have then decided that such a check would be a little useful. I consider it optional. OTOH the race conditional is formaly present. May be get rid of this check?
Created attachment 119070 [details] second variant of the patch Philip, This is probably a better patch, using rnmbogus(). I still try to unlink() an ugly empty bogus file, but if you consider that it is unsafe, then let's admins manually remove them.
Based on the date this bug was created, it appears to have been reported against rawhide during the development of a Fedora release that is no longer maintained. In order to refocus our efforts as a project we are flagging all of the open bugs for releases which are no longer maintained. If this bug remains in NEEDINFO thirty (30) days from now, we will automatically close it. If you can reproduce this bug in a maintained Fedora version (7, 8, or rawhide), please change this bug to the respective version and change the status to ASSIGNED. (If you're unable to change the bug's version or status, add a comment to the bug and someone will change it for you.) Thanks for your help, and we apologize again that we haven't handled these issues to this point. The process we're following is outlined here: http://fedoraproject.org/wiki/BugZappers/F9CleanUp We will be following the process here: http://fedoraproject.org/wiki/BugZappers/HouseKeeping to ensure this doesn't happen again.
Since the upstream version is not changed (still 3.22), the issue is going on.
Changing version to '9' as part of upcoming Fedora 9 GA. More information and reason for this action is here: http://fedoraproject.org/wiki/BugZappers/HouseKeeping
This message is a reminder that Fedora 9 is nearing its end of life. Approximately 30 (thirty) days from now Fedora will stop maintaining and issuing updates for Fedora 9. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as WONTFIX if it remains open with a Fedora 'version' of '9'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version prior to Fedora 9's end of life. Bug Reporter: Thank you for reporting this issue and we are sorry that we may not be able to fix it before Fedora 9 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora please change the 'version' of this bug to the applicable version. If you are unable to change the version, please add a comment here and someone will do it for you. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete. The process we are following is described here: http://fedoraproject.org/wiki/BugZappers/HouseKeeping
Fedora 9 changed to end-of-life (EOL) status on 2009-07-10. Fedora 9 is no longer maintained, which means that it will not receive any further security or bug fix updates. As a result we are closing this bug. If you can reproduce this bug against a currently maintained version of Fedora please feel free to reopen this bug against that version. Thank you for reporting this bug and we are sorry it could not be fixed.
Reopen
This package has changed ownership in the Fedora Package Database. Reassigning to the new owner of this component.
This message is a reminder that Fedora 11 is nearing its end of life. Approximately 30 (thirty) days from now Fedora will stop maintaining and issuing updates for Fedora 11. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as WONTFIX if it remains open with a Fedora 'version' of '11'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version prior to Fedora 11's end of life. Bug Reporter: Thank you for reporting this issue and we are sorry that we may not be able to fix it before Fedora 11 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora please change the 'version' of this bug to the applicable version. If you are unable to change the version, please add a comment here and someone will do it for you. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete. The process we are following is described here: http://fedoraproject.org/wiki/BugZappers/HouseKeeping
This bug appears to have been reported against 'rawhide' during the Fedora 14 development cycle. Changing version to '14'. More information and reason for this action is here: http://fedoraproject.org/wiki/BugZappers/HouseKeeping
This bug appears to have been reported against 'rawhide' during the Fedora 19 development cycle. Changing version to '19'. (As we did not run this process for some time, it could affect also pre-Fedora 19 development cycle bugs. We are very sorry. It will help us with cleanup during Fedora 19 End Of Life. Thank you.) More information and reason for this action is here: https://fedoraproject.org/wiki/BugZappers/HouseKeeping/Fedora19
This message is a notice that Fedora 19 is now at end of life. Fedora has stopped maintaining and issuing updates for Fedora 19. It is Fedora's policy to close all bug reports from releases that are no longer maintained. Approximately 4 (four) weeks from now this bug will be closed as EOL if it remains open with a Fedora 'version' of '19'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version. Thank you for reporting this issue and we are sorry that we were not able to fix it before Fedora 19 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora, you are encouraged change the 'version' to a later Fedora version prior this bug is closed as described in the policy above. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete.
This bug appears to have been reported against 'rawhide' during the Fedora 23 development cycle. Changing version to '23'. (As we did not run this process for some time, it could affect also pre-Fedora 23 development cycle bugs. We are very sorry. It will help us with cleanup during Fedora 23 End Of Life. Thank you.) More information and reason for this action is here: https://fedoraproject.org/wiki/BugZappers/HouseKeeping/Fedora23
This message is a reminder that Fedora 23 is nearing its end of life. Approximately 4 (four) weeks from now Fedora will stop maintaining and issuing updates for Fedora 23. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as EOL if it remains open with a Fedora 'version' of '23'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version. Thank you for reporting this issue and we are sorry that we were not able to fix it before Fedora 23 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora, you are encouraged change the 'version' to a later Fedora version prior this bug is closed as described in the policy above. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete.
This bug appears to have been reported against 'rawhide' during the Fedora 26 development cycle. Changing version to '26'.
This message is a reminder that Fedora 26 is nearing its end of life. Approximately 4 (four) weeks from now Fedora will stop maintaining and issuing updates for Fedora 26. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as EOL if it remains open with a Fedora 'version' of '26'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version. Thank you for reporting this issue and we are sorry that we were not able to fix it before Fedora 26 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora, you are encouraged change the 'version' to a later Fedora version prior this bug is closed as described in the policy above. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete.
This bug appears to have been reported against 'rawhide' during the Fedora 29 development cycle. Changing version to '29'.
This message is a reminder that Fedora 29 is nearing its end of life. Fedora will stop maintaining and issuing updates for Fedora 29 on 2019-11-26. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as EOL if it remains open with a Fedora 'version' of '29'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version. Thank you for reporting this issue and we are sorry that we were not able to fix it before Fedora 29 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora, you are encouraged change the 'version' to a later Fedora version prior this bug is closed as described in the policy above. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete.
Fedora 29 changed to end-of-life (EOL) status on 2019-11-26. Fedora 29 is no longer maintained, which means that it will not receive any further security or bug fix updates. As a result we are closing this bug. If you can reproduce this bug against a currently maintained version of Fedora please feel free to reopen this bug against that version. If you are unable to reopen this bug, please file a new report against the current release. If you experience problems, please add a comment to this bug. Thank you for reporting this bug and we are sorry it could not be fixed.