Last active
August 29, 2015 13:57
-
-
Save oh-sky/9787139 to your computer and use it in GitHub Desktop.
Postfixがメールを外部へ送信しないようにする設定をするスクリプト
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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