我正在尝试设置Mikrotik(RouterOS v6.24)来发送电子邮件。
我有谷歌帐户,我正在使用SMTP连接。 我知道我需要允许出站连接才能工作。 但是,当我尝试发送电子邮件时,入站filter将阻止连接,发送电子邮件将失败。
16:37:04 firewall,info input: in:ether1-WAN out:(none), src-mac 00:13:60:16:4f:c6, proto TCP (SYN,ACK), 74.125.128.108:587->xxxx:5462
当我禁用inputfilter。 电子邮件将被正确发送。
为什么我需要允许input连接发送电子邮件?
RouterOS设置:
address: 74.125.128.108 port: 587 start-tls: yes from: xxxxx@gmail.com user: xxxxx password: xxxxxxxx last-status: failed
使用的命令:
send [email protected] from="[email protected]" subject="test email" body="test body"
看起来您不允许在input链上established/related
连接。
为了让路由器与外部世界进行通信(无论是smtp还是其他任何东西),并且在input链上有一个防火墙,您需要允许任何已build立/相关的连接重新连接到路由器。
只需在input链的顶部添加以下规则:
/ip firewall filter add chain=input connection-state=established,related action=accept