Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 380371 - net-mail/fetchmail - initscript to allow multiple fetchmail daemons
Summary: net-mail/fetchmail - initscript to allow multiple fetchmail daemons
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal enhancement (vote)
Assignee: Net-Mail Packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-23 13:13 UTC by Pandu E Poluan
Modified: 2011-08-24 09:27 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Proposed new initscript for net-mail/fetchmail (fetchmail.initscript,699 bytes, text/plain)
2011-08-23 13:16 UTC, Pandu E Poluan
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Pandu E Poluan 2011-08-23 13:13:02 UTC
fetchmail supports IMAP's "IDLE" command, which practically implements a 'push-mail' system. With the IDLE command, fetchmail can just wait until the IMAP server notifies it of a new email. Upon receiving the notification, fetchmail will 'wake up' and retrieve the email (and deliver it eiher to local mailboxes or to another SMTP server).

The benefit of the IDLE command is two-fold: (1) Less bandwidth usage since fetchmail no longer has to poll the server repeatedly, and (2) Prompt email delivery instead of having to wait until the next polling time.

The drawback: If one uses the IDLE command, fetchmail practically 'latches' itself to *exactly* one IMAP server; one can no longer specify multiple IMAP/POP3 servers in the /etc/fetchmailrc file. If one needs to pull email from two or more email servers (as in my situation currently), one needs multiple fetchmail daemons all IDLE-ing, each with its own fetchmailrc.

Obstacle: The current initscript for fetchmail is hard-wired for exactly one fetchmail daemon.

My solution: rewrite the initscript in a way kind of similar to the net.* initscripts, and allow multiple fetchmail daemons to run in memory. The main /etc/init.d/fetchmail script reads /etc/fetchmailrc, and if one needs another fetchmail daemon, one just do `ln -s /etc/init.d/fetchmail /etc/init.d/fetchmail2` then create the relevant /etc/conf.d/fetchmail2 *and* /etc/conf.d/fetchmail2rc files.

Since this is an extensive rewrite of the initscript, I'll attach the complete initscript instead.


Reproducible: Always
Comment 1 Pandu E Poluan 2011-08-23 13:16:45 UTC
Created attachment 284359 [details]
Proposed new initscript for net-mail/fetchmail

This is the *complete* and production-ready initscript I've suggested in the description of this bug.
Comment 2 Eray Aslan gentoo-dev 2011-08-24 09:24:10 UTC
+*fetchmail-6.3.21 (24 Aug 2011)
+
+  24 Aug 2011; Eray Aslan <eras@gentoo.org> +files/fetchmail.initd,
+  -files/MD5_library_pickup.patch, +fetchmail-6.3.21.ebuild,
+  -files/debian-580796.patch, +files/fetchmail.confd:
+  Version bump. Add socks USE flag - bug #380405. Allow multiple deamons - bug
+  #380371. Remove unused patches.
+