Tech Support > Operating Systems > Linux / Variants > fetchmail: what's the point?
fetchmail: what's the point?
Posted by Tristan Miller on October 12th, 2003


Greetings.

I understand what fetchmail does, or at least I think I do, but I don't see
the point of using it (from the point of view of a standard home user on a
single-account machine). It just connects to a POP or IMAP server and
downloads mail to a local spool file to be read by one's favourite e-mail
client, right? What advantage does this have over simply configuring one's
e-mail client to do essentially the same thing? Humour me, here. I just
want to understand why this program is so popular. Is it compensating for
some deficiency in a popular mail client (e.g., the inability to handle
multiple POP accounts, or lack of a particular authentication method)? I
have a personal machine with a permanent ethernet connection, and have
KMail configured to periodically download mail from one IMAP and four POP
accounts. Will using fetchmail instead improve my quality of life in any
way?

Regards,
Tristan

--
_
_V.-o Tristan Miller [en,(fr,de,ia)] >< Space is limited
/ |`-' -=-=-=-=-=-=-=-=-=-=-=-=-=-=-= <> In a haiku, so it's hard
(7_\\ http://www.nothingisreal.com/ >< To finish what you

Posted by Jem Berkes on October 12th, 2003


fetchmail is many things to many people. In your situation, you might only
benefit if you also have a server-type system that's always connected (e.g.
router, gateway). In such a situation, you might find it useful to have
fetchmail run on the server and automatically get mail from your ISP:

1) You can benefit from local procmail or other filtering
2) Your mail client can be configured to retrieve mail from LAN - faster
3) Mail is safely stored on your LAN even if Internet connection dies

--
Jem Berkes
http://www.sysdesign.ca/

Posted by John Hasler on October 12th, 2003


Jem Berkes writes:
I benefit precisely because my server is not always connected (demand
dial). Whenever the link comes up fetchmail fetchs the mail (deleting
messages over 140k, thereby getting rid of most Swens) and feeds it to
exim. Exim runs spamassasin over it and then delivers it to several
accounts on several machines. My wife and I can then read our mail at our
leisure without necessarily tying up the phone. Our mail is also moved
fairly promptly to my own server, which I trust more than my ISPs.
--
John Hasler
john@dhh.gt.org (John Hasler)
Dancing Horse Hill
Elmwood, WI

Posted by Kirk Strauser on October 12th, 2003


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

At 2003-10-12T16:57:21Z, Tristan Miller <psychonaut@nothingisreal.com> writes:

One word: latency. When you first log in each morning, all of the mail that
you'd otherwise have to download from each of your mailservers is happily
waiting for you on your LAN. You don't have to wait for the "Get new mail"
function to poll various and sundry servers and download large messages -
fetchmail already did it for you while you were doing other things.

I like it because I have an account at my ISP that I've literally never used
for anything other than getting quarterly billing statements. Instead of
having to remember to configure each email client to fetch from that
account, I just point them to the mailserver on my LAN.
- --
Kirk Strauser
The Strauser Group
Open. Solutions. Simple.
http://www.strausergroup.com/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)

iD8DBQE/iZRf5sRg+Y0CpvERAsBFAJ42uCR/BKYCVWumnCl35UIG8uiifACghAXH
crYnYf1ExGhRyyYrU4HEiJQ=
=qvOg
-----END PGP SIGNATURE-----

Posted by Peter T. Breuer on October 12th, 2003


In comp.os.linux.misc Tristan Miller <psychonaut@nothingisreal.com> wrote:
Yes.

The advantage is

1) it does it without you being present, so that you don't have to
wait to download your mail when you finally wake up. I get
thousands of mails a day.

2) it passes the mail through the normal reception procedure on your
box, so all the normal procedures can be applied to it (scanning for
spam, storing in separate mail boxes, etc.).

3) it means that you don't have to run a pop- or imap- enabled client
(I don't)!

4) it collects mail from multiple servers, using all sorts of
different protoco9ls.


It'll allow you not to use kmail, which will help you. How are you
spamfiltering? What do your procmail filters look like?

Why doesn't kmail just fire up fetchmail instead of trying to do it all
itself?

Peter

Posted by Geoff on October 12th, 2003


On Sun, 12 Oct 2003 18:57:21 +0200, Tristan Miller wrote:

<snip>

the same way you use kmail. One thing it would not do, however, was to
enable me to use popsneaker to delete spam on the server wrt to this
capsthorne account - which is heavily spammed because of ng participation.
The simple answer was to use fetchmail on capsthorne because popsneaker
dovetails nicely with fetchmail. When fetchmail/popsneaker have done
their thing, the mail goes to my default box, from which sylpheed collects
it (actually it is bogofilter / procmailed before delivery as a second
line of defence against spam.

Geoff

Posted by Michael Heiming on October 12th, 2003


Peter T. Breuer <ptb@oboe.it.uc3m.es> wrote:
[..]
Yep, so don't write Peter, chances are really low for an answer...


....
That's among the best about fetchmail, besides the one minute to configure
..fetchmailrc.


You don't expect him to (yet) know about .procmailrc, despite the
need to run a local MTA to use it.

Don't know, just run fetchmail from cron or from a shell script that runs
in a loop, running fetchmail and other stuff every 10 minutes.

--
Michael Heiming

Remove +SIGNS and www. if you expect an answer, sorry for
inconvenience, but I get tons of SPAM

Posted by Rod Smith on October 12th, 2003


In article <5552341.9ta62gnFjJ@id-187157.news.dfncis.de>,
Tristan Miller <psychonaut@nothingisreal.com> writes:
Fetchmail certainly isn't necessary for all people. It does help some
people, though. Some of the advantages that spring to mind include:

- Mail reader independence -- By pulling the contents of a POP account
into a local mail queue, you can switch from one client to another. This
might be handy if you sometimes use GUI and a GUI mail client (KMail,
Evolution, etc.) and sometimes use text mode and a text mode mail client
(pine, mutt, etc.). It could also be handy if you use different mail
clients for different purposes -- say if you normally use a mail client
that doesn't handle attachments well, but need to switch to another to
handle mail with attachments.
- POP-to-IMAP -- If you run a LAN, you can use Fetchmail to grab your mail
from a POP account and then run an IMAP server so that you can read your
mail on any computer on your LAN. This gives many of the same advantages
as the previous one, but spread across a LAN.
- Filtering -- By injecting mail into a local queue, you can run a
Procmail filter to do any sort of spam or worm/virus filtering you like.
Many mail readers offer similar options, but this feature will let you
apply any filter that Procmail (or various other filters, like
mailfilter) can apply, which is more than some clients offer. Similarly,
you can have Procmail sort your mail into folder for various mailing
lists.
- Account consolidation -- If you've got two or more ISP mail accounts,
you can retrieve mail from both and inject it into the same local
account, which simplifies mail client configuration. I've even seen
clients that don't support more than one POP account, although I don't
know how common this is. Note that your local accounts also qualify in
this way; for instance, if you use POP directly from your mail client,
you might not see messages generated by cron jobs or the like appear in
your normal mail queue. If you use Fetchmail, they'll all appear
together, at least with typical configurations.
- Account splitting -- If the same account is shared by multiple people,
you can use Fetchmail in conjunction with Procmail rules (or I believe
raw Fetchmail options in some cases) to sort mail appropriately for the
two users, assuming there's some identifying header you can use to
reliably differentiate mail for the multiple users.

I'm sure there are other benefits to Fetchmail, but these are the ones
that spring to mind.

--
Rod Smith, rodsmith@rodsbooks.com
http://www.rodsbooks.com
Author of books on Linux, FreeBSD, and networking

Posted by Andy Baxter on October 12th, 2003


On Sun, 12 Oct 2003 18:57:21 +0200, Tristan Miller wrote:

I've started using it recently because kmail died on me during a debian
upgrade, and I wanted to set up my mail system so it doesn't rely on any
particular mail client. This also means I can read mail using a text-only
program like mutt, which could be useful for things like if I ever have to
ssh into my box from elsewhere to read the mail.

Another advantage is it keys into the standard unix mail delivery system,
which means you can use programs designed as part of this to do things
like filtering or redirecting mail (e.g. procmail). This also makes it
harder to set up, as you have to set up both fetchmail and the local
message delivery agent. (I've used qmail which wasn't too hard and has a
reputation for security.)

andy.

--
remove 'n-u-l-l' to email me. html mail or attachments will go in the spam
bin unless notified with [html] or [attachment] in the subject line.

Posted by John-Paul Stewart on October 12th, 2003


Michael Heiming wrote:
Actually, fetchmail's "daemon mode" will do that. Start it up with
'fetchmail -d 600' and it'll put itself in the background and poll for
mail every 600 seconds (10 minutes). Or put the appropriate option in
~/.fetchmailrc and it'll always default to daemon mode. 'man fetchmail'
for more info.

Posted by W. Citoan on October 12th, 2003


On Sun, 12 Oct 2003 20:24:58 +0200, Michael Heiming wrote:
Not exactly (regarding the MTA comment; not the implied complexity).
You can configure fetchmail to go straight to procmail via the --mda
option.

Check fetchmail's -d option. This will run it in daemon mode and it
will pull at the specified interval.

- W. Citoan
--
The [Ford Foundation] is a large body of money completely surrounded by
people who want some.
-- Dwight MacDonald

Posted by Mark Crispin on October 12th, 2003


Think of fetchmail as being an MTA instead of an MUA; like all MTAs, its
purpose is to transport mail towards its final destination. fetchmail is
specifically a "pull" type MTA whereas most MTAs using SMTP are "push"
type.

If you think of fetchmail as an MUA (which is easy to do since it is an
IMAP and POP client), then it is easy (particularly for an IMAP client MUA
user) to become bewildered as to why someone would want to use it.

The key to understanding fetchmail is in identifying the place where you
want mail stored when you access it with your MUA. If that system is
accessible via SMTP, then you don't need fetchmail.

If, on the other hand, you always read your mail at one side of a slow
and/or discontinuous and/or expensive Internet link, you probably want
your mail to reside on the same side of that link with you.

It is one thing to occasionally access your IMAP mailbox over a dialup (or
CDPD!!!!) link but usually access it via high-speed Internet. It is quite
another if you always use dialup.

I expect that as time goes on, tools such as fetchmail will be overtaken
by events, just as the arguments favoring POP over IMAP were overtaken by
events. However, I suspect that when we start having manned stations on
the Moon and Mars, we'll have a need to dust off "pull" technology again.

-- Mark --

http://staff.washington.edu/mrc
Science does not emerge from voting, party politics, or public debate.
Si vis pacem, para bellum.

Posted by Alan Connor on October 12th, 2003


On Sun, 12 Oct 2003 18:57:21 +0200, Tristan Miller <psychonaut@nothingisreal.com> wrote:
Take a look at the manpage. Fetchmail has a number of features that your
MUA is not likely to have.

For myself, I prefer to use seperate programs to fulfill seperate functions,
which makes troubleshooting and security much simpler, as well as allowing
for flexibility: What if you wish to change MUAs? What if you apply a patch
and mess it up? If you have a seperate utility checking and downloading your
mail, then at least you can load the mailboxes in a pager and make sure
that you aren't missing anything critical until you get the problem
straightened out.

--
Later, Alan C
You can find my email address at the website: contact.html
take control of your mailbox ----- elrav1 ----- http://tinyurl.com/l55a

Posted by Michael Heiming on October 12th, 2003


W. Citoan <wcitoan@nospam-yahoo.com> wrote:
Well, I prefer the MTA, at least for outgoing stuff and spamd is listening,
so there is no point of not running some MTA.


Sure, but it won't run the "other stuff" as written.

--
Michael Heiming

Remove +SIGNS and www. if you expect an answer, sorry for
inconvenience, but I get tons of SPAM

Posted by Michael Heiming on October 12th, 2003


John-Paul Stewart <jpstewart@sympatico.ca> wrote:
Actually I know how fetchmail works, if you take a close look at my
post, I mentioned "fetchmail and other stuff" that simply won't run
with the -d option.

--
Michael Heiming - RHCE

Remove +SIGNS and www. if you expect an answer, sorry for
inconvenience, but I get tons of SPAM

Posted by Neil W Rickert on October 12th, 2003


Tristan Miller <psychonaut@nothingisreal.com> writes:

If you are happy with what you are doing, there is no reason to
change.

For me, "fetchmail" allows me to pick up mail in a standard way, and
then I can read the mail from any of several mail clients (nmh, exmh,
mailx, mutt). If you are happy sticking to the one mail client, you
may not need this flexibility.


Posted by Neil W Rickert on October 12th, 2003


Andy Baxter <news3@earthsong.null.free-online.co.uk> writes:

If mutt was built with "--enable-pop" and "--enable-imap", you should
be able to directly access pop3 and imap servers. Granted, fetchmail
is useful nonetheless.


Posted by John-Paul Stewart on October 12th, 2003


Michael Heiming wrote:
I'm sure you do. It was my intent to point out to the OP (who is not so
familiar with fetchmail) that if there is no "other stuff", it can be
done with fetchmail directly. I guess I should have been clearer in my
first post.

Posted by William Park on October 12th, 2003


In <comp.os.linux.misc> Neil W Rickert <rickert+nn@cs.niu.edu> wrote:
I agree. Either way, emails end up in your mailbox in the end. But,
fetchmail hands the emails to port 25 and leaves the delivery to the
system. Here, various mail filters kick in.

--
William Park, Open Geometry Consulting, <opengeometry@yahoo.ca>
Linux solution for data management and processing.

Posted by Michael Heiming on October 12th, 2003


John-Paul Stewart <jpstewart@sympatico.ca> wrote:
[...]
No problem,


That's what actually runs:

#!/bin/ksh
#
# Michael Heiming <michael@iFUCKALLSPAMMERheiming.de>
#
# Get mail & news
#
#
SLEEP="600"
FNEWS="sudo /root/bin/f-news"
FMAIL="${HOME}/bin/fmail"

while true
do

# Don't disturb running stats/newuser FAQ!

ps aux | grep [m]ake.stat2.sh >/dev/null && exit 1
ps aux | grep [m]ake.newusers.sh >/dev/null && exit 1

$FNEWS
$FMAIL
echo "Sleeping for ${SLEEP} seconds, press [CTRL-C] to stop"
sleep ${SLEEP}
done


--
Michael Heiming

Remove +SIGNS and www. if you expect an answer, sorry for
inconvenience, but I get tons of SPAM


Similar Posts