block-email 319 B

1234567891011121314
  1. #!/bin/bash
  2. if [[ $EUID -ne 0 ]]; then # Force root
  3. exec sudo $0 "$@";
  4. fi;
  5. if [[ "$1" = "" ]];then
  6. echo "Usage: $0 <email>";
  7. else
  8. cd /etc/postfix/;
  9. echo "$1 REJECT" >> sender_access;
  10. postmap hash:sender_access;
  11. service postfix restart;
  12. service saslauthd restart;
  13. service courier-authdaemon restart;
  14. fi;