LoginSignup
0
1

More than 5 years have passed since last update.

外部へのメール送信を制限

Last updated at Posted at 2016-08-25

やりたい事

  • テスト環境などから不本意なうっかりメールを飛ばしてしまわないよう制限したい

想定環境

  • centos6.x
  • 載っている各種MTAは停止しておく

Outputで 25番ポートへ接続できないようルールを追加

sudo iptables -A OUTPUT -m tcp -p tcp --dport 25 -j DROP
sudo service iptables save
sudo service iptables restart

変更後の設定確認

sudo service iptables status

以下のルールがリストに存在することを確認

Chain OUTPUT (policy ACCEPT)
num  target     prot opt source               destination
1    DROP       tcp  --  0.0.0.0/0            0.0.0.0/0           tcp dpt:25

設定後の確認方法

mail コマンド等でテスト用のメアドへメール送信を試行し、mailq に滞留するか、MTAの動作ログといったところを監視、送信先にもメールが届かない事を確認

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1