aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/fetchsetup
blob: 83223a116a1c5dce35df624600533b28efb2d26a (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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
#!/bin/sh

MSG() {
cat << EOF

# Fetchsetup is a shell script for creating a .fetchmailrc file, that will be
# used by the program "fetchmail" to connect to your mail domain and retrieve
# your mail.
# This script is linux specific, so it may not work on another system.
# Kent Robotti <krobot@erols.com> (3-31-99)

EOF
}

if [ "$(id -ur)" != "0" ]; then
    echo >&2 "$0: You need to be root [found $(id -un)] to run this script."
    echo >&2 "You could login as root"
    echo >&2 "You could also try one of these: # sudo fetchsetup"
    echo >&2 "                                 # su root -c fetchsetup"
    exit 1
fi

MSG
echo -n "Continue? (Y/n) : "
read ans
if [ "$ans" = "n" -o "$ans" = "N" ]; then
    echo "Cancelled."
    exit 0
fi

stty erase "^?" 2>/dev/null

echo
echo "Remote mail site?: pop.boo.com   <Your service providers mail domain name>"
echo -n "Remote mail site?: "
read SITE
echo
echo "Protocol?: pop3   <My service provider uses the 'pop3' mail protocol>"
echo "Protocol?: auto   <If not sure put: auto>"
echo "Choices: apop auto etrn imap imap-gss imap-k4 kpop pop2 pop3 rpop sdps"
echo -n "Protocol?: "
read PROTO
echo
echo "Remote username?: jerry   <My username or login is jerry>"
echo -n "Remote username?: "
read USR
echo
echo "Remote password?: ?       <What's the password for?: $USR>"
echo -n "Remote password?: "
read PASS

echo
echo -n "Create $HOME/.fetchmailrc file? (Y/n) : "
read ans
if [ "$ans" = "n" -o "$ans" = "N" ]; then
    echo
    echo "Fetchsetup cancelled."
    echo
    exit 0
fi

echo 'poll "'$SITE'"' > $HOME/.fetchmailrc
echo "protocol $PROTO" >> $HOME/.fetchmailrc
echo 'username "'$USR'"' >> $HOME/.fetchmailrc
echo 'password "'$PASS'"' >> $HOME/.fetchmailrc

PROCMAIL=`type -all procmail | sed -n "1 p" | cut -d' ' -f3`
SENDMAIL=`type -all sendmail | sed -n "1 p" | cut -d' ' -f3`

if [ ! "$PROCMAIL" = "" ]; then
    echo 'mda "'$PROCMAIL -d %s'"' >> $HOME/.fetchmailrc
    MDA="1"
elif [ ! "$SENDMAIL" = "" ]; then
    echo 'mda "'$SENDMAIL %s'"' >> $HOME/.fetchmailrc
    MDA="2"
else
    MDA="3"
fi

echo >> $HOME/.fetchmailrc
echo
echo "This is your $HOME/.fetchmailrc file."

chmod 600 $HOME/.fetchmailrc

echo
cat $HOME/.fetchmailrc

if [ ! "$MAIL" = "" ]; then
    echo "Fetchmail will retrieve your mail and put it in:"
    echo "$MAIL"
    if [ ! -f "$MAIL" ]; then
	touch $MAIL 2>/dev/null
	chmod 600 $MAIL 2>/dev/null
    fi
fi

echo
if [ "$MDA" = "1" ]; then
    echo "I put that (m)ail (d)elivery (a)gent in .fetchmailrc"
    echo "because i found it on your system, this doesn't mean"
    echo "it's correct or the one you want to use."
    echo
    echo "The first time you run fetchmail, you should run it"
    echo "this way: # fetchmail -k"
    echo
elif [ "$MDA" = "2" ]; then
    echo "You seem to have sendmail, sendmail will be used"
    echo "as the (m)ail (d)elivery (a)gent for fetchmail."
    echo
    echo "WARNING! There's no way to know if sendmail is set up"
    echo "properly for local mail delivery, so the first time you"
    echo "run fetchmail run it this way: # fetchmail -k"
    echo
    echo "If the mail that fetchmail retrieves is not put in your mailbox,"
    echo "you'll know that sendmail is not set up properly for the delivery"
    echo "of local mail."
    echo
elif [ "$MDA" = "3" ]; then
    echo "I Don't know what (m)ail (d)elivery (a)gent you're going to use."
    echo "You need a <mda> to deliver the mail to you, after <fetchmail> retrieves it."
    echo
    echo "Put the <mda> in your .fetchmailrc file, like below."
    echo "password $PASS"
    echo mda '"/usr/bin/procmail -d %s"'
    echo mda '"/usr/sbin/sendmail %s"'
    echo
    echo "The first time you run fetchmail, you should run it"
    echo "this way: # fetchmail -k"
    echo
fi
="p">>to a separate page (click here for security information)</a> to unclutter the front page. <p style="font-size:100%"><strong>Please <a href="https://sourceforge.net/projects/fetchmail/files/branch_6.4/">update to the newest fetchmail version</a>.</strong></p> </div> <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 IMAP, ETRN, and ODMR. It can even support IPv6 and IPSEC.</p> <p>Fetchmail retrieves mail from remote mail servers and forwards it via SMTP, so it can then 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> <p>Fetchmail offers better protection against password-sniffing 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="https://www.openssh.com/">ssh, the Secure Shell</a>.</p> <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> <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> <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> <p>Fetchmail is <a href="https://opensource.org">open-source</a> and <a href="https://www.gnu.org/philosophy/free-sw.html">free software</a>.</p> <h1>Where to find out more about fetchmail:</h1> <p>See the <a href="fetchmail-features.html">Fetchmail Feature List</a> for more about what fetchmail does.</p> <p>See the on-line <a href="fetchmail-man.html">manual page</a> for basics.</p> <p>See the <a href="fetchmail-FAQ.html">HTML Fetchmail FAQ</a> for troubleshooting help.</p> <p>See the <a href="design-notes.html">Fetchmail Design Notes</a> for discussion of some of the design choices in fetchmail.</p> <p>See the project's <a href="todo.html">To-Do list</a> for indications of known problems and requested features.</p> <p>The developers use <a href="https://git-scm.com/">Git</a> for revision control. To browse the repository or to get the latest development version, find the instructions at <a href="https://gitlab.com/fetchmail/fetchmail">https://gitlab.com/fetchmail/fetchmail</a>. The <a href="fetchmail-FAQ.html#G2">fetchmail FAQ in section G2 lists the widely-known and active branches.</a></p> <p>See the <a href="https://sourceforge.net/projects/fetchmail/">project page</a> for more, including <a href="https://sourceforge.net/projects/fetchmail/files/branch_6.4/">downloads</a>.</p> <h1>Getting help with fetchmail:</h1> <p>Before submitting a question anywhere, <strong>please read the <a href="fetchmail-FAQ.html">FAQ</a></strong> (especially item <a href="fetchmail-FAQ.html#G3">G3</a> on how to report problems). We tend to get the same three newbie questions over and over again. The FAQ covers them like a blanket.</p> <p>There is a fetchmail-users list for help and other user discussion of fetchmail. It's a MailMan list, which you can sign up for at <a href="https://sourceforge.net/projects/fetchmail/lists/fetchmail-users"> fetchmail-users@lists.sourceforge.net</a>. <br>There is also a fetchmail-devel list for people who want to discuss fixes and improvements in fetchmail and help co-develop it. That one is at <a href="https://sourceforge.net/projects/fetchmail/lists/fetchmail-devel"> fetchmail-devel@lists.sourceforge.net</a>. <br>Finally, there is a low-traffic announcements-only list, <a href="https://sourceforge.net/projects/fetchmail/lists/fetchmail-announce"> fetchmail-announce@lists.sourceforge.net</a>.</p> <h1>Maintainer History</h1> <p>Fetchmail originated as a program called <i>popclient</i>, written by Carl Harris. In 1996, <a href="http://www.catb.org/~esr/">Eric S. Raymond</a> took over; he soon renamed the program to fetchmail after adding IMAP support.</p> <p>In 2004 a new team took over, led by <a href="https://sourceforge.net/u/robfunk/profile/">Rob Funk</a>, Graham Wilson, and <a href="https://sourceforge.net/u/m-a/profile/">Matthias Andree</a>. Since then, Graham Wilson has retreated, and Sunil Shetye has contributed several important pieces of code.</p> <h1>You can help improve fetchmail:</h1> <p>We welcome your code contributions. But even if you don't write code, you can help fetchmail improve.</p> <p><strong>If you administer a site that runs a post-office server, you may be able help improve fetchmail by lending us a test account on your site. Note that we do not need a shell account for this purpose, just a mailbox and a mail address. Nor are we interested in collecting maildrops per se -- what we're collecting is different <em>kinds of servers</em>.</strong></p> <p>Before each release, we run a test harness that sends date-stamped test mail to each site on our regression-test list, then tries to retrieve it. Please take a look at the <a href="testservers.html"> list of test servers</a>. If you can lend us an account on a kind of server that is <em>not</em> already on this list, please do.</p> <h1>Where you can use fetchmail:</h1> <p>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> <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. There is a CygWin port.</p> <h1>Related works</h1> <h2>Similar software</h2> <p><strong>fdm:</strong> A software package that integrates basic filtering is <a href="https://github.com/nicm/fdm">Nicholas Marriott's fdm</a>. <p><strong>getmail:</strong> When fetchmail's development was stalled before the latest team took over, <a href="http://pyropus.ca/software/getmail/">Charles Cazabon's getmail</a> came along as an intended replacement. It still doesn't do everything that fetchmail does, and often suffers from Python library shortcomings, for instance when it comes to SSL, but it's close enough to give us a bit of competition. <br>There is also an <a href="https://getmail6.org/">inofficial unsanctioned fork called getmail6</a> with adaptations to work with Python 3.</p> <p><strong>animail:</strong> Another contender with integrated filtering was, but is currently unmaintained, <a href="https://github.com/juanjux/animail">Juanjo &Aacute;lvarez Mart&iacute;nez's Animail</a>.</p> <h2>Complementary and extension software</h2> <p><a href="https://sourceforge.net/projects/getlive/">GetLive</a>, a successor to the discontinued Gotmail. (Gotmail was a script to fetch mail from Hotmail, written by Peter Hawkins, see <a href="http://linux.cudeso.be/linuxdoc/gotmail.php">gotmail</a>.)</p> <p>There's a program called <a href="http://mailfilter.sourceforge.net/">mailfilter</a> which can be used to do spam filtering, that works particularly well called from fetchmail's <code>preconnect</code> directive.</p> </div> </body> </html>