LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-29-2008, 10:31 AM   #1
ItsCurly
LQ Newbie
 
Registered: Mar 2006
Posts: 5

Rep: Reputation: 0
Can download mail through fetchmail but where does it go?


Hi,
I have started tinkering around with mail on a hosted linux (think its red hat enterprise) account. I have root access to everything except modifying the kernel.

Having configured fetchmail it seems to be working ok, it says its downloaded messages, but I am not sure where its likely to have put them, or if there is a setting in fetchmail where it tells it where to put my mail. I have checked /var/spool/mail and /var/mail as well as /home/user1/mail and /home/user1/Mail too.

Another question, I have installed mutt also, and it seems to want to access /var/spool/mail/root even though I am not using the root account. I have added /var/spool/mail/root but of course mutt is showing no messages.

I know I can edit the muttrc file but I don't know what to put there, because I don't know for sure where my mail is being downloaded. Ideally I would like it in my home directory somewhere.

Hope you can help,
Curly
 
Old 01-29-2008, 10:51 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974
fetchmail doesn't deliver mail, only fetch it. once it's pulled back to the local machine, it's sent through the sendmail command, and whatever is providing that tool (obviously assumed to be sendmail, but all MTA's, postfix, qmail etc... will provide the same program name for reasons like this one)
 
Old 01-29-2008, 10:54 AM   #3
dive
Senior Member
 
Registered: Aug 2003
Location: UK
Distribution: Slackware
Posts: 3,232

Rep: Reputation: 299Reputation: 299Reputation: 299
You might also have procmail running, in which case you need to look in ~/.procmailrc or make one if not there.
 
Old 01-30-2008, 03:50 AM   #4
ItsCurly
LQ Newbie
 
Registered: Mar 2006
Posts: 5

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by acid_kewpie View Post
fetchmail doesn't deliver mail, only fetch it. once it's pulled back to the local machine, it's sent through the sendmail command, and whatever is providing that tool (obviously assumed to be sendmail, but all MTA's, postfix, qmail etc... will provide the same program name for reasons like this one)
OK, I think I understand that, I was following a tutorial from lifehacker which didn't exactly make it clear. Before I get too into it, its probably better explaining what I want to do, maybe there's a far easier way to achieve this.

All I want to do is to be able to download my POP3 mail, and view it in something like mutt. I have two mail accounts, both POP3, nothing in the domain or anything like that, and I do not need to run a mail server. I have an smtp server available to for outgoing mail. Do I need to go the Postfix / Sendmail route, as it seems a bit over the top for what I am trying to do?
 
Old 01-30-2008, 06:52 AM   #5
dive
Senior Member
 
Registered: Aug 2003
Location: UK
Distribution: Slackware
Posts: 3,232

Rep: Reputation: 299Reputation: 299Reputation: 299
Try procmail.
 
Old 01-30-2008, 08:24 AM   #6
ItsCurly
LQ Newbie
 
Registered: Mar 2006
Posts: 5

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by dive View Post
Try procmail.
Short but sweet (and all I needed to know) response! Procmail seems to be working ok as an MDA as long as fetchmail is told to use procmail. I specified a directory, mail is being received. Set .muttrc to check that folder for messages.

One slight problem, and one question, if I may.

Mutt still tries to load /var/spool/mail/root when opened. I can then change to the folder I want by pressing 'C' to change to the correct folder which then displays my messages just fine. How can I get mutt to open the correct folder when I open it rather than me switching from /var/spool/mail/root all the time?

Not too familiar with cron jobs, I have one to run fetchmail but I need to edit it to instead run fetchmail with procmail (fetchmail -m "/usr/bin/procmail -d %T".) How would I do this?

Thanks for your patience.
 
Old 01-30-2008, 08:41 AM   #7
dive
Senior Member
 
Registered: Aug 2003
Location: UK
Distribution: Slackware
Posts: 3,232

Rep: Reputation: 299Reputation: 299Reputation: 299
1) Invoke mutt using the -f option to make it go straight to a folder. You can even make an alias:

alias mutt='mutt -f ~/mail/dave'

2a) Instead of setting up cron, you can set fetchmail to poll for new mail every so many seconds. In .fetchmailrc:

set daemon 300

Polls every 5 minutes.

2b) You don't need to tell fetchmail to use procmail. It should do so automatically.

I recommend reading through:
man mutt
man fetchmail
man procmail
man procmailrc

I would also recommend installing spamassassin as it works very well with procmail.

Last edited by dive; 01-30-2008 at 08:47 AM.
 
Old 02-26-2008, 06:09 PM   #8
andrew.46
Member
 
Registered: Oct 2007
Distribution: Slackware
Posts: 795

Rep: Reputation: 158Reputation: 158
Hi,

Sounds like you are almost there:

Quote:
Originally Posted by ItsCurly View Post
Having configured fetchmail it seems to be working ok, it says its downloaded messages, but I am not sure where its likely to have put them, or if there is a setting in fetchmail where it tells it where to put my mail. I have checked /var/spool/mail and /var/mail as well as /home/user1/mail and /home/user1/Mail too.
If you use procmail, and this is a great option, you should have the following in your ~/.fetchmailrc:

Code:
mda "/usr/bin/procmail -d %T"
And of course check the path to your own procmail.

Quote:
Another question, I have installed mutt also, and it seems to want to access /var/spool/mail/root even though I am not using the root account. I have added /var/spool/mail/root but of course mutt is showing no messages.
It will only try to access this folder if told to do so :-) There are several ways to set your default mailbox. To see what is currently set run the following:

Code:
$ echo $MAIL
If you need to alter it you can add it to ~/.bashrc as:
Code:
MAIL=/var/spool/mail/username && export MAIL
or set it in your ~/.muttrc as:

Code:
set spoolfile = /var/spool/mail/username
This is arguably the best place to deliver the mail.

Quote:
I know I can edit the muttrc file but I don't know what to put there, because I don't know for sure where my mail is being downloaded. Ideally I would like it in my home directory somewhere.
My usual practice is to have the mail delivered to /var/spool/mail/username but have procmail sort messages to $HOME/mail. This can be done by adding the following to ~/.procmailrc:

Code:
DEFAULT=/var/spool/mail/username               
MAILDIR=$HOME/mail
Perhaps you would benefit from reading through a page that deals with most of this, but with a gmail angle:

http://www.andrews-corner.org/mutt.html

All the very best,

Andrew
 
  


Reply

Tags
fetchmail


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Fetchmail hangs getting mail Gnarg Linux - Software 4 04-03-2006 07:51 AM
Fetchmail and mail forwarding mikz Linux - General 1 03-12-2005 11:37 AM
Q-Mail fetchmail Authfail emailssent Linux - Networking 0 01-13-2005 08:36 PM
Fetchmail flushing mail unclejessie77 Linux - Software 3 11-04-2003 12:53 PM
e-mail place/fetchmail NSKL Linux - General 13 11-26-2002 06:25 PM


All times are GMT -5. The time now is 02:34 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration