jed-script, getmail

Paul Boekholt p.boekholt@hetnet.nl
Wed, 04 May 2005 11:44:13 +0200


On Tue, 3 May 2005 17:11:47 +0200, Jörg Sommer <joerg@alea.gnuu.de> said:

> Rafael Laboissiere schrieb am Mon 02. May, 23:02 (+0200) :
> > * J=F6rg Sommer <joerg@alea.gnuu.de> [2005-05-02 09:47]:
> >=20
> > > What is getmail? Should we install it with jed?
> >=20
> > According to the documentation at the top of src/getmail.c it is intended
> > at "Moving mail from a maildir.  Written in C to avoid a race condition."

> Do you plan to rewrite this in SLang? Do you see any problems in doing
> this?

> J=F6rg.

Joerg, can you set the content-type of your multipart messages to text/plain?
Digesting loses the message's content-type header, so your mail becomes rather
hard to read.

Most Mail-reading programs such as Mutt, Emacs and Netscape come with
something like getmail.  I think it has to be a separate program because
locking requires it to run with more permissions than the mail-reader itself
requires.  From mutt_dotlock(1):

       mutt_dotlock  implements  the  traditional  mail spool file locking method: To lock
       file, a file named file.lock is created. The program operates with group mail priv-
       ileges if necessary.
       .....
       mutt_dotlock is part of the Mutt mail user agent package.  It has been  created  to
       avoid running mutt with group mail privileges.

In the "Debian Policy Manual - Customized programs" it says:

 All Debian MUAs, MTAs, MDAs and other mailbox accessing programs (such
 as IMAP daemons) must lock the mailbox in an NFS-safe way. This means that
 fcntl() locking must be combined with dot locking. To avoid deadlocks, a
 program should use fcntl() first and dot locking after this, or alternatively
 implement the two locking methods in a non blocking way[47]. Using the
 functions maillock and mailunlock provided by the liblockfile*[48] packages
 is the recommended way to realize this.
 
 ** [[:47:]]
 If it is not possible to establish both locks, the system shouldn't wait for
 the second lock to
 be established, but remove the first lock, wait a (random) time, and start
 over locking again.
 
 ** [[:48:]]
 You will need to depend on liblockfile1 (>>1.01) to use these functions

As fas as I can tell, getmail only does a fcntl lock *or* a dotlock (it
hasn't mangled my mail so far, but then I don't have NFS).  Anyway, it
appears only the locking stuff needs to be in a separate process.  Maybe use
dotlockfile in the liblockfile1 package?