Skip to content
Snippets Groups Projects
Commit df00b7e3 authored by Bob Mottram's avatar Bob Mottram
Browse files

Allow more than one rule per mailing list

parent 42ad5417
No related branches found
No related tags found
No related merge requests found
......@@ -82,9 +82,10 @@ esac
shift
done
if ! [[ $MYUSERNAME ]]; then
if [ ! $MYUSERNAME ]; then
show_help
fi
if [[ ! $MAILINGLIST && ! $SUBJECTTAG ]]; then
show_help
fi
......@@ -93,9 +94,8 @@ MUTTRC=/home/$MYUSERNAME/.muttrc
PM=/home/$MYUSERNAME/.procmailrc
LISTDIR=/home/$MYUSERNAME/Maildir/$MAILINGLIST
# Exit if the list was already added
if grep -q "=$MAILINGLIST" $MUTTRC; then
exit 54678
echo $"Mailing list $MAILINGLIST was already added"
fi
if [ ! -d "$LISTDIR" ]; then
......@@ -155,8 +155,10 @@ fi
MUTT_MAILBOXES=$(grep "mailboxes =" $MUTTRC)
if [[ $MUTT_MAILBOXES != *$MAILINGLIST* ]]; then
sed -i "s|$MUTT_MAILBOXES|$MUTT_MAILBOXES =$MAILINGLIST|g" $MUTTRC
chown $MYUSERNAME:$MYUSERNAME $MUTTRC
if ! grep -q "=$MAILINGLIST" $MUTTRC; then
sed -i "s|$MUTT_MAILBOXES|$MUTT_MAILBOXES =$MAILINGLIST|g" $MUTTRC
chown $MYUSERNAME:$MYUSERNAME $MUTTRC
fi
fi
if [ $LIST_ADDRESS ]; then
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment