movemail account does not work with default /var/mail permissions

Bug #96566 reported by ooops on 2007-03-26
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mozilla Thunderbird
Fix Released
thunderbird (Ubuntu)
Mozilla Bugs

Bug Description

Binary package hint: mozilla-thunderbird

After a fresh feisty install /var/mail has the permission:

drwxrwsr-x 2 root mail 4096 2007-03-26 18:34 /var/mail

Due to this mozilla-thunderbird cannot create the required lock-file for a movemail account. It suggests to change the permission to 01777. Apparently /var/mail is not owned by any package. So I report the problem to mozilla-thunderbird.

Can anyone reproduce this?

Changed in mozilla-thunderbird:
assignee: nobody → mozilla-bugs
status: Unconfirmed → Needs Info

The same happens in Edgy.

Changed in mozilla-thunderbird:
status: Needs Info → Confirmed
Alex Latchford (alex.latchford) wrote :

Setting this as a high priority fix as although I do not use Movemail I am assuming a large quantity of users do so this should be fixed before Feisty is released if possible.

Thanks, Alex.

Changed in mozilla-thunderbird:
importance: Undecided → High
Markus Bertheau (mbertheau) wrote :

I can reproduce this on feisty.

Fjodor (sune-molgaard) wrote :

While I too can reproduce in Feisty, I am not convinced it's a problem with permissions on /var/mail, unless thunderbird studpidly checks the permissions instead of having movemail do it. I base this on the fact that I am perfectly able to run movemail "stand-alone"...

ooops (ooops) wrote :

Thunderbird does not use the "stand-alone" movemail. And since, for very good security reasons!, thunderbird is not set-group-id mail there is no way that an internal 'movemail' could work given the permissions given above.

Fjodor (sune-molgaard) wrote :

Yes, so I found out. However, I also found out that the external movemail uses other locking techniques when unable to create a lock file, and have thus commented on to ask to have support for an external movemail. That bug is only almost 7 years old, so I don't expect anything too soon ;-)

User-Agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv: Gecko/20070509 SeaMonkey/1.1.2
Build Identifier: Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv: Gecko/20070509 SeaMonkey/1.1.2

I have seen a lot of reports about this on google. Furthermore, postfix is known to reset permissions on the spool dir.

Current mailutils movemail reverts to kernel locking in this event, so fixing will fix this too.

Alternatively, kernel locking could be implemented in the internal movemail.

Reproducible: Always

Steps to Reproduce:
1. Verify no user writability on /var/mail/ or equivalent.
2. Set up a movemail account
3. Try to receive mails
Actual Results:
Error dialog

Expected Results:
Mails fetched

Known to be a problem on at least Ubuntu (several versions). Am bugging them too (

Changed in mozilla-thunderbird:
importance: High → Low
Changed in thunderbird:
status: Unknown → Confirmed
Fjodor (sune-molgaard) wrote :

I also opened

Also, I think the importance is set a bit too low at "low", as it is effectively preventing reading local mail with thunderbird, unless one sets up a pop3 or imap4 server, which I would see as overkill...

Alexander Sack (asac) wrote :

severity low is probably ok. upstream doesn't care much about movemail. It should be thought about disabling this in one of the next uploads as we are waiting for improvement in this area for years now.

Fjodor (sune-molgaard) wrote :

I would most certainly advice against disabling it! The problems _can_ be worked around by the (more or less) knowledgeable and the option should thus remain. Preferably, one should make the problematic setup better instead!

Sune says "[Ubuntu] said to bug the mozilla dev team..."

Bug is confirmed on Linux Trunk.

This also seems to be a very, very cross-distro problem.

FWIW, GNU's movemail locking first tries to do the "dotlock" (what TB does now), and only does kernel locking if the access isn't permitted.

The kernel locking is done with file descriptors holding a write lock.

*** Bug 239013 has been marked as a duplicate of this bug. ***

*** Bug 56671 has been marked as a duplicate of this bug. ***

Changed in thunderbird:
status: Confirmed → Invalid

Launchpad does not follow duplicates, updating remote bug watch

Changed in thunderbird:
status: Invalid → Unknown
Changed in thunderbird:
status: Unknown → Confirmed

Created attachment 385658
Patch, version 1

This patch fixes the bug in a moderately cross-platform way, and works on my Debian setup both with 755 and 777 permissions on /var/spool/mail.

Looking at the source for PR_TLockFile, it seems to lock in the same way as GNU mailutils does, so it should handle that case nicely.

Changed in thunderbird:
status: Confirmed → In Progress

Comment on attachment 385658
Patch, version 1

Nice, just some nits:

>diff --git a/mailnews/local/src/nsMovemailService.cpp b/mailnews/local/src/nsMovemailService.cpp
> PRBool ObtainSpoolLock(const char *spoolnameStr,
>- int seconds /* number of seconds to retry */)
>+ int seconds /* number of seconds to retry */,
>+ PRBool *usingLockFile)
> {

While you're touching these functions, you could make the parameters adhere to the Mozilla 'aSpoolName' naming scheme. (Same for YieldSpoolLock down below.)
And you should check

>- // How to lock:
>- // step 1: create SPOOLNAME.mozlock
>- // 1a: can remove it if it already exists (probably crash-droppings)
>- // step 2: hard-link SPOOLNAME.mozlock to SPOOLNAME.lock for NFS atomicity
>- // 2a: if SPOOLNAME.lock is >60sec old then nuke it from orbit
>- // 2b: repeat step 2 until retry-count expired or hard-link succeeds
>- // step 3: remove SPOOLNAME.mozlock
>- // step 4: If step 2 hard-link failed, fail hard; we do not hold the lock
>- // DONE.
>- //
>- // (step 2a not yet implemented)

Please don't let that comment die, just move it down after the new kernel locking.

>+ nsresult rv = NS_NewNativeLocalFile(nsDependentCString(spoolnameStr), PR_TRUE,
>+ getter_AddRefs(spoolFile));

Either use one line, ignoring its length, or put arguments 2 and 3 on their own line and align them vertically with nsDep...
(Plus one more instance further down.)

>+ if (!*usingLockFile)
>+ {

Please adhere to the prevalent bracing style of this file.
(Plus some more instances further down.)

Pushed to comm-central as 3094:496bf05c0012.

Changed in thunderbird:
status: In Progress → Fix Released
Micah Gersten (micahg) on 2009-12-10
Changed in thunderbird:
milestone: none → 3.0
Micah Gersten (micahg) wrote :

Marking triaged as there is an upstream. Awaiting release of Thunderbird 3 in Ubuntu.

Changed in thunderbird (Ubuntu):
status: Confirmed → Triaged
Launchpad Janitor (janitor) wrote :
Download full text (6.7 KiB)

This bug was fixed in the package thunderbird - 3.0+nobinonly-0ubuntu1

thunderbird (3.0+nobinonly-0ubuntu1) lucid; urgency=low

  * New Upstream Release 3.0 (THUNDERBIRD_3_0_RELEASE)
    - LP: #50902 - Thunderbird displays useless dialog
    - LP: #52667 - Thunderbird doesn't support RFC-2369
    - LP: #49033 - Doesn't recognize upper case extension (.JPG)
    - LP: #56465 - Per folder column widths
    - LP: #68456 - CTRL-Shift-K bound to 2 functions
    - LP: #79337 - Typo in Server Information for Add Account Wizard
    - LP: #1084 - No scroll on full headers list
    - LP: #62071 - Middle click on scrollbar pastes instead of jumping
    - LP: #119358 - Weak default authentication mode
    - LP: #120672 - No option to empty junk folder with right click
    - LP: #96566 - movemail doesn't work with default privs
    - LP: #122529 - Non-Thunderbird IMAP folders not visible to Thunderbird
    - LP: #241276 - Not able to paste image into thunderbird compose window
    - LP: #244635 - scrollboxes scroll to offset 0 when resized
    - LP: #259387 - "Edit Message as New" broken for eml messages
    - LP: #120281 - Editing a message from the drafts folder leaves line breaks
    - LP: #115484 - Dialogue boxes too large for 1024x768 resolution
    - LP: #320034 - Mail with self referencing headers breaks threading
    - LP: #160794 - shortcuts different in windows and linux
    - LP: #280987 - thunderbird keeps asking a password when working off-line
    - LP: #369150 - Thunderbird splits email addresses with non-ascii characters
                    and a comma in From: field
    - LP: #135066 - Thunderbird doesn't use Ubuntu icon theme
    - LP: #297301 - after authentication error the password is forgotten
    - LP: #487541 - thunderbird-bin crashed with SIGSEGV (AFS filesystem)
    - LP: #485224 - Thunderbird saves double attachment file name endings on
                    FAT32 and NTFS
    - LP: #482496 - When using SCIM ANTHY, autosaving fails, and then get asked
                    about sending in UTF-8

  [ Fabien Tassin <email address hidden> ]
  * Add build-depends on autoconf2.13, autotolls-dev, mozilla-devscripts
    libglib2.0-dev (>= 2.12), libstartup-notification0-dev, libbz2-dev,
    libpixman-1-dev, libdbus-1-dev (>= 1.0.0), libdbus-glib-1-dev (>= 0.60),
    libhal-dev (>= 0.5.8), libasound2-dev, libreadline5-dev | libreadline-dev,
  * Update build-depends minimums for libx11-dev (>= 2:1.0),
    libgtk2.0-dev (>= 2.12), zlib1g-dev (>= 1:1.2.3), libpng12-dev (>= 1.2.0),
    libjpeg62-dev (>= 6b), libcairo2-dev (>= 0.5.8), libgnome2-dev (>= 2.16),
    libgnomevfs2-dev (>= 1:2.16), libgnomeui-dev (>= 2.16),
    libnss3-dev (>= 3.12.0~1.9b3)
  * Bump standards version to 3.8.0
  * Replace ${Source-Version} by ${binary:Version} in control file
    - update debian/control
  * Bump requirement for system nspr to >= 4.8 since Mozilla bug 492464 landed
  * Bump requirement for system nss to >= 3.12.3 since Mozilla bug 485052 landed
  * Use in-source hunspell when hunspell 1.2 is not available
  * Add conditionnal support for --with-libxul-sdk controlled by
    - update debian/rules
  * Add p...


Changed in thunderbird (Ubuntu):
status: Triaged → Fix Released
Changed in thunderbird:
importance: Unknown → High
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.