I am trying to setup banmail for mutt

Viewed 15

I am tring to set up banning mail

#!/bin/sh


mail="$(grep "^From:" /dev/stdin | grep -o "[^<> ]\+@.\+\\.[^<>]\+"]" && break

#Give an argument to this command to ban ALL address from this domain

if [-n "$1" ]; then
    domain=$"(echo $mail | cut -d@ -f2)"
    read -r choice </dev/tty
    echo "$choice" | grep -i "^y$" &&
        eval "ssh root@www.rebootcyber.xyz 'echo blacklist_from $domain >> /etc/spamassassin/local.cf;systemctl reload spamassassin &'"
else
    echo Ban only mail address
    echo "Really ban $mail? [y/N]"
    read -r choice </dev/tty
    echo $choice | grep -i "^y$" &&
        eval "ssh root@www.rebootcyber.xyz 'echo blacklist_from $mail >> /etc/spamassassin/local.cf;systemctl reload spamassassin &'"
fi

When I run the script I get this error

./banmail: line 18: unexpected EOF while looking for matching `"' ./banmail: line 20: syntax error: unexpected end of file

Can anyone help me or point me in the right direction?

0 Answers
Related