diff --git a/man/freedombone-addlist.1.gz b/man/freedombone-addlist.1.gz index cfca9924..370295f4 100644 Binary files a/man/freedombone-addlist.1.gz and b/man/freedombone-addlist.1.gz differ diff --git a/man/freedombone-rmlist.1.gz b/man/freedombone-rmlist.1.gz index c8570137..f644056f 100644 Binary files a/man/freedombone-rmlist.1.gz and b/man/freedombone-rmlist.1.gz differ diff --git a/src/freedombone-addlist b/src/freedombone-addlist index d95704dc..8a8f4ca7 100755 --- a/src/freedombone-addlist +++ b/src/freedombone-addlist @@ -32,10 +32,11 @@ MYUSERNAME=$USER MAILINGLIST= SUBJECTTAG= +LIST_ADDRESS= function show_help { echo '' - echo 'freedombone-addlist -u [username] -l [mailing list name] -s [subject tag]' + echo 'freedombone-addlist -u [username] -l [mailing list name] -s [subject tag] -e [list email address]' echo '' exit 0 } @@ -60,6 +61,10 @@ case $key in shift SUBJECTTAG="$1" ;; + -e|--email) + shift + LIST_ADDRESS="$1" + ;; *) # unknown option ;; @@ -113,4 +118,11 @@ if [[ $MUTT_MAILBOXES != *$MAILINGLIST* ]]; then chown $MYUSERNAME:$MYUSERNAME $MUTTRC fi +if [ $LIST_ADDRESS ]; then + sed -i "s|unsubscribe $LIST_ADDRESS|subscribe $LIST_ADDRESS|g" $MUTTRC + if ! grep -q "subscribe $LIST_ADDRESS" $MUTTRC; then + echo "subscribe $LIST_ADDRESS" >> $MUTTRC + fi +fi + exit 0 diff --git a/src/freedombone-rmlist b/src/freedombone-rmlist index d60a85d3..ac1b939c 100755 --- a/src/freedombone-rmlist +++ b/src/freedombone-rmlist @@ -31,10 +31,11 @@ MYUSERNAME=$USER MAILINGLIST= +LIST_ADDRESS= function show_help { echo '' - echo 'freedombone-rmlist -u [username] -l [mailing list name]' + echo 'freedombone-rmlist -u [username] -l [mailing list name] -e [list email address]' echo '' exit 0 } @@ -55,6 +56,10 @@ case $key in shift MAILINGLIST="$1" ;; + -e|--email) + shift + LIST_ADDRESS="$1" + ;; *) # unknown option ;; @@ -73,4 +78,10 @@ if [[ $MUTT_MAILBOXES == *$MAILINGLIST* ]]; then chown $MYUSERNAME:$MYUSERNAME $MUTTRC fi +if [ $LIST_ADDRESS ]; then + if ! grep -q "unsubscribe $LIST_ADDRESS" $MUTTRC; then + sed -i "s|subscribe $LIST_ADDRESS|unsubscribe $LIST_ADDRESS|g" $MUTTRC + fi +fi + exit 0