nsbin/add-mutt+procmail-autosort01

43 lines
891 B
Text
Raw Normal View History

2006-07-20 07:54:37 +00:00
#!/bin/sh
#
# Nico Schottelius <nico@schottelius.(net|org)>
# Date: 22-Aug-2003
# Last Modified: 17-Jan-2004
# Now adding procmail entries at the beginning of the file
#
PROCMAILRC=~/.procmailrc
MUTT_MAILBOXES=~/.mutt/mailboxes
MUTT_HEADERS=~/.mutt/hooks
echo generating new mutt and new procmailentry
read -p "To Email: " email
read -p "To which folder: " folder
read -p "your name: " name
read -p "Email=$email, name=$name and folder=$folder. Enter to continue" bla
# procmail: insert at first line
cat << EOF >> $PROCMAILRC
### autogenerated by add-mutt+procmail-autosort
:0
* ^TO$email
$folder/
EOF
# mutt/checking
cat << EOF >> $MUTT_MAILBOXES
### for $email / $name
mailboxes +$folder/
EOF
# mutt/headers
cat << EOF >> $MUTT_HEADERS
folder-hook $folder 'my_hdr From: $name <$email>'
folder-hook $folder 'set from="$email"'
EOF
# folder
mkdir -p ~/Maildir/$folder/{new,cur,tmp}