If you??™re doing a complex setup in which you retrieve mail from a single mailbox
that needs to be sorted for multiple users, see the fetchmail man page for information about
multidrop mailboxes.
A .fetchmailrc file can be as simple as this:
poll mailserver.yourisp.example protocol pop3 username "foo"
If you have more than one mail server, you can add it as an additional line. If the server from which
you are pulling mail supports IMAP, you can use imap instead of pop3. Other options that you can
have are password=your password and ssl. Storing the password in the file enables you to
NOTE
CROSS-REF
684
Running Servers Part V
run Fetchmail without entering a password, and the ssl option tells Fetchmail to use an SSL/TLS
connection to the server.
Your .fetchmailrc file should not be readable by others, and Fetchmail will generally
complain if it is. To set the permissions so that only you can read it, run chmod 0600
$HOME/.fetchmailrc/.
Running Fetchmail is as simple as typing
$ fetchmail
If you want to have Fetchmail run in the background, you can use the --daemon (or -d) flag
with a parameter telling it how often (in seconds) to poll the servers:
$ fetchmail --daemon 300
To have Fetchmail automatically start when the system boots, add this to your crontab file:
@reboot /usr/bin/fetchmail --daemon 300
Fetchmail cannot prompt for passwords when run in this manner, which means that you
must store the passwords in .
Pages:
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261