View previous topic :: View next topic |
Author |
Message |
marcion Apprentice
Joined: 14 Mar 2005 Posts: 158 Location: England
|
Posted: Wed Mar 14, 2007 1:01 am Post subject: Fetchmail newbie needs help with fetchmailrc please |
|
|
Background and moaning
I have followed the Gentoo QuickStart Guide to Mutt E-Mail, which is very well written as far as it goes but does not leave anyone with a fully working setup at the end. This is a little half-baked.
I have done everything in the guide, and everything works as planned, however you have to run some whacky command to get new email onto your box:
Quote: | $ fetchmail -akv -m "/usr/bin/procmail -d %T"
Once you have a working mail system you can set this as a cron job or put it in a monitor like gkrellm. Fetchmail can also run in a daemon mode for which you specify a polling interval in seconds. |
Well the Gentoo-ish way would be to do the latter and use Code: | /etc/init.d/fetchmail start |
And use rc-update to have the fetchmail daemon start at boot. Now /etc/fetchmailrc does not exist by default. It would have been better if the fetchmail maintainer had provided an example setup there, as most maintainers do. (Even better would be to patch fetchmail to just use /etc/conf.d/fetchmail alone).
The Problem
So enough moaning and ranting. Has anyone set up /etc/fetchmailrc and got it to work with the QuickStart Guide to Mutt E-Mail system? If so then please let me know how?
My feeble attempt was:
Code: | poll pop.host.co.uk protocol pop3
user "marcion" password "blah" is marcion here |
But this does nothing, does procmail have to be in there somewhere? |
|
Back to top |
|
|
frostschutz Advocate
Joined: 22 Feb 2005 Posts: 2977 Location: Germany
|
Posted: Wed Mar 14, 2007 2:01 am Post subject: |
|
|
I don't have a global fetchmail solution. I just put the "whacky command" into a shell script ~/bin/fetchmail.sh and added a cron job that executes it every 15 minutes using 'crontab -e'. All as the user who is getting the mail delivered. This gives me, as a user, total control over how I fetch mails from my servers, without having to involve anything in init.d/etc and thus involve root. |
|
Back to top |
|
|
wuzzerd Guru
Joined: 05 Jan 2005 Posts: 467 Location: New Mexico
|
Posted: Wed Mar 14, 2007 2:27 am Post subject: |
|
|
You can put a .fetchmailrc in your home directory and start fetchmail in your .bashrc. If you use the -d flag it will run in the background as a daemon with the user's priveldges not roots.
Check the man page for more info. |
|
Back to top |
|
|
plq n00b
Joined: 18 Sep 2006 Posts: 19
|
Posted: Wed Mar 14, 2007 12:14 pm Post subject: |
|
|
trying to do almost the same thing as you, i ended up using qmail instead of nbsmtp. all fetchmail does is to pump incoming mail through local smtp, so after battling with incomplete mtas, that was my solution. yes it's a bit difficult but in the end, I have my peace of mind
you may follow the qmail/vpopmail howto without vpopmail.
I also emerged apache, php, squirrelmail and manually installed squirrel's serversidefilter plugin in order to generate .procmailrc files using a web interface.
anyway, here's the template of my /etc/fetchmailrc:
Code: | set logfile = "/var/log/fetchmail.log"
defaults:
batchlimit 1
poll <mailserver> with protocol <proto>:
user "<username>" pass "<password>" fetchall forcecr nokeep
preconnect "date >> /var/log/fetchmail.log"
is "<local user>@<FQDN>" here
poll ...
|
it's just the tweaked version of your fetchmailrc
and, here's ~/.qmail:
Code: | |preline /usr/bin/procmail /home/<local user>/.procmailrc |
hope it helps |
|
Back to top |
|
|
|