Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Fetchmail newbie needs help with fetchmailrc please
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
marcion
Apprentice
Apprentice


Joined: 14 Mar 2005
Posts: 158
Location: England

PostPosted: Wed Mar 14, 2007 1:01 am    Post subject: Fetchmail newbie needs help with fetchmailrc please Reply with quote

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
View user's profile Send private message
frostschutz
Advocate
Advocate


Joined: 22 Feb 2005
Posts: 2977
Location: Germany

PostPosted: Wed Mar 14, 2007 2:01 am    Post subject: Reply with quote

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
View user's profile Send private message
wuzzerd
Guru
Guru


Joined: 05 Jan 2005
Posts: 467
Location: New Mexico

PostPosted: Wed Mar 14, 2007 2:27 am    Post subject: Reply with quote

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
View user's profile Send private message
plq
n00b
n00b


Joined: 18 Sep 2006
Posts: 19

PostPosted: Wed Mar 14, 2007 12:14 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum