README
1 fetchmail README
2
3 Fetchmail is a free, full-featured, robust, well-documented remote
4 mail retrieval and forwarding utility intended to be used over
5 on-demand TCP/IP links (such as SLIP or PPP connections). It
6 retrieves mail from remote mail servers and forwards it to your local
7 (client) machine's delivery system, so it can then be be read by
8 normal mail user agents such as elm(1) or Mail(1).
9
10 Fetchmail supports all standard mail-retrieval protocols in use on the
11 Internet: POP2, POP3, RPOP, APOP, KPOP, IMAP2bis, IMAP4, IMAP4rev1
12 ESMTP ETRN, and ODMR. Fetchmail also fully supports authentication
13 via GSSAPI, Kerberos 4 and 5, RFC1938 one-time passwords, Compuserve's
14 POP3 with RPA, Microsoft's NTLM, Demon Internet's SDPS, or CRAM-MD5
15 authentication a la RFC2195. Fetchmail also supports end-to-end
16 encryption with OpenSSL.
17
18 The fetchmail code was developed under Linux, but has also been
19 extensively tested under the BSD variants, AIX, HP-UX versions 9 and
20 10, SunOS, Solaris, NEXTSTEP, OSF 3.2, IRIX, and Rhapsody.
21
22 It should be readily portable to other Unix variants (it uses GNU
23 autoconf). It has been ported to LynxOS and BeOS and will build there
24 without special action. It has also been ported to QNX; to build
25 under QNX, see the header comments in the Makefile. It is reported to
26 build and run under AmigaOS.
27
28 See the distribution files FEATURES for a full list of features, NEWS
29 for detailed information on recent changes, NOTES for design notes, and
30 TODO for a list of things that still need doing.
31
32 The INSTALL file describes how to configure and install fetchmail.
33
34 The fetchmail code appears to be stable and free of bugs affecting
35 normal operation (that is, retrieving from POP3 or IMAP in single-drop
36 mode and forwarding via SMTP to sendmail). It will probably undergo
37 substantial change only if and when support for a new retrieval
38 protocol or authentication mode is added.
39
40 If you want to hack on this code, a list of known bugs and to-do items
41 can be found in the file todo.html.
42
43 You can get the code from the fetchmail home page:
44
45 http://fetchmail.berlios.de/
46
47 Enjoy!
48
49 -- esr, ma
50
51 README.NTLM
1 NTLM support by Grant Edwards <grante (a] visi.com>
2
3 This directory contains sources for a library which provides
4 routines to manipulate the structures used for the client end
5 of Microsoft NTLM authentication.
6
7 This code (the ntlm.h file and smb*.[ch] files) was taken mostly from
8 the Samba project and was initially intended for use with Microsoft
9 Exchange Server when it is configured to require NTLM authentication
10 for clients of its IMAP server.
11
12 Not much effort has been put into making this portable, and the author
13 only know for sure that it works on i386 Linux glibc systems -- though
14 there shouldn't be anything all that system-specific anywhere. System
15 byte order differences should already be taken care of.
16
17 USAGE
18
19 The application program must convert these structures to/from base64
20 which is used to transfer data for IMAP authentication. For example
21 usage see the sources for the mutt MUA or here in the fetchmail
22 package.
23
24 In general the usage is something like shown below (no, I don't
25 know if this code even compiles, but you get the idea
26 hopefully):
27
28
29 #include <ntlm.h>
30
31 extern char *seqTag; /* IMAP sequence number */
32
33 int imap_auth_ntlm(char *user, char *domain, char *pass)
34 {
35 tSmbNtlmAuthRequest request;
36 tSmbNtlmAuthChallenge challenge;
37 tSmbNtlmAuthResponse response;
38 char buffer[512];
39 char tmpstr[32];
40
41 writeToServer("%s AUTHENTICATE NTLM\r\n",seqTag);
42 readFromServer(buffer)
43
44 /* buffer should be "+", but we won't show code to check */
45
46 /*
47 * prepare the request, convert to base64, and send it to
48 * the the server. My server didn't care about domain, and NULL
49 * worked fine.
50 */
51
52 buildSmbNtlmAuthRequest(&request,user,domain);
53 convertToBase64(buffer, &request, SmbLength(&request));
54 writeToServer("%s\r\n",buffer);
55
56 /* read challange data from server, convert from base64 */
57
58 readFromServer(buffer);
59
60 /* buffer should contain the string "+ [base 64 data]" */
61
62 convertFromBase64(&challenge, buffer+2);
63
64 /* prepare response, convert to base64, send to server */
65
66 buildSmbNtlmAuthResponse(&challenge, &response, user, pass);
67 convertToBase64(buffer,&response,SmbLength(&response));
68 writeToServer("%s\r\n",buffer);
69
70 /* read line from server, it should be "[seq] OK blah blah blah" */
71
72 readFromServer(buffer);
73
74 sprintf(tmpstr,"%s OK",seqTag);
75
76 if (strncmp(buffer,tmpstr,strlen(tmpstr)))
77 {
78 /* login failed */
79 return -1;
80 }
81
82 return 0;
83 }
84 README.packaging
1 README.packaging
2 ================
3
4 fetchmail 6.3 changes relevant for packagers
5 --------------------------------------------
6
7 Greetings, dear packager!
8
9 The bullet points below mention a few useful hints for package(r)s:
10
11 - Please use OpenSSL and add --with-ssl to the ./configure command line.
12 SSL/TLS support hasn't been enabled in the default build in order to
13 maintain fetchmail 6.2 compatibility as far as possible.
14 SSL/TLS however is a highly recommended compilation option.
15
16 - Fetchmail now uses automake and supports all common automake targets
17 and overrides such as "make install-strip" or "DESTDIR=..." for staging
18 areas.
19
20 - The fetchmailconf script has been renamed to fetchmailconf.py,
21 automake will install it into Python's top-level site-packages directory
22 and byte-compile it (so you need to package or remove
23 fetchmailconf.pyc and fetchmailconf.pyo as well).
24
25 - If you want to defeat Python byte-code compilation and would rather
26 like to install fetchmailconf.py yourself, you can add
27
28 PYTHON=:
29
30 to the ./configure command or pass this in the environment.
31 This pretends that no Python interpreter were installed.
32
33 - The Makefile generates a two-line "fetchmailconf" /bin/sh wrapper
34 script that executes the actual fetchmailconf.py with the python
35 installation found at configuration time, so that users can still type
36 "fetchmailconf" rather than "python fetchmailconf".
37
38 - Note that fetchmailconf.py supports a few command line arguments, so
39 if you use local wrapper scripts, be sure they pass on their own
40 arguments properly. Remember to use "$@" (with quotes) in shells, not $*.
41
42 - There is now a dummy fetchmailconf manual page which will just source
43 (roff's ".so" command) the fetchmail manual page for now. You can of
44 course keep your symlinks in place and ignore this dummy. IF you
45 install the dummy and compress your man pages, be sure to test "man
46 fetchmailconf", on some systems, you'll need to adjust the ".so"
47 command to point to the compressed version.
48 README.SSL
1 Fetchmail SSL support
2 =====================
3
4 NOTE: This text is maybe not explanatory enough, so a little knowledge about
5 public-key-cryptography and associated topics is required.
6
7 Using the fetchmail ssl option, you can have the data transferred between you
8 and the server in an encrypted form, so that eavesdropping should become
9 practically impossible.
10
11 This works as following: the server has a key pair (a secret and a public key),
12 and it sends the client it's public key. Messages encrypted with the public key
13 can be decrypted using the private one and vice versa.
14 A symmetric session key (symmetric means that the same key is used for
15 encryption and decryption) can now be agreed upon by the two parties using
16 the secure channel the key pair builds. The session key is now used to encrypt
17 the traffic.
18
19 In the fetchmail case, the client can now authenticate itself to the server by
20 using the usual POP/IMAP/whatever authentication mechanisms.
21
22 However, so called man-in-the-middle attacks are still possible: in such a
23 setting, an attacker imposes the server, and thus can e.g. get your
24 authentication information if you don't use a challenge based authentication
25 mechanism (because he is thought to be the real server, fetchmail will try to
26 authenticate against it by telling it your password).
27
28 So, not only you need to prove your identity to the server, the server likewise
29 needs to prove it's to you.
30 In the standard setting, the server has a certificate (the client can have a
31 certificate too to prove its identity, but this is not covered by this
32 document). This certificate contains the server's public key, some data about
33 the server, and a digital signature and data about the signer.
34 Digital signatures can also be made using a key pair as described earlier.
35
36 To check this certificate, you may use the new option sslcertck. When it is
37 specified, the signature of server certificate is checked against local trusted
38 certificates to see whether the owner of one of the ceritificates has signed
39 that server certificate, and if so, whether the signature is valid.
40 So, if the server certificate is signed by a Certification Authority (CA),
41 you put the CA's certificate into a directory where you keep trusted
42 certificates, and point fetchmail to it. Fetchmail will then accept certificates
43 signed by the owner of that certificate with the private key belonging to the
44 public key in the certificate.
45 You can specifiy this path using the sslcertpath option.
46 The idea is that the CA only gives certificates to entities of which it has
47 checked and verified the identity of (and in this case, that the server name you
48 specify does belong to it). So, if you chose the intentions and the thoroughness
49 of a CA, you can be reasonably sure that if a certificate is signed by the CA,
50 it really belongs to the server and owner that it claims to.
51
52 Certificates are only valid in a certain time window, so your system clock
53 should be reasonably accurate when checking certificates.
54
55 Additionally, CAs keep Certificate Revocation Lists (CRLs) in which they note
56 the certificates that are to be treated as invalid (e.g. because the server
57 name has changed, another ceritifcate was granted, or even because the
58 certificate was not granted to the rightful owner).
59
60 The really paranoid (who chose to not trust a CA) can check the fingerprint of
61 the public key that is used by the server. The fingerprint is a hash of that
62 key that (hopefully) has few collisions and is hard to attack using a "birthday
63 attack", i.e. nobody can generate a second key that hashes to the same value
64 of the original key in reasonable time. So, if the fingerprint matches, you
65 can be reasonable sure that you talk to the original server, because only that
66 knows the secret key, and it is very hard to generate a matching secret key from
67 the public key. If it doesn't, it might be an attack, but keep in mind that the
68 server key may also have changed legitimately before panicing ;)
69
70 fetchmail will present the fingerprint to you. Another mode, that strictly
71 checks the fingerprint, is available (using the sslfingerprint option, and
72 giving the desired fingerprint as an argument). If you want to check finger-
73 prints, you should use that option, because otherwise, it may be too late
74 to cancel if you see the fingerprint (your password may already have been
75 transmitted)!
76
77 The certificate directory must be hashed in a way OpenSSL expects it: each
78 time you modify a file in that directory or add a file to it, you need
79 to use the c_rehash perl script that comes with OpenSSL (in the tools/
80 subdirectory, in case that it isn't installed). Additionally, you might
81 need to convert the ceriticates to different formats (the PEM format is expected
82 and usually is available, DER is another one; you can convert between
83 both using the openssl(1) utility).
84
85 The fingerprints fetchmail uses are MD5 sums. You can generate them e.g. useing
86 the openssl(1) "x509 -fingerprint" command. The format is a hexadecimal string
87 with a ":" separating two byes (i.e. a ":" every two hex "digits"). The letter
88 hex digits must be in upper case!
89
90 *CAVEAT*: OpenSSL seems to be unable to check CRLs at the moment!
91
92 - Thomas Moestl <tmoestl (a] gmx.net>
93