View Single Post
  #1   (View Single Post)  
Old 17th May 2011
qmemo's Avatar
qmemo qmemo is offline
Real Name: He
Package Pilot
 
Join Date: Jul 2008
Location: The big B
Posts: 141
Post small guide on mutt & fdm

~/.fdm.conf

Code:
## .fdm.conf
## Accounts and rules for:
#> mail1
#> mail2
## Last edit 05-16-2011

# Catch-all action (mbox):  //if you use something other than mutt
# action "inbox" mbox "%h/mail/INBOX"  
# Catch-all action (maildir):
# mutt prefers capital letters for folder names
 action "mail1-deliver" maildir "%h/Mail/Mail1"
 action "mail2-deliver" maildir "%h/Mail/Mail2"
 
account "mail2" imaps server "imap.someserver.com"
        user "mail1" pass "secret"

account "mail2" imaps server "imap.someserver.com"
        user "mail2" pass "secret"

# Match all mail and deliver using the 'inbox' action.
match account "mail1" action "mail1-deliver"
match account "mail2" action "mail2-deliver"
match all action "inbox"
one line to create them all

Code:
chmod ~/.fdm.conf 600; mkdir -p Mail/Mail1/INBOX/{new,cur,tmp}; mkdir -p Mail/Mail2/INBOX/{new,cur,tmp}; chmod -R 700 ~/Mail/*
now you can test using fdm -kv fetch, if it's working as it should; then add that action to your crontap

Code:
$ crontab -e
*/15 * * * * fdm fetch >> ~/Mail/fdm.log
I relayed heavily on this guide


And now for mutt, my setup is two accounts

~/.muttrc

Code:
 ## my default identity   //this will be your default
set realname = "User 1"
set from = "mail1"
set hostname = `hostname`
set header_cache =~/.mutt/cache/headers
set message_cachedir =~/.mutt/cache/bodies
set certificate_file =~/.mutt/certificates

set spoolfile = "$HOME/Mail/Mail1/"
set postponed ="$HOME/Mail/Mail1/postponed"
set record = "$HOME/Mail/Mail1/sent"

set smtp_url= smtp://mail1@smtp.someserver.com:587/
set smtp_pass = "secret"

save-hook . =mail1.`date +%Y`

## when I change into my work folder, become my work ident.
## when I leave it, become my home ident
## I add this to give hints if you have more than one account,
##if more use the '.' to make one of the folder-hooks the default
#folder-hook . 'source ~/.mutt/ident-mail1'  
folder-hook Mail2 'source ~/.mutt/ident-mail2'

# This is the key bindings I use to switch between accounts
bind editor <space> noop
macro index ga "<change-folder>=Mail2<enter>" "Go to M2 inbox"
macro index gs "<change-folder>=Mail1<enter>" "Go to Mail1 inbox"

# Header stuff
ignore "Authentication-Results:"
ignore "DomainKey-Signature:"
ignore "DKIM-Signature:"
hdr_order Date From To Cc

ignore *
unignore from: date subject to cc
unignore x-mailing-list: posted-to:
unignore x-mailer:

# For better looks
set markers=no # don't put '+' at the beginning of wrapped lines
set pager_index_lines= 5 # how large is the index window?
set sort = 'threads'
set sort_aux = 'last-date-received'

# My Editor
set editor='vim + -c "set textwidth=72" -c "set wrap" -c "set nocp" -c "?^$"'
~/.mutt/ident-mail2

Code:
## my identity
set realname = "mail2"
set from = "mail2@somemail.com"
set hostname = `hostname`
set header_cache =~/.mutt/cache/headers
set message_cachedir =~/.mutt/cache/bodies
set certificate_file =~/.mutt/certificates

set spoolfile = "$HOME/Mail/Mail2/"
set postponed ="$HOME/Mail/Mail2"
set record = "$HOME/Mail/Mail2/sent"

set smtp_url= smtp://mail2@smtp.someserver.com:587/
set smtp_pass = "secret"

save-hook . =mail2.`date +%Y`
final step

Code:
mkdir -p .mutt/cache; chmod .muttrc 700
fire up mutt and enjoy

references:
https://wiki.archlinux.org/index.php/Fdm
http://crunchbanglinux.org/wiki/howt...ith_gmail_imap
*BOUNC*
http://www.muttrcbuilder.org/

Last edited by qmemo; 18th May 2011 at 12:23 AM.
Reply With Quote