Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Simple MUTT setup (pop3)
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
killfire
l33t
l33t


Joined: 04 Oct 2003
Posts: 618

PostPosted: Mon Aug 30, 2004 9:21 pm    Post subject: Simple MUTT setup (pop3) Reply with quote

Simple MUTT setup

This is my first HOWTO, and I would not have written it if I did not have so much trouble figuring out a relatively simple thing. Excuse me if anything is unclear or it does not work. What I describe works for me.

Tools:
(in parenths are my versions, but anything close should work)

    Mutt (1.5.6-r3)
    sSMTP (2.60.9)
    Fetchmail (6.2.5)
    Procmail (3.22-r6)


Result:
System for retreiving mail off a pop3 server, and sending mail using an external smtp server.

Basic Steps:
1. Install necesary components
2a. Configure Mutt
2b. Configure sSMTP
2c. Configure Fetchmail
2d. Configure Procmail
3. Start Fetchmail
4. Setting up Automation

1. Installing The Necesary Compnents:
emerge fetchmail, ssmtp, procmail, and mutt
Code:
emerge fetchmail ssmtp procmail mutt -p
emerge fetchmail ssmtp procmail mutt


2a. Configure Mutt:

Open up ~/.muttrc with your favorite editor (or create it if it does not exist), I use vim in this example:
Code:

vim ~/.muttrc


Change existing lines or create new lines so that your .muttrc looks similar to the following:
Note: Make sure to replace USER@HOST.FOO with your email email address from which you wish the emails that you send to be from.

Code:

reset realname
set from="USER@HOST.FOO"
set mbox=~/mail/Inbox
set spoolfile=~/mail/Inbox

set index_format="%4C %Z %{%b %d} %-16.16L %s"


Save and quit. (:wq in vim)

And make sure, if you dont already have it, to create ~/mail, a simple
Code:
mkdir ~/mail will
do

2b. Configure sSMTP:

Make sure you are root, and then open up /etc/ssmtp/ssmtp.conf.
Code:

su
Password: **hidden**
vim /etc/ssmtp/ssmtp.conf

Change existing options or create new ones so that your file looks like this (comments of course are not written here):
Note:
    remember to change MAIL.HOST.FOO to your outgoing mail server. sometimes this is smtp.yourserver.com or mail.yourserver.com.
    change HOST.FOO to what you would like to have the mail to be coming from, usually the end of the same domain.
    changeing HOSTNAME is not completely necesary, but you can change it to your computers hostname.
    change USER with your username

Code:

USER=postmaster

mailhub=MAIL.HOST.FOO

rewriteDomain=HOST.FOO

hostname=_HOSTNAME_

FromLineOverride=YES


2c. Configure Fetchmail:

Open up or create ~/.fetchmailrc:
Code:

vim ~/.fetchmailrc


Change the existing lines or create new lines until your file looks like this:
Note: Change USER with your username

Change MAIL.HOST.FOO with your incoming mail server. (could be mail.yourhost.com, pop3.yourhost.com...)

Change USERNAME to your login on your mail server (probably the part of your email address before the @) and PASSWORD with your password on the mailserver. Change USERNAME@HOST.FOO with your full email address.

I have this set so that it checks email every 3 minutes (180 seconds, modify the fourth line accordingly if you want a different timing)

Code:

set logfile "/home/USER/mail/fetchlog"
set postmaster "USER"
set bouncemail
set daemon 180
poll MAIL.HOST.FOO with proto POP3
     user "USERNAME" there with password "PASSWORD" is \ USERNAME@HOST.FOO here
     options warnings 3600
     mda '/usr/bin/procmail -f fetchmail'
                    antispam 571 550 501 554


When your finished, save and quite (:wq in vim) and change the persmissions of .fetchmailrc to 0710(-rwx--x---).
Code:

chmod 0710 ~/.fetchmailrc


2d. Configure Procmail:

Open or create ~/.procmailrc:
Code:

vim ~/.procmailrc


Change existing lines or create new ones so that the non-commented lines look like the following:
Code:

PATH=/bin:/usr/bin
MAILDIR=$HOME/mail
LOGFILE=$MAILDIR/procmaillog

:0:
Inbox


3. Start Fetchmail and Open Mutt:

start fetchmail by calling it, first with the options -kv, instructing it to be verbose and to leave copies of the messages on the server. Afterward, when you've confirmed that it works, you can switch over to just calling it without any options.
Code:

fetchmail -kv


4. Setting up Automation:
if you have internet that is always on, add fetchmail to your start up scripts by either:
Code:

echo "fetchmail" >> /etc/conf.d/local.start

(Note: you could set the timing in /etc/conf.d/fetchmail and then use /etc/init.d/fetchmail start, but this way is simpler and more cross platform)
if you have on demand internet (dialup), then open up /etc/conf.d/net.ppp0 and make sure AUTOCFGFILES is set to ="no" and then edit /etc/ppp/ip-up to add fetchmail to it:
Code:

echo fetchmail >> /etc/ppp/ip-up


Now open up Mutt and have fun!

Hope this works well as a newbie-guide/quickstart guide to switching from an envioronment like an Outlook clone to mutt.


-killfire
_________________
my website, built in HAppS: http://dbpatterson.com
an art (oil painting) website I built a pure python backend for: http://www.lydiajohnston.com


Last edited by killfire on Wed Sep 01, 2004 1:11 am; edited 3 times in total
Back to top
View user's profile Send private message
tln
Veteran
Veteran


Joined: 24 Sep 2003
Posts: 1501

PostPosted: Mon Aug 30, 2004 11:52 pm    Post subject: Reply with quote

Have you read this guide?
Back to top
View user's profile Send private message
killfire
l33t
l33t


Joined: 04 Oct 2003
Posts: 618

PostPosted: Tue Aug 31, 2004 1:12 am    Post subject: Reply with quote

tln wrote:
Have you read this guide?


OMFG.

You've got to be joking. I would have loved to have found that yesterday.

What I can't believe is that all my searches of both the forums and google did not yield that. I tried mutt procmail fetchmail.... and im pretty sure i even checked the second pages. and searches of these forums (for mutt, procmail, fetchmail etc...) did not yeild any mentio of that guide either.

well, if nothing else, this can serve as a big sign for gentoo's guide.

killfire
_________________
my website, built in HAppS: http://dbpatterson.com
an art (oil painting) website I built a pure python backend for: http://www.lydiajohnston.com
Back to top
View user's profile Send private message
tln
Veteran
Veteran


Joined: 24 Sep 2003
Posts: 1501

PostPosted: Tue Aug 31, 2004 1:25 am    Post subject: Reply with quote

Try googling "gentoo mutt guide" with I'm feeling lucky :wink:
Back to top
View user's profile Send private message
killfire
l33t
l33t


Joined: 04 Oct 2003
Posts: 618

PostPosted: Tue Aug 31, 2004 1:40 am    Post subject: Reply with quote

tln wrote:
Try googling "gentoo mutt guide" with I'm feeling lucky :wink:


oh, it came up as soon as i included gentoo in my search.... i just didnt think to do that ... :oops:
_________________
my website, built in HAppS: http://dbpatterson.com
an art (oil painting) website I built a pure python backend for: http://www.lydiajohnston.com
Back to top
View user's profile Send private message
magnesium
Apprentice
Apprentice


Joined: 28 Oct 2003
Posts: 280
Location: Toronto, Canada

PostPosted: Tue Aug 31, 2004 8:14 pm    Post subject: Re: Simple MUTT setup (pop3) Reply with quote

I was trying to follow these instructions and really could not get what was said here to work. I fiddled around a lot and wasted a lot of time getting it to work, and from what I can remember, these are the changes that need to be made.

killfire wrote:
Code:

vim ~/.muttrc


Change existing lines or create new lines so that your .muttrc looks similar to the following:
Note: Make sure to replace USER@HOST.FOO with your email email address from which you wish the emails that you send to be from.

Code:

reset realname
set from="USER@HOST.FOO"
set mbox=~/mail/Inbox
set spoolfile=~/mail/Inbox

set index_format="%4C %Z %{%b %d} %-16.16L %s"

What is missing from this is
Code:
set sendmail="/usr/sbin/ssmtp -f USER@HOST.FOO"


killfire wrote:

Make sure you are root, and then open up /etc/ssmtp/ssmtp.conf.
<SNIP>
Code:

USER=postmaster

mailhub=MAIL.HOST.FOO

rewriteDomain=HOST.FOO

hostname=_HOSTNAME_


You're missing a line that allows the "from" address to get sent properly
Code:
FromLineOverride=YES


killfire wrote:

2c. Configure Fetchmail:

Open up or create ~/.fetchmailrc:
Code:

vim ~/.fetchmailrc

<large snip>
When your finished, save and quite (:wq in vim) and change the persmissions of .fetchmailrc to 0710(-rwx--x---).
Code:

chmod 0710 ~/.fetchmailrc


You do NOT want this file to be executable. the permissions you want are
Code:

chmod 0600 ~/.fetchmailrc


killfire wrote:

start fetchmail by calling it by itself:
Code:

fetchmail


you should not start fetchmail this way to test your setup. you should start fetchmail at the very least by leaving the messages on the server. My suggestion is
Code:
fetchmail -kv


Good info on how to set up folders are available in the afore mentioned handbook http://www.gentoo.org/doc/en/guide-to-mutt.xml
Back to top
View user's profile Send private message
killfire
l33t
l33t


Joined: 04 Oct 2003
Posts: 618

PostPosted: Wed Sep 01, 2004 1:08 am    Post subject: Re: Simple MUTT setup (pop3) Reply with quote

magnesium wrote:


What is missing from this is
Code:
set sendmail="/usr/sbin/ssmtp -f USER@HOST.FOO"



maybe its something to do with my settup, but ssmtp did not require for me to do this. sorry if it did not work on yours.

magnesium wrote:

You're missing a line that allows the "from" address to get sent properly
Code:
FromLineOverride=YES


yes, that was completely my fault. for some reason, when i sent mail to myself, this problem did not present itself. later on last night, i found this out, and have since updated the guide. thanks for the feedback.
magnesium wrote:

You do NOT want this file to be executable. the permissions you want are
Code:

chmod 0600 ~/.fetchmailrc


this is a matter of preference. try running fetchmail with incorrect persmissions, and it will tell you that you need AT LEAST 0710 permissions. i used that because it seemed the most straighforward, as if someone messed up, fetchmail would tell them to correct it.

magnesium wrote:

you should not start fetchmail this way to test your setup. you should start fetchmail at the very least by leaving the messages on the server. My suggestion is
Code:
fetchmail -kv


good suggestion, will change that.
magnesium wrote:

Good info on how to set up folders are available in the afore mentioned handbook http://www.gentoo.org/doc/en/guide-to-mutt.xml

ive looked at that, but i didnt think, especially because it was mentioned in the thread already, that it warranted inclusion, especially because i made a specific point that this was a simple set up. just to get you started.

thanks again for the feedback,

killfire
_________________
my website, built in HAppS: http://dbpatterson.com
an art (oil painting) website I built a pure python backend for: http://www.lydiajohnston.com
Back to top
View user's profile Send private message
ares
Apprentice
Apprentice


Joined: 13 Oct 2003
Posts: 280
Location: Savigliano (CN)

PostPosted: Thu Sep 02, 2004 3:42 pm    Post subject: Reply with quote

Use mutt with qmail for send email

Code:

set sendmail = /var/qmail/bin/qmail-inject


I use fetchmail with macro
Code:

macro index E "!fetchmail -a -m 'procmail -d ares'\r"
macro pager E "!fetchmail -a -m 'procmail -d ares'\r"

_________________
My portage and homepage
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks 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