Bug 165460 - Issues when auto-create maildir folders in /var/mail
Summary: Issues when auto-create maildir folders in /var/mail
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: procmail
Version: 29
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jaroslav Škarvada
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: bzcl34nup
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2005-08-09 16:10 UTC by Dmitry Butskoy
Modified: 2019-11-27 21:54 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-11-27 21:54:48 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
patch for maildir auto-creation under /var/spool/mail (/var/mail) (917 bytes, patch)
2005-08-09 16:10 UTC, Dmitry Butskoy
no flags Details | Diff
second variant of the patch (1.12 KB, patch)
2005-09-21 12:53 UTC, Dmitry Butskoy
no flags Details | Diff

Description Dmitry Butskoy 2005-08-09 16:10:19 UTC
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.

Comment 1 Dmitry Butskoy 2005-08-09 16:10:19 UTC
Created attachment 117578 [details]
patch for maildir auto-creation under /var/spool/mail (/var/mail)

Comment 2 Philip Guenther 2005-09-20 06:21:08 UTC
If you want the default mailspool to be in Maildir format, you should set the
MAILSPOOLSUFFIX define in authenticate.c to "/".


Comment 3 Dmitry Butskoy 2005-09-20 10:55:34 UTC
(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.

Comment 4 Philip Guenther 2005-09-20 20:24:58 UTC
>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.


Comment 5 Dmitry Butskoy 2005-09-21 11:10:39 UTC
> 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?





Comment 6 Dmitry Butskoy 2005-09-21 12:53:28 UTC
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.

Comment 7 Bug Zapper 2008-04-03 16:16:30 UTC
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.

Comment 8 Dmitry Butskoy 2008-04-04 12:08:50 UTC
Since the upstream version is not changed (still 3.22), the issue is going on.

Comment 9 Bug Zapper 2008-05-14 02:01:15 UTC
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

Comment 10 Bug Zapper 2009-06-09 22:02:36 UTC
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

Comment 11 Bug Zapper 2009-07-14 17:12:07 UTC
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.

Comment 12 Dmitry Butskoy 2009-07-14 17:23:40 UTC
Reopen

Comment 13 Fedora Admin XMLRPC Client 2010-04-15 15:58:41 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

Comment 14 Bug Zapper 2010-04-27 11:37:23 UTC
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

Comment 15 Bug Zapper 2010-07-30 10:25:49 UTC
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

Comment 16 Fedora End Of Life 2013-04-03 19:53:52 UTC
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

Comment 17 Fedora End Of Life 2015-01-09 21:35:26 UTC
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.

Comment 18 Jan Kurik 2015-07-15 15:27:47 UTC
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

Comment 19 Fedora End Of Life 2016-11-24 10:15:21 UTC
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.

Comment 20 Fedora End Of Life 2017-02-28 09:27:39 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 26 development cycle.
Changing version to '26'.

Comment 21 Fedora End Of Life 2018-05-03 08:14:20 UTC
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.

Comment 22 Jan Kurik 2018-08-14 11:12:27 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 29 development cycle.
Changing version to '29'.

Comment 23 Ben Cotton 2019-10-31 19:38:00 UTC
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.

Comment 24 Ben Cotton 2019-11-27 21:54:48 UTC
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.


Note You need to log in before you can comment on or make changes to this bug.