nsbin/add-mutt+procmail-autosort01
Nico Schottelius d3c6e29902 Initial commit
2006-07-20 09:54:37 +02:00

42 lines
891 B
Bash
Executable file

#!/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}