rjbs / Email-LocalDelivery

perl library for delivering mail to disk
2 stars 0 forks source link

Alternative mbox locking methods #1

Open rjbs opened 11 years ago

rjbs commented 11 years ago

This was originally filed 2007-09-16 13:38:47 as https://rt.cpan.org/Ticket/Display.html?id=29391 by @ntyni, who wrote:

Hi,

Email::LocalDelivery::Mbox uses flock() to lock the mailbox during delivery. However, Debian has a policy that requires all mbox handling applications to use fcntl() locks and "dot locking" for NFS safety [1]. To this end, the Debian package of Email::LocalDelivery [2] currently uses the attached patch to replace the locking method.

It would be nice if Email::LocalDelivery::Mbox supported other locking methods natively. One approach would be to move the locking outside Email::LocalDelivery, so that different implementations could be packaged as separate modules.

Alternatively, would you consider including the Debian patch as a compile-time enabled option or somesuch? I could try to rework it into one if you like.

Please note that the patch is quite non-portable: getlock_fcntl() uses pack() in a Linux-specific way and the external 'dotlockfile' command is Debian-specific. See the thread starting at [3] for more information.

My apologies for not bringing this into your attention sooner; Debian has been using this since January 2006 (version 0.09).

Many thanks for your work on the Email::* modules!

[1] http://www.debian.org/doc/debian-policy/ch-customized-programs.html#s-mail-transport-agents

[2] http://packages.debian.org/libemail-localdelivery-perl

[3] http://lists.debian.org/debian-perl/2005/12/msg00044.html

Regards,

Niko Tyni (Debian Perl Group) ntyni@iki.fi

There is a patch at the original ticket

rjbs commented 11 years ago

First off, my sincere apologies for letting this languish. The fact of the matter is that I no longer use Email::LocalDelivery, but instead use Email::Sender, and in the meantime was using our in-house code that became Email::Sender.

I would gladly merge a complete, portable patch that does what is needed, but I am unlikely to build such a change myself.