Skip to content

Instantly share code, notes, and snippets.

@oh-sky
Last active August 29, 2015 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save oh-sky/9787139 to your computer and use it in GitHub Desktop.
Save oh-sky/9787139 to your computer and use it in GitHub Desktop.
Postfixがメールを外部へ送信しないようにする設定をするスクリプト
#!/bin/sh
USERID=`id | sed 's/uid=\([0-9]*\)(.*/\1/'`
if [ $USERID -ne 0 ]
then
echo $0": Error: You must be root to do that!"
exit 1
fi
echo "\ntrash:\t/dev/null" >> /etc/aliases
postalias /etc/aliases
echo "\n*\tlocal:" >> /etc/postfix/transport
postmap /etc/postfix/transport
echo "\nluser_relay = trash\ntransport_maps = hash:/etc/postfix/transport" >> /etc/postfix/main.cf
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment