How to configure mutt + esmtp + fetchmail

Sometimes I prefer shell Internet to GUI one. This is because I want to SSH into the box, run something like "Send/Receive" to get my mail. Then I want to have some kind of Mail client for myself. Finally, i need an ability to reply or write e-mails to my friends, which is usually accomplished my Mail Transfer Agent (MTA).

All of the configuration files should be in your home folder, meaning "cd ~".

NOTE:

If you have several mail providers and you composing your e-mail, then there is one thing to note:

"From" field will be default to your username or to the configured in .muttrc file.

To fix this issue:

Press "ESC", then press "f", then type e-mail you want to send from.

If you configure in .muttrc this option:

my_hdr From: micheal.hukle@linux.com (Michael Hukle)

Then esmtp will take linux.com SMTP server to deliver your message. (identity micheal.hukle@linux.com)

Fetchmail Installation and Configuration

[huklemic@reader ~]$ yum info fetchmail
Installed Packages
Name : fetchmail
Arch : i386
Version: 6.3.8
Release: 3.fc8
Size : 1.3 M
Repo : installed
Summary:
A remote mail retrieval and forwarding utility
Description:
Fetchmail is a remote mail retrieval and forwarding utility intendedfor use over on-demand TCP/IP links, like SLIP or PPP connections.Fetchmail supports every remote-mail protocol currently in use on theInternet (POP2, POP3, RPOP, APOP, KPOP, all IMAPs, ESMTP ETRN, IPv6,and IPSEC) for retrieval. Then Fetchmail forwards the mail throughSMTP so you can read it through your favorite mail client. Install fetchmail if you need to retrieve mail over SLIP or PPPconnections.


To install it:

yum install fetchmail

Configuration file:

# .fetchmailrc
# Linux.com Mail
poll pop.linux.com
proto pop3
user "micheal.hukle@linux.com" is huklemic
password "yo2tN8ed"
keep
# Google Mail
poll pop.gmail.com
proto pop3
user "micheal.hukle@gmail.com" is huklemic
password "yo2tN8ed"
keep
;

 

Mutt Installation and configuration

[huklemic@reader ~]$ yum info mutt
Installed Packages
Name : mutt
Arch : i386
Epoch : 5
Version: 1.5.17
Release: 2.fc8
Size : 4.0 M
Repo : installed
Summary:
A text mode mail user agent
Description:
Mutt is a small but very powerful text-based MIME mail client. Muttis highly configurable, and is well suited to the mail power user withadvanced features like key bindings, keyboard macros, mail threading,regular expression searches and a powerful pattern matching languagefor selecting groups of messages.


To install it:

yum install mutt

Configuration file is: .muttrc

#my .muttrc
set arrow_cursor
set attribution="On %d, %n wrote:"
set charset=koi8-r
set allow_8bitset copy=yes
set delete=yes
#set edit_headers
set editor="nano"
set envelope_from=yes
set helpset includeset mail_check=5
set mbox=+mbox
set pager_index_lines=6
set record=+outbox
set reply_to
set reverse_name
set nosave_empty
# I use ESMTP for my MTA
set sendmail="/usr/bin/esmtp -v -X /tmp/esmtp.log"set sort=threadsset
#Spool directory
sort_browser=reverse-date
set spoolfile='/var/spool/mail/huklemic'
set tildeset nouse_domain
set pgp_verify_sig=no
set visual=nano
unhdr_order *hdr_order date from subject to cc
# Here I set my e-mail header
my_hdr From: micheal.hukle@linux.com (Michael Hukle)

ESMTP Installation and Configuration

MTA - something that will deliver your mail that you created with MUTT.

[huklemic@reader ~]$ yum info esmtp
Installed Packages
Name : esmtp
Arch : i386
Version: 0.6.0
Release: 1.fc8
Size : 82 k
Repo : installed
Summary:
User configurable relay-only Mail Transfer Agent (MTA)
Description:
ESMTP is a user configurable relay-only Mail Transfer Agent (MTA) with a
sendmail-compatible syntax. It's based on libESMTP supporting the AUTH
(including the CRAM-MD5 and NTLM SASL mechanisms) and the StartTLS SMTP
extensions.


To install this package:

yum install esmtp

Configuration file:

# my .esmtprc
identity micheal.hukle@linux.com
hostname smtp.linux.com:25
username "micheal.hukle@linux.com"
password "yo2tN8ed"
default

identity micheal.hukle@linux.com
hostname smtp.gmail.com:25
username "micheal.hukle@gmail.com"
password "yo2tN8ed"

 

Moving your apps to Amazon or Miscrosoft Clouds?

We can help you analyze your existing infrastructure, identify the cost savings we can achieve by migrating to a cloud provider. We can then execute end-to-end migration plan of your infrastructure and bringing down your TCO.

Cloud Computing

Ready for IPv6 Migration?

The Internet is running out of the equivalent of phone numbers - familiar problem, non-trivial solution.

The world has to move to IPv6, with its 128-bit addresses. But that's easier said than done.

IPv6 Migration

Are you fluent in "Linux"?

Learn Linux from a leading expert and quickly master you Linux skills.

Learn how to simplify your workflow and increase your productivity using tips and techniques of the pros.

Ideal training for Corporate IT Beginners and Advanced IT Admins alike.

Corporate Linux Training

Who's Online

We have 9 guests and no members online