aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/fetchmaildistrib
blob: 00cc19107230abc10071c94d5c23cf42aa140d0a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#/bin/bash
#
# fetchmaildistrib --- Distribute central fetchmail knowledge.
#
# The central fetchmail database, /etc/fetchmail, contains all accounts that
# are to be fetched by the root's daemon. Often, a user desires quicker
# access (e.g., when testing some email path). In such cases, the destination
# user (marked as is USER here in the poll lines) should set up a ~/.fetchmailrc
# for himself. This scripts generates such lines from the central file.
#
# By Rick van Rein.

# From stdin, select poll lines for user $1
function selectuser () {
	grep ^poll | grep "is $1 here"
}


for i in `cut -d: -f1 </etc/passwd`
do	homedir=`grep ^$i: /etc/passwd | cut -d: -f6`
	fetchfile=`selectuser $i </etc/fetchmailrc`
	if [ -z "$fetchfile" ]
	then	rm -f $homedir/.fetchmailrc
	else	cp /dev/null $homedir/.fetchmailrc
		chmod go-rwx $homedir/.fetchmailrc
		grep ^defaults /etc/fetchmailrc >>$homedir/.fetchmailrc
		selectuser $i </etc/fetchmailrc >>$homedir/.fetchmailrc
	fi
done
"p"><HTML> <HEAD> <TITLE> [fetchmail] Patch for IMAP idling where idling is unsupported </TITLE> <LINK REL="Index" HREF="index.html" > <LINK REL="made" HREF="mailto:esr%40thyrsus.com"> <META NAME="robots" CONTENT="index,nofollow"> <LINK REL="Previous" HREF="007705.html"> <LINK REL="Next" HREF="007706.html"> </HEAD> <BODY BGCOLOR="#ffffff"> <H1>[fetchmail] Patch for IMAP idling where idling is unsupported </H1> <B>Eric S. Raymond </B> <A HREF="mailto:esr%40thyrsus.com" TITLE="[fetchmail] Patch for IMAP idling where idling is unsupported">esr@thyrsus.com </A><BR> <I>Mon, 21 Jul 2003 22:32:31 -0400</I> <P><UL> <LI> Previous message: <A HREF="007705.html">[fetchmail] Patch for IMAP idling where idling is unsupported </A></li> <LI> Next message: <A HREF="007706.html">[fetchmail] [PATCH] Debian bug #156592 again + update </A></li> <LI> <B>Messages sorted by:</B> <a href="date.html#7713">[ date ]</a> <a href="thread.html#7713">[ thread ]</a> <a href="subject.html#7713">[ subject ]</a> <a href="author.html#7713">[ author ]</a> </LI> </UL> <HR> <!--beginarticle--> <PRE>Chris Boyle &lt;<A HREF="mailto:fetchmail-friends@cmb.is-a-geek.org">fetchmail-friends@cmb.is-a-geek.org</A>&gt;: &gt;<i> Here's a patch I've written: where IDLE is unavailable, it uses periodic </I>&gt;<i> NOOP commands instead (every 28 seconds). Important behavioural change: </I>&gt;<i> the option &quot;idle&quot; will now always result in *some* form of idle. I think </I>&gt;<i> I read somewhere that some servers will unilaterally send status updates </I>&gt;<i> if you just hold the connection open, i.e. NOOPs would be unnecessary, </I>&gt;<i> but that doesn't seem to be the case anywhere I've tried. In any case, </I>&gt;<i> this patch copes with updates both as a response to the NOOPs and </I>&gt;<i> unilaterally sent between them. It functions exactly like normal idling </I>&gt;<i> (N.B. like normal idling, it is single-folder only), and hopefully </I>&gt;<i> includes all the appropriate changes to the documentation. Enjoy. :-) </I>&gt;<i> </I>&gt;<i> <A HREF="http://cmb.is-a-geek.org/downloads/fetchmail-6.2.2+noopidle.diff.gz">http://cmb.is-a-geek.org/downloads/fetchmail-6.2.2+noopidle.diff.gz</A> </I> Nice work. This will be in 6.2.4. -- &lt;a href=&quot;<A HREF="http://www.catb.org/~esr/"">http://www.catb.org/~esr/&quot;</A>&gt;Eric S. Raymond&lt;/a&gt; </PRE> <!--endarticle--> <HR> <P><UL> <!--threads--> <LI> Previous message: <A HREF="007705.html">[fetchmail] Patch for IMAP idling where idling is unsupported </A></li> <LI> Next message: <A HREF="007706.html">[fetchmail] [PATCH] Debian bug #156592 again + update </A></li> <LI> <B>Messages sorted by:</B> <a href="date.html#7713">[ date ]</a> <a href="thread.html#7713">[ thread ]</a> <a href="subject.html#7713">[ subject ]</a> <a href="author.html#7713">[ author ]</a> </LI> </UL> </body></html>