]> Pileus Git - ~andy/fetchmail/blob - contrib/fetchmail-mda-fork.README
Park Fabio Rossi's contribution, needs review.
[~andy/fetchmail] / contrib / fetchmail-mda-fork.README
1 From rossi.f at inwind.it  Sun Feb 19 21:46:38 2012
2 From: rossi.f at inwind.it (rossi.f at inwind.it)
3 Date: Sun, 19 Feb 2012 21:46:38 +0100 (CET)
4 Subject: [fetchmail-devel] [patch][RFC] proper kill management of the MDA
5         process
6 Message-ID: <19562957.2848481329684398522.JavaMail.root@wmail5.libero.it>
7
8 In the past there was a discussion with subject "the message fetch should be 
9 completed before quitting" on the fetchmail-user mailing list. It was clear the 
10 possibility of delivering incomplete mail messages when fetchmail is 
11 interrupted during a mail dispatching process. The issue doesn't lead to a loss 
12 of mail but produces some garbage in the maildir/mailbox (corrupted duplicated 
13 messages).
14
15 The problem is related to the use of the popen() function which doesn't 
16 provide the PID number of the MDA process. In this way is not possible to track 
17 properly the MDA process, i.e. to kill it in response to a quit command issued 
18 to fetchmail. Using the killpg() in response to the SIGINT (or SIGTERM) signal 
19 doesn't help because it kills the parent process before killing the child 
20 process.
21
22 Here is attached a first proposal to solve the issue, it seems to work on my 
23 system. As I don't know the fetchmail code I'm pretty sure there are some 
24 mistakes. First of all I don't understand the reason in the original 
25 release_sink() function there is no check of the return from popen(). For this 
26 reason I kept the same behavior with the new implementation. I also modified 
27 the SIGCHLD handler to reuse the waiting procedure for the forked MDA process.
28
29 Fabio
30 -------------- next part --------------
31 A non-text attachment was scrubbed...
32 Name: fetchmail-mda-fork.patch
33 Type: text/x-patch
34 Size: 5122 bytes
35 Desc: not available
36 URL: <https://lists.berlios.de/pipermail/fetchmail-devel/attachments/20120219/c1d38b3f/attachment.bin>