Category Archives: Fun

Emails: the way I like it

Sharing my setup of text-based mail client for “efficient” emailing.

It consists of following 3 pieces

fetchmail – fetches incoming messages from SMTP/POP server
procmail – filters messages
msmtp – sends messages
mutt – mail client to view messages

~/fetchmailrc :

set logfile /tmp/fetchmail.log
poll protocol IMAP timeout 60
user "username"
pass "********"
fetchall ssl nokeep norewrite sslcertck sslcertpath /etc/ssl/certs
mda "/usr/local/bin/procmail -f %F -d %T";

~/procmailrc :

#Set on when debugging

#The directory where your mail folders will be stored.

# The log of procmail actions

#filtering rules
# any email sent to [email protected] will be stored in ~/mail/.hiren/ dir.

# similarly, you can have multiple rule...

# Catch-all rule for all unmatched email

For some weird reason procmail wanted me to name the dirs under ~/mail/ starting with a dot i.e. “.”

You can have your mail stored in mbox or maildir format. I like mailbox format as its more flexible. I am not going into details about that.
Please ask “the Internet” for the difference and detailed understanding.

I am using msmtp for sending emails.


logfile ~/.msmtp.log

account yourmail
from [email protected]
#auth on
user [email protected]
password *********

account default : yourmail

mutt related settings:

mutt is a very very powerful and customizable tool. I am listing only a few very basic setup settings for muttrc below:

set mbox_type=Maildir
set spoolfile="~/mail/"
set folder="~/mail/"
set mask="!^\\.[^.]"
set postponed="+.Drafts"
set imap_user=username

# The capcability settings
set mailcap_path=~/.mutt/mailcap

# Settings
source ~/.mutt/settings

# Mailbox definitions
source ~/.mutt/mailboxes-local

~/.mutt/settings is another very important file for basic settings:

set hostname=""
set tmpdir="~/.tmp"
set sort=threads
set sort_aux=last-date-received # showing threads with youngest message last
set sort_browser="reverse-date" # showing mbox list default to newest first
set reverse_alias # If there is an alias ... show that.
set quote_regexp="^([ \t]*[|>:%}#])+" # This is default.
set editor = "vim -u ~/.mutt/vimrc"
set abort_nosubject=yes # cancel messages w/o subject: line
set envelope_from=yes
mime_lookup application/octet-stream
alternative_order text/plain text/enriched text/html

set sendmail="/usr/local/bin/msmtp"
set hidden_host # mutt will skip the host name part of $hostname
set bounce_delivered # Postfix users may wish to unset this variable.
set abort_nosubject=no # don't abort compos. when no subj. is set
set quit=yes # just quit please, kthx
set postpone=ask-no
set delete=yes # delete messages marked for deletion w/o confirmation
set mark_old=no # don't change status of new messages to old
set move=no # don't move read messages

# IMAP settings
unset imap_passive
set imap_keepalive=300

# folder format
set folder_format="%2C %t %N %d %f"

~/.mutt/mailbox-local lists your dirs/folders setup for message filtering:

set folder="~/mail/"
set record="~/mail/.hiren"
mailboxes \
= \
=.hiren \
=.kernel \
=.freebsd \
=.random # note: the last line does not end with backslash

Disclaimer: I’ve just shown basic settings here. Let me know if you are looking for any specific info.

Sometimes everything changes…

I have been wanting to write for aeons but I just couldn’t find the time, sometimes
everything in your life changes, and I have never expected that it could happen to
me. Few months ago I wrote a post that I received a job offer in Kuala Lumpur.
I was very happy with the offer and I’m giving my best shot at it, but there were
times when things just didn’t work the way I wanted. Fortunately I am surrounded with
people who have always tried their best in supporting me and keeping everything
in place. I hope everything will be fine.

I have also found a new luck of my life. Erms.. I guess I should call her THE luck of
my life hihi. At the moment I am preparing everything so that I can stay with her :-) .
So far all is good and I’m very happy here. Looking forward to a bright future ahead.