Loading...

Postfix ile 587. portu dinleme

2025-03-30 02:35:14
106 Görüntülenme
1
YilmazX
Created by
YilmazX

Postfix ile 587. portu dinleme

Add Iptables Rules For Postfix To Support Ports 465 And 587

As I could not convince postfix to listen to different ports than 25 for local mail delivery AND use dovecote as the LDA, I decided to add iptables rules to forward all incoming connections to standard ports 465 and 587 to my primary port 25. Note that port 587 makes TLS mandatory and due to the fact that I suppress non-TLS I don’t run into problems here.

As far as google nows, Ubuntu has no default configuration file for iptable rules. Therefore, I decided to add the rule set from scratch by hand (which was not difficult anyway). I simply added the following script to a new file /etc/init.d/iptables:

#!/usr/bin/env bash
# add redirect rules for ports 465 and 587 (to let postfix run on different ports)
iptables -t nat -A PREROUTING -p tcp --dport 465 -j REDIRECT --to-ports 25
iptables -t nat -A PREROUTING -p tcp --dport 587 -j REDIRECT --to-ports 25

Then, make the script executable:

sudo chmod 755 /etc/init.d/iptables

And finally add it to the startup rules:

cd /etc/rcS.d
ln -s ../init.d/iptables S60iptables

If you want to enable the rules without rebooting, simply call

/etc/init.d/iptables

Bir Yorum Yazın

YilmazX

Fullstack Web Developer

Yazılım serüvenime Delphi ile kodlayarak başladım. Zaman içerisinde ağırlık olarak PHP ile kodlamaya başladım. Yanında CSS, Ajax, jQuery gibi konularda da ihtiyaçlarımı gidermeye zorunluluğu ile diğer konulara da eğildim. Ekstra olarak Linux, Windows sunucu yönetimi, her ikisi için de çeşitli scriptler ek yazılımlar hazırladım. Flutter ile yaptığım projeler var. Çeşitli veri tabanları için yönetim ve tasarımlar yaptım.

HATA !!

Avatar
%yorumYapanIsim%
%tarih%
Cevapla

%yorumMetni%


Avatar
%yorumYapanIsim%
%tarih%
Cevapla

@%yorumlanan% %yorumMetni%

Top