sudo apt-get install mutt fetchmail ssmtp
set postmaster ‘myusername’
set no bouncemail
with protocol pop3
username users password psswd1 keep is myusername;
with protocol pop3
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 mail.domain.com
# Where will the mail seem to come from?
# The full hostname
set from=” <email@example.com>”
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 mail.tpg.com.au 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: AuthInfo:relay.dnsexit.com "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/sendmail.mc (check if apropriate settings doesn't already exists): define(`SMART_HOST', `relay.dnsexit.com') FEATURE(`access_db') 3. Update sendmail.cf and access.db files: # cd /etc/mail # m4 sendmail.mc >sendmail.cf # 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.