Mail in ubuntu


sudo apt-get install mutt fetchmail ssmtp


fetchmail ~/.fetchmail

set postmaster ‘myusername’
set no bouncemail

with protocol pop3
username users  password psswd1 keep is myusername;

with protocol pop3
port 995
username gmailuser password gmailpasswd keep is myusername

ssmtp  sudo vi /etc/ssmtp/ssmtp.conf


# The place where the mail goes. The actual machine name is required no
# MX records are consulted. Commonly mailhosts are named

# Where will the mail seem to come from?

# The full hostname

mutt ~/.muttrc

auto_view text/html
set from=” <>”
set editor=/usr/bin/vi

set sendmail=”/usr/sbin/ssmtp “
set mail_check=60 # check for new mail every 60 seconds
set timeout=15   # after 15 secs of no keypresses, start checking for new mail

Use SSMTP with gmail

We need to then need to edit, ‘/etc/ssmtp/ssmtp.conf’:

Then add each account that you want to be able to send mail from by editing, ‘/etc/ssmtp/revaliases‘:

Test my ISP mailer

telnet 25



Read and send mails

to get mail fetchmail

to read mail mutt

sendmail via ssmtp

Note, although ssmtp is used to substitute for sendmail to deliver mail to outside, ‘sendmail’ is still needed for fetchmail to deliver mail to local mailserver.

Fix: fetchmail without sendmail

fetchmail -m ‘/usr/bin/procmail -d %T’

Use the native sendmail

 1. Set your authorization informations by adding following line to /etc/mail/access file: "U:USERNAME" "P:PASSWORD" "M:PLAIN"
   Note: Replace USERNAME and PASSWORD with the DNSEXIT mail relay username and PASSWORD.

 2. Add following lines to /etc/mail/ (check if apropriate settings doesn't already exists):

define(`SMART_HOST', `')

3. Update and access.db files:   

# cd /etc/mail
# m4 >
# makemap hash access <access 

4. Reload or restart sendmail: 
# /etc/init.d/sendmail restart

5. mark all mails read
Create a macro.
macro index M "T.*\n;WN" "Mark all messages as read"

This will make an “M” keystroke mark all messages in the current folder (in the index view) as read.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s