aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/maildaemon
blob: 3728c333054786ffcd5a9e7873af7a463f720cac (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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#!/bin/sh
#
# maildaemon, fetchmail driver intended to be invoked hourly by cron.
#
# Script by Larry Fahnoe <fahnoe@kegworks.mn.org>, who writes:
#
# This is intended to support a standalone system (NeXTSTEP in this case) 
# which makes manual, on-demand PPP connections to the outside world.  The
# script is run as the target user from cron on an hourly basis.  If it
# finds a PPP link is up (it sees routes on a PPP interface), fetchmail is
# invoked.  If the link is not up, and the hour is in the list of hours that
# connections should be made, the link is brought up and fetchmail is
# invoked.  The program or script used to bring up the link should return an
# exit status which reflects whether the link actually came up. 
# 
# I wrote this because I wanted to be able to have control over the amount
# of time spent connected to an ISP and yet still be able to poll for mail
# at intervals that made sense to me.  One limitation of this script is that
# it does not take into account that an existing PPP link might be going to
# a different ISP or network.
#

# You'll have to configure these
USER=fahnoe			# your name
HOME=/Users/fahnoe		# home directory (for the logfile)
FORCEHOURS="05 09 13 17"	# when to bring the link up if it's not already
SERVER=mailserver.isp.com	# mailserver host name

# Link initialization and wrapup scripts (you may have to configure these)
PPPUP="/usr/local/bin/pppup $SERVER"
PPPDOWN=/usr/local/bin/pppdown

PATH=/usr/local/bin:/bin:/usr/ucb:/usr/bin:/usr/etc
export PATH USER HOME

LOG=$HOME/log/maildaemon.log

# get the mail, depends on $HOME/.fetchmailrc and $USER
FETCHMAIL( ) {
    ( echo "`date` $SERVER"
      fetchmail $SERVER
      if [ $? -gt 1 ]
      then
          echo "`date` $SERVER (evil things happened in fetchmail)"
      fi
    ) >> $LOG 2>&1
}

# if the link is already up, check for mail.
# if the hour is in FORCEHOURS, force the link up and check for mail.
(netstat -rn | awk '{ print $6 }' | grep ppp[0-9] > /dev/null)
if [ $? -eq 0 ]
then
    FETCHMAIL
else
    hour=`date | sed -e 's/:/ /g' | awk '{ print $4 }'`
    for x in $FORCEHOURS
    do
        if [ $hour = $x ]
        then
            $PPPUP
            if [ $? -eq 0 ]
            then
                FETCHMAIL
                $PPPDOWN
            else
                echo "`date` $SERVER (link establishment failure)" >> $LOG
                exit 1
            fi
        fi
    done
fi

exit
ld } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
#!/bin/sh
#
# indexgen.sh -- generate current version of fetchmail home page.
#
goldvers="5.9.0"
goldname="5.9.0"
version=`sed -n <Makefile.in "/VERSION *= */s/VERSION *= *\([^ 	]*\)/\1/p"`
date=`date "+%d %b %Y"`

set -- `timeseries | grep -v "[%#]" | head -1`
subscribers=$4
make fetchmail
set -- `ls -ks fetchmail`
fetchmailsize=$1
set -- `(cd /lib; ls libc-*)`
glibc=`echo $1 | sed 's/libc-\(.*\)\.so/\1/'`
glibc="glibc-$glibc"

rm -f index.html

# Compute MD5 checksums for security audit
rm -f checksums
for file in fetchmail-$version.tar.gz fetchmail-$version-1.i386.rpm fetchmail-$version-1.src.rpm
do 
    md5sum $file >>checksums
done

if [ $version != $goldvers ]
then
    for file in /usr/src/redhat/SOURCES/fetchmail-$goldvers.tar.gz /usr/src/redhat/RPMS/i386/fetchmail-$goldvers-1.i386.rpm /usr/src/redhat/SRPMS/fetchmail-$goldvers-1.src.rpm
    do
	md5sum $file | sed -e "s: .*/:  :" >>checksums
    done
fi

# Cryptographically sign checksums 
su esr <<EOF
gpg --clearsign checksums
mv checksums.asc checksums
gpg --detach-sign --armor fetchmail-$version.tar.gz
EOF

cat >index.html <<EOF
<!doctype HTML public "-//W3O//DTD W3 HTML 3.2//EN">
<HTML>
<HEAD>
<TITLE>Fetchmail Home Page</TITLE>
<link rev=made href=mailto:esr@snark.thyrsus.com>
<meta name="description" content="The fetchmail home page.">
<meta name="keywords" content="fetchmail, POP, POP3, IMAP, IMAP2bis, IMAP4, IMAP4rev1, ETRN, OTP, RPA"> 
</HEAD>
<BODY>
<table width="100%" cellpadding=0><tr>
<td width="30%">Back to
<a href="http://$WWWVIRTUAL/~esr/software.html">Software</a>
<td width="30%" align=center>Up to <a href="http://$WWWVIRTUAL/~esr/sitemap.html">Site Map</a>
<td width="30%" align=right>$date
</table>
<HR>
<center>
<table border="10">
<tr>
<td>
<center><img src="bighand.png"></center>
</td>
</tr>
</table>
<H1>The fetchmail Home Page</H1>
</center><P>

<H1>What fetchmail does:</H1>

<P>Fetchmail is a full-featured, robust, well-documented
remote-mail retrieval and forwarding utility intended to be used over
on-demand TCP/IP links (such as SLIP or PPP connections). It supports
every remote-mail protocol now in use on the Internet: POP2, POP3,
RPOP, APOP, KPOP, all flavors of <a
href="http://www.imap.org">IMAP</a>, ETRN, and ODMR. It can even
support IPv6 and IPSEC.

<P>Fetchmail retrieves mail from remote mail servers and forwards it via
SMTP, so it can then be be read by normal mail user agents such as <a
href="http://www.mutt.org/">mutt</a>, elm(1) or BSD Mail.
It allows all your system MTA's filtering, forwarding, and aliasing
facilities to work just as they would on normal mail.

<P>Fetchmail offers better security than any other Unix remote-mail
client.  It supports APOP, KPOP, OTP, Compuserve RPA, Microsoft NTLM,
and IMAP RFC1731 encrypted authentication methods including CRAM-MD5
to avoid sending passwords en clair. It can be configured to support
end-to-end encryption via tunneling with <a
href="http://www.openssh.com/">ssh, the Secure Shell</a>

<P>Fetchmail can be used as a POP/IMAP-to-SMTP gateway for an entire DNS
domain, collecting mail from a single drop box on an ISP and
SMTP-forwarding it based on header addresses. (We don't really
recommend this, though, as it may lose important envelope-header
information.  ETRN or a UUCP connection is better.)

<P>Fetchmail can be started automatically and silently as a system daemon
at boot time.  When running in this mode with a short poll interval,
it is pretty hard for anyone to tell that the incoming mail link is
not a full-time "push" connection.

<P>Fetchmail is easy to configure.  You can edit its dotfile directly, or
use the interactive GUI configurator (fetchmailconf) supplied with the
fetchmail distribution.  It is also directly supported in linuxconf
versions 1.16r8 and later.

<P>Fetchmail is fast and lightweight.  It packs all its standard
features (POP3, IMAP, and ETRN support) in ${fetchmailsize}K of core on a
Pentium under Linux.

<P>Fetchmail is <a href="http://www.opensource.org">open-source</a>
software.  The openness of the sources is your strongest possible
assurance of quality and reliability.

<P><H1>Where to find out more about fetchmail:</H1>

See the <a href="fetchmail-features.html">Fetchmail Feature List</a> for more
about what fetchmail does.

<P>See the on-line <a href="fetchmail-man.html">manual page</a> for
basics.

<P>See the <a href="fetchmail-FAQ.html">HTML Fetchmail FAQ</A> for
troubleshooting help.

<P>See the <a href="design-notes.html">Fetchmail Design Notes</a>
for discussion of some of the design choices in fetchmail.

<P>See the project's <a href="todo.html">To-Do list</a> for indications
of known problems and requested features.

<H1>How to get fetchmail:</H1>

You can get any of the following leading-edge resources here:
<UL>
<LI> <a href="fetchmail-$version.tar.gz">
	Gzipped source archive of fetchmail $version</a>
<LI> <a href="fetchmail-$version-1.i386.rpm">
	Intel binary RPM of fetchmail $version (uses $glibc)</a>
<LI> <a href="fetchmail-$version-1.src.rpm">
	Source RPM of fetchmail $version</a>
</UL>

The <a href="fetchmail-$version.tar.gz.asc">detached GPG signature</a> for the
binary tarball can be used to check it for correctness, with the command

<listing>
gpg --verify fetchmail-$version.tar.gz.asc fetchmail-$version.tar.gz
</listing>

MD5 <a href="checksums">checksums</a> are available for these files; the
checksum file is cryptographically signed and can be verified with the
command:

<listing>
gpg --verify checksums.asc
</listing>

EOF

if [ $version != $goldvers ]
then
    cat >>index.html <<EOF

Or you can get the last \`gold' version, $goldname:
<UL>
<LI> <a href="fetchmail-$goldvers.tar.gz">
	Gzipped source archive of fetchmail $goldname</a>
<LI> <a href="fetchmail-$goldvers-1.i386.rpm">
	Intel binary RPM of fetchmail $goldname (uses glibc)</a>
<LI> <a href="fetchmail-$goldvers-1.alpha.rpm">
	Alpha binary RPM of fetchmail $goldname (uses glibc)</a>
<LI> <a href="fetchmail-$goldvers-1.src.rpm">
	Source RPM of fetchmail $goldname</a>
</UL>
The <a href="fetchmail-$goldvers.tar.gz.asc">detached GPG signature</a> for the
binary tarball can be used to check it for correctness, with the command

<listing>
gpg --verify fetchmail-$goldvers.tar.gz.asc fetchmail-$goldvers.tar.gz
</listing>

For differences between the leading-edge $version and gold $goldname versions,
see the distribution <a href="NEWS">NEWS</a> file.<p>
EOF
fi

cat >>index.html <<EOF
(Note that the binary RPMs don't have the POP2, OTP, IPv6, Kerberos,
GSSAPI, Compuserve RPA, Microsoft NTLM, or GNU gettext
internationalization support compiled in.  To get any of these you
will have to build from sources.)

<P>The latest version of fetchmail is also carried in the 
<a href="http://metalab.unc.edu/pub/Linux/system/mail/pop/!INDEX.html">
Metalab remote mail tools directory</a>.

<H1>Getting help with fetchmail:</H1>

There is a fetchmail-friends list for people who want to discuss fixes
and improvements in fetchmail and help co-develop it.  It's a MailMan
list, which you can sign up for at <a
<a href="http://lists.ccil.org/mailman/listinfo/fetchmail-friends">
fetchmail-friends@ccil.org</a>.
There is also an announcements-only list, 
<a href="http://lists.ccil.org/mailman/listinfo/fetchmail-announce">
fetchmail-announce@lists.ccil.org</a>.

<P>Note: before submitting a question to the list, <strong>please read
the <a href="fetchmail-FAQ.html">FAQ</a></strong> (especially item <a
href="http:fetchmail-FAQ.html#G3">G3</a> on how to report bugs).  We
tend to get the same three newbie questions over and over again.  The
FAQ covers them like a blanket.

<P>Fetchmail was written and is maintained by <a
href="../index.html">Eric S. Raymond</a>.  There are some designated
backup maintainers (<a href="mailto:funk+@osu.edu">Rob Funk</a>, <a
href="http://www.dallas.net/~fox/">David DeSimone aka Fuzzy Fox</a>,
<a href="mailto:imdave@mcs.net">Dave Bodenstab</a>).  Other backup
maintainers may be added in the future, in order to ensure continued
support should Eric S.  Raymond drop permanently off the net for any
reason.

<H1>You can help improve fetchmail:</H1>

I welcome your code contributions.  But even if you don't write code,
you can help fetchmail improve.

<P>If you administer a site that runs a post-office server, you may be
able help improve fetchmail by lending me a test account on your site.
Note that I do not need a shell account for this purpose, just a 
maildrop.  Nor am I interested in collecting maildrops per se --
what I'm collecting is different <em>kinds of servers</em>.  

Before each release, I run a test harness that sends date-stamped 
test mail to each site on my regression-test list, then tries to
retrieve it.  Please take a look at my <a href="testservers.html">
list of test servers</a>.  If you can lend me an account on a kind
of server that is <em>not</em> already on this list, please do.

<H1>Who uses fetchmail:</H1>

Fetchmail entered full production status with the 2.0.0 version in
November 1996 after about five months of evolution from the ancestral
<IT>popclient</IT> utility. It has since come into extremely wide use
in the Internet/Unix/Linux community.  The Red Hat, Debian and
S.u.S.e. Linux distributions and their derivatives all include it.  A
customized version is used at Whole Earth 'Lectronic Link. Several
large ISPs are known to recommend it to Unix-using SLIP and PPP
customers.

<P>Somewhere around a thousand people have participated on the fetchmail
beta lists (at time of current release there were $subscribers on the
friends and announce lists).  While it's hard to count the users of
open-source software, we can estimate based on (a) population figures
at the WELL and other known fetchmail sites, (b) the size of the
Linux-using ISP customer base, and (c) the volume of fetchmail-related
talk on USENET.  These estimates suggest that daily fetchmail users
number well into the hundreds of thousands, and possibly over a million.

<H1>The sociology of fetchmail:</H1>

The fetchmail development project was a sociological experiment as well
as a technical effort.  I ran it as a test of some theories about why the
Linux development model works.

<P>I wrote a paper, <A
HREF="http://www.tuxedo.org/~esr/writings/cathedral-bazaar/">The
Cathedral And The Bazaar</A>, about these theories and the project.
I developed the line of analysis it suggested in two later essays.
These papers became quite popular and (to my continuing astonishment) may
have actually helped change the world.  Chase the title link, above,
for links to all three papers.

<P>I have done some analysis on the information in the project NEWS file.
You can view a <a href="history.html">statistical history</a> showing
levels of participation and release frequency over time.

<H1>Recent releases and where fetchmail is going:</H1>

Fetchmail is now sufficiently stable and effective that I'm getting
very little pressure to fix things or add features.  Development has
slowed way down, release frequency has dropped off, and we're
basically in maintainance mode.  Barring any urgent bug fixes, my 
intention is to leave 5.0.0 alone for several months.

<P>Major changes or additions therefore seem unlikely until there are
significant changes in or additions to the related protocol RFCs.  One
development that would stimulate a new release almost instantly is the
deployment of a standard lightweight encrypted authentication method
for IMAP sessions.

<H1>Where you can use fetchmail:</H1>

The fetchmail code was developed under Linux, but has also been
extensively tested under 4.4BSD, SunOS, Solaris, AIX, and NEXTSTEP.  It
should be readily portable to other Unix variants (it requires only
POSIX plus BSD sockets, and uses GNU autoconf).

<P>Fetchmail is supported only for Unix by its official maintainers.
However, it is reported to build and run correctly under BeOS,
AmigaOS, Rhapsody, and QNX as well. 

<H1>Related resources:</H1>

Jochen Hayek is developing a set of
<a href="http://www.ACM.org/~Jochen_Hayek/JHimap_utils/">
IMAP tools in Python</a> that read your .fetchmailrc file and are
designed to work with fetchmail.   Jochen's tools can report selected
header lines, or move incoming messages to named mailboxes based on
the contents of headers.

<P>Scott Bronson has written a fetchmail plugin (actually, a specialist
MDA) called <a
href="http://www.trestle.com/linux/trestlemail/">trestlemail</a> that
helps redirect multidrop mail.

<P>Donncha O Caoihm has written a Perl script called 
<a href="http://cork.linux.ie/projects/install-sendmail/">install-sendmail</a>
that assists you in installing sendmail and fetchmail together/

<P>Peter Hawkins has written a script called <a
href="http://www.hawkins.emu.id.au/gotmail/">gotmail</a>
that can retrieve Hotmail. 

<P>A hacker identifying himself simply as \`Steines' has written a
filter which rewrites the to-line with a line which only includes
receipients for a given domain and renames the old to-line. It also
rewrites the domainpart of addresses if the offical domain is
different to local domain. You can find it <a 
href="http://www.steines.com/mailf/">here</a>.

<H1>Fetchmail's funniest fan letter:</H1>

<A HREF="funny.html">This letter</A> still cracks me up whenever I reread it. 

<H1>The fetchmail button:</H1>

If you use fetchmail and like it, here's a nifty fetchmail button you
can put on your web page:

<P><center><img src="fetchmail.png"></center>

<P>Thanks to <a href="http://www.gl.umbc.edu/~smatus1/">Steve
Matuszek</a> for the graphic design.  The hand in the button (and the
larger top-of-page graphic) was actually derived from a color scan of
the fetchmail author's hand. 

<H1>Fetchmail mirror sites:</H1>

There is a FTP mirror of the current sources and RPMs in Japan at
<a href="ftp://ftp.win.ne.jp/pub/network/mail/fetchmail">
ftp://ftp.win.ne.jp/pub/network/mail/fetchmail</a>.

<H1>Reviews and Awards</H1>

<P>Fetchmail was DaveCentral's Best Of Linux winner for
<a href="http://linux.davecentral.com/bol_19990630.html">June 30 1999</a>.

<P>Fetchmail was a five-star Editor's Pick at 
<a href="http://www.softlandindia.com/Linux/EmailClients.htm">Softlandindia</a>

<HR>
<table width="100%" cellpadding=0><tr>
<td width="30%">Back to 
<a href="http://$WWWVIRTUAL/~esr/software.html">Software</a>
<td width="30%" align=center>Up to <a href="http://$WWWVIRTUAL/~esr/sitemap.html">Site Map</a>
<td width="30%" align=right>$date
</table>

<P><ADDRESS>Eric S. Raymond <A HREF="mailto:esr@thyrsus.com">&lt;esr@snark.thyrsus.com&gt;</A></ADDRESS>
</BODY>
</HTML>
EOF

# The following sets edit modes for GNU EMACS
# Local Variables:
# mode:html
# truncate-lines:t
# End: