bmk1st
January 27th, 2005, 10:27
Hello,

I want to use cli email client and I have decided to try mutt. Now, I can send email using mutt with msmtp but I cannot recieve any. I got fetchmail to work successfully but I do not know if procmail actually worked or mutt cannot get anything from procmail.

Here's my 2 config files from mutt and procmail. Notice: I used -k for fetchmail because I don't want to lose any email if I mess up with mutt. I'll remove it when I'm more comfortable using mutt. ;)

procmailrc:


MAILDIR=$HOME/MuttMail ##you better make sure it exists
LOGFILE=$HOME/.procmaillog
LOGABSTRACT=no
#VERBOSE=on...is only used for debugging
VERBOSE=off
FORMAIL=/usr/pkg/bin/formail
NL="
"
##recipe lines begin with :0
##dont put comments on recipe lines
##disable a recipe with the false condition !
##condition lines begin with * and regex is your friend
##conditions are anded and everything after * is fed straight into egrep
##one action line follows the conditions, in this case it is a mailbox name

#catch duplicates using formail
:0 Whc: .msgid.lock
| $FORMAIL -D 16384 .msgid.cache

:0 a
$MAILDIR/duplicates

#now flush some spam out
:0
* ^Subject:.*(credit|cash|money|debt|sex|sale|loan)
$MAILDIR/spam

#no more html messages
:0
* ^Content-Type:.*html
$MAILDIR/junk

#now put my mail lists into mailboxes
:0
* ^(From|Cc|To).netbsd-users@netbsd.org
netbsd-users

:0
* ^(From|Cc|To).netbsd-help@netbsd.org
netbsd-help

:0
* ^(From|Cc|To).netbsd-announce@netbsd.org
netbsd-announce

:0
* ^(From|Cc|To).netbsd-news@netbsd.org
netbsd-news


################################
# Last rule: mail that gets #
# this far goes in default box #
################################
:0
* .*
default

# End of file

muttrc:

set pager_context=1
set pager_index_lines=6 #show a mini-index in pager
set menu_scroll
set pgp_verify_sig=no #dont show pgp in pager
set status_on_top #put status line at top
set sort=threads #sort by message threads in index

set status_format=" %r %b %f %n Del %d Msgs %m %l %> (%P)"
set pager_format="%-10.10i %[!%a %b %d %R]"
set date_format="!%H:%M %a %d %b "
set index_format="%4C %Z %[%b%d] %-15.15F %s"
set folder_format="%2C %t %8s %d %N %f"

#set sendmail="/usr/bin/nbsmtp -d isp.net -h smtp.isp.net -f yourname@isp.net"
set sendmail="/usr/pkg/bin/msmtp"

#set from="default-mailaddress" #set to your from address
#set realname="myname"
set use_from=no
my_hdr From: "Joe Doe" <Joe@Doe.net>

set record="$HOME/MuttMail/sent" #sent mail is saved here
set delete=yes #delete without prompting
set include=yes #quote msg in reply
set fast_reply=yes #no prompting on reply
set beep=no #no noise
set markers=no #no + on wrapped lines
set confirmappend=no #no prompt for save to =keep
set to_chars=" +TCF" #no L for mail_list

set folder = $HOME/MuttMail
#mailboxes =/var/mail/brad
mailboxes =netbsd-users
mailboxes =netbsd-help
mailboxes =netbsd-announce
mailboxes =netbsd-news
mailboxes =netbsd
mailboxes =default
mailboxes /home/brad/MuttMail/sent
mailboxes =friends
mailboxes =junk
mailboxes =spam
mailboxes =keep

save-hook .* =keep #default mbox to (s)ave mail is =keep
subscribe netbsd-users
subscribe netbsd-help
subscribe netbsd-announce
subscribe netbsd-news #subscribed to these lists

bind pager h display-toggle-weed #toggle headers with h key

# simulate the old url menu
macro index \cb |urlview\n 'call urlview to extract URLs out of a message'
macro pager \cb |urlview\n 'call urlview to extract URLs out of a message'

#run fetchmail by hitting key of G
macro index G "!fetchmail -ak -m '/usr/pkg/bin/procmail -d %T'\r"
macro pager G "!fetchmail -ak -m '/usr/pkg/bin/procmail -d %T'\r"

#use to edit .muttrc and then source it...no restart necessary
macro generic ,sm ":source $HOME/.muttrc\r"
macro generic \cj "!rxvt -bg wheat -e joe $HOME/.muttrc\r"

# default list of header fields to weed out when displaying mail
#ignore them all and then unignore what you want to see
ignore *
unignore Date To From: Subject X-Mailer Organization User-Agent
hdr_order Date From To Subject X-Mailer User-Agent Organization

##your Mutt has to have some colors
##these are for four levels of quoted text
##they override the system settings in /etc/mutt/Muttrc

#color quoted green default
color quoted1 magenta blue
#color quoted2 yellow default
#color quoted3 red default
#color signature cyan cyan


#this color setup is copied from /etc/mutt/Muttrc.color
#comment it out if you want the default colors in /etc/mutt/Muttrc
# Je vois la vie en rose :-)
color hdrdefault brightcyan blue
color header brightwhite blue "^from:"
color header brightwhite blue "^subject:"

color quoted brightgreen blue
color signature brightwhite blue

color indicator blue green

color error red black
mono error bold
color status black cyan
mono status bold
color tree yellow blue

color tilde brightmagenta blue
color body brightwhite blue "[-a-z_0-9.]+@[-a-z_0-9.]+"
mono body bold "[-a-z_0-9.]+@[-a-z_0-9.]+"
color body brightyellow black "^Good signature"
mono body bold "^Good signature"
color body brightwhite red "^Bad signature from.*"
mono body bold "^Bad signature from.*"
color normal white blue
color message green black
color attachment brightgreen blue


Is procmail or mutt supposed to create mailboxes for netbsd stuff or am I supposed to do that? (create files or directories in MuttMail directory?)