From: Fabio R. <ro...@in...> - 2012-03-09 23:02:19
|
>In the past there was a discussion with subject "the message fetch should be >completed before quitting" on the fetchmail-user mailing list. It was clear the >possibility of delivering incomplete mail messages when fetchmail is >interrupted during a mail dispatching process. The issue doesn't lead to a loss >of mail but produces some garbage in the maildir/mailbox (corrupted duplicated >messages). > >The problem is related to the use of the popen() function which doesn't >provide the PID number of the MDA process. In this way is not possible to track >properly the MDA process, i.e. to kill it in response to a quit command issued >to fetchmail. Using the killpg() in response to the SIGINT (or SIGTERM) signal >doesn't help because it kills the parent process before killing the child >process. > >Here is attached a first proposal to solve the issue, it seems to work on my >system. As I don't know the fetchmail code I'm pretty sure there are some >mistakes. First of all I don't understand the reason in the original >release_sink() function there is no check of the return from popen(). For this >reason I kept the same behavior with the new implementation. I also modified >the SIGCHLD handler to reuse the waiting procedure for the forked MDA process. Has anyone tried the patch? Is the implementation correct? As it solves a problem with the current fetchmail release I think it's a starting point to fix the above described problem. Fabio |