Nie jesteś zalogowany.
Jeśli nie posiadasz konta, zarejestruj je już teraz! Pozwoli Ci ono w pełni korzystać z naszego serwisu. Spamerom dziękujemy!
Prosimy o pomoc dla małej Julki — przekaż 1% podatku na Fundacji Dzieciom zdazyć z Pomocą.
Więcej informacji na dug.net.pl/pomagamy/.
Strony: 1
Witam! Chciałbym wysyłać maile ze swojego kompa (system OpenBSD current). Niestety mam zablokowawny port 25. W związku z tym chciałbym przekierować pocztę wychodzącą na port 587. Jedyne co udało mi się znaleźć to regułę jak to zrobić na linuksie:
iptables -t nat -A PREROUTING -p tcp --dport 587 -j REDIRECT --to-port 25
Nie potrafię ogarnąć, jak to przerzucić na OpenBSD, a męczę się już jakiś czas więc proszę o pomoc.
Ostatnio edytowany przez andrewdre (2016-03-19 20:00:19)
Offline
2853
Ostatnio edytowany przez uzytkownikubunt (2016-12-01 01:37:28)
Offline
Maile niestety nie dochodzą (także yandex i 10minutesmail). Przy ustawieniach PF:
match out on em0 inet proto tcp to any port 587 tag zmiana_portu pass out quick log (all, to pflog0) inet proto tcp tagged zmiana_portu rdr-to 0.0.0.0/0 port 25 bitmask
pflog0 pusty
tcpdump log port 25 (na 587 pusto)
20:09:09.887293 192.168.1.7.41959 > 173.194.71.26.25: S 1695620791:1695620791(0) win 16384 <mss 1460,nop,nop,sackOK,nop,wscale 3,nop,nop,timestamp 2362020543 0> (DF) 20:09:15.802542 192.168.1.7.41959 > 173.194.71.26.25: S 1695620791:1695620791(0) win 16384 <mss 1460,nop,nop,sackOK,nop,wscale 3,nop,nop,timestamp 2362020555 0> (DF) 20:09:27.640835 192.168.1.7.41959 > 173.194.71.26.25: S 1695620791:1695620791(0) win 16384 <mss 1460,nop,nop,sackOK,nop,wscale 3,nop,nop,timestamp 2362020579 0> (DF) 20:09:51.318397 192.168.1.7.41959 > 173.194.71.26.25: S 1695620791:1695620791(0) win 16384 <mss 1460,nop,nop,sackOK,nop,wscale 3,nop,nop,timestamp 2362020627 0> (DF) 20:10:56.967361 192.168.1.7.27695 > 74.125.23.26.25: S 2890711999:2890711999(0) win 16384 <mss 1460,nop,nop,sackOK,nop,wscale 3,nop,nop,timestamp 879234044 0> (DF) 20:11:02.877259 192.168.1.7.27695 > 74.125.23.26.25: S 2890711999:2890711999(0) win 16384 <mss 1460,nop,nop,sackOK,nop,wscale 3,nop,nop,timestamp 879234056 0> (DF) 20:11:14.006984 192.168.1.7.43466 > 173.194.71.26.25: S 259833106:259833106(0) win 16384 <mss 1460,nop,nop,sackOK,nop,wscale 3,nop,nop,timestamp 3745718767 0> (DF) 20:11:14.715826 192.168.1.7.27695 > 74.125.23.26.25: S 2890711999:2890711999(0) win 16384 <mss 1460,nop,nop,sackOK,nop,wscale 3,nop,nop,timestamp 879234080 0> (DF) 20:11:19.927416 192.168.1.7.43466 > 173.194.71.26.25: S 259833106:259833106(0) win 16384 <mss 1460,nop,nop,sackOK,nop,wscale 3,nop,nop,timestamp 3745718779 0> (DF) 20:11:31.851223 192.168.1.7.43466 > 173.194.71.26.25: S 259833106:259833106(0) win 16384 <mss 1460,nop,nop,sackOK,nop,wscale 3,nop,nop,timestamp 3745718803 0> (DF) 20:11:38.481825 192.168.1.7.27695 > 74.125.23.26.25: S 2890711999:2890711999(0) win 16384 <mss 1460,nop,nop,sackOK,nop,wscale 3,nop,nop,timestamp 879234128 0> (DF) 20:11:55.529871 192.168.1.7.43466 > 173.194.71.26.25: S 259833106:259833106(0) win 16384 <mss 1460,nop,nop,sackOK,nop,wscale 3,nop,nop,timestamp 3745718851 0> (DF) 20:12:28.087108 192.168.1.7.8973 > 74.125.23.26.25: S 682850086:682850086(0) win 16384 <mss 1460,nop,nop,sackOK,nop,wscale 3,nop,nop,timestamp 2219781667 0> (DF) 20:12:34.004358 192.168.1.7.8973 > 74.125.23.26.25: S 682850086:682850086(0) win 16384 <mss 1460,nop,nop,sackOK,nop,wscale 3,nop,nop,timestamp 2219781679 0> (DF) 20:12:44.116886 192.168.1.7.15624 > 173.194.71.26.25: S 1271448331:1271448331(0) win 16384 <mss 1460,nop,nop,sackOK,nop,wscale 3,nop,nop,timestamp 968564183 0> (DF) 20:12:45.843326 192.168.1.7.8973 > 74.125.23.26.25: S 682850086:682850086(0) win 16384 <mss 1460,nop,nop,sackOK,nop,wscale 3,nop,nop,timestamp 2219781703 0> (DF) 20:12:50.033813 192.168.1.7.15624 > 173.194.71.26.25: S 1271448331:1271448331(0) win 16384 <mss 1460,nop,nop,sackOK,nop,wscale 3,nop,nop,timestamp 968564195 0> (DF)
mail log
Mar 15 20:09:09 host smtpd[57601]: smtp-in: New session cbe0f2be69eeb340 from host host.my.domain [local] Mar 15 20:09:09 host smtpd[57601]: smtp-in: Accepted message 774a8b86 on session cbe0f2be69eeb340: from=<ja@host.my.domain>, to=<mojmail@gmail.com>, size=341, ndest=1, proto=ESMTP Mar 15 20:09:09 host smtpd[57601]: smtp-in: Closing session cbe0f2be69eeb340 Mar 15 20:09:09 host smtpd[57601]: smtp-out: Connecting to smtp+tls://173.194.71.26:25 (lb-in-f26.1e100.net) on session cbe0f2c81b60d355... Mar 15 20:10:56 host smtpd[57601]: smtp-out: Error on session cbe0f2c81b60d355: Connection timeout Mar 15 20:10:56 host smtpd[57601]: smtp-out: Disabling route [] <-> 173.194.71.26 (lb-in-f26.1e100.net) for 15s Mar 15 20:10:56 host smtpd[57601]: smtp-out: Connecting to smtp+tls://74.125.23.26:25 (tg-in-f26.1e100.net) on session cbe0f2c9fb80fcec... Mar 15 20:11:11 host smtpd[57601]: smtp-out: Enabling route [] <-> 173.194.71.26 (lb-in-f26.1e100.net) Mar 15 20:11:14 host smtpd[57601]: smtp-out: Connecting to smtp+tls://173.194.71.26:25 (lb-in-f26.1e100.net) on session cbe0f2cae181f2ba... Mar 15 20:12:11 host smtpd[57601]: smtp-out: Error on session cbe0f2c9fb80fcec: Connection timeout Mar 15 20:12:11 host smtpd[57601]: smtp-out: Disabling route [] <-> 74.125.23.26 (tg-in-f26.1e100.net) for 15s Mar 15 20:12:26 host smtpd[57601]: smtp-out: Enabling route [] <-> 74.125.23.26 (tg-in-f26.1e100.net) Mar 15 20:12:28 host smtpd[57601]: smtp-out: Error on session cbe0f2cae181f2ba: Connection timeout Mar 15 20:12:28 host smtpd[57601]: smtp-out: Disabling route [] <-> 173.194.71.26 (lb-in-f26.1e100.net) for 15s Mar 15 20:12:28 host smtpd[57601]: smtp-out: Connecting to smtp+tls://74.125.23.26:25 (tg-in-f26.1e100.net) on session cbe0f2cb8c426c73... Mar 15 20:12:43 host smtpd[57601]: smtp-out: Enabling route [] <-> 173.194.71.26 (lb-in-f26.1e100.net) Mar 15 20:12:44 host smtpd[57601]: smtp-out: Connecting to smtp+tls://173.194.71.26:25 (lb-in-f26.1e100.net) on session cbe0f2cc53fbc988...
Przy ustawieniach PF
match out on em0 inet proto tcp to any port 25 tag zmiana_portu pass out quick log (all, to pflog0) inet proto tcp tagged zmiana_portu rdr-to 0.0.0.0/0 port 587 bitmask
pflog0
Mar 15 20:57:39.248828 rule 3/(match) pass out on em0: 192.168.1.7.10359 > 209.85.233.26.587: S 2009824422:2009824422(0) win 16384 <mss 1460,nop,nop,sackOK,nop,wscale 3,nop,nop,timestamp 2076265953[|tcp]> (DF) Mar 15 20:57:45.164463 rule 3/(match) pass out on em0: 192.168.1.7.10359 > 209.85.233.26.25: S 2009824422:2009824422(0) win 16384 <mss 1460,nop,nop,sackOK,nop,wscale 3,nop,nop,timestamp 2076265965[|tcp]> (DF) Mar 15 20:57:57.005854 rule 3/(match) pass out on em0: 192.168.1.7.10359 > 209.85.233.26.25: S 2009824422:2009824422(0) win 16384 <mss 1460,nop,nop,sackOK,nop,wscale 3,nop,nop,timestamp 2076265989[|tcp]> (DF) Mar 15 20:58:20.678883 rule 3/(match) pass out on em0: 192.168.1.7.10359 > 209.85.233.26.25: S 2009824422:2009824422(0) win 16384 <mss 1460,nop,nop,sackOK,nop,wscale 3,nop,nop,timestamp 2076266037[|tcp]> (DF) Mar 15 20:58:53.307178 rule 3/(match) pass out on em0: 192.168.1.7.15502 > 74.125.23.27.587: S 1309788951:1309788951(0) win 16384 <mss 1460,nop,nop,sackOK,nop,wscale 3,nop,nop,timestamp 247667439[|tcp]> (DF) Mar 15 20:58:59.223336 rule 3/(match) pass out on em0: 192.168.1.7.15502 > 74.125.23.27.25: S 1309788951:1309788951(0) win 16384 <mss 1460,nop,nop,sackOK,nop,wscale 3,nop,nop,timestamp 247667451[|tcp]> (DF) Mar 15 20:59:10.241611 rule 3/(match) pass out on em0: 192.168.1.7.47558 > 209.85.233.26.587: S 3867609451:3867609451(0) win 16384 <mss 1460,nop,nop,sackOK,nop,wscale 3,nop,nop,timestamp 2784639433[|tcp]> (DF) Mar 15 20:59:11.062585 rule 3/(match) pass out on em0: 192.168.1.7.15502 > 74.125.23.27.25: S 1309788951:1309788951(0) win 16384 <mss 1460,nop,nop,sackOK,nop,wscale 3,nop,nop,timestamp 247667475[|tcp]> (DF) Mar 15 20:59:16.161555 rule 3/(match) pass out on em0: 192.168.1.7.47558 > 209.85.233.26.25: S 3867609451:3867609451(0) win 16384 <mss 1460,nop,nop,sackOK,nop,wscale 3,nop,nop,timestamp 2784639445[|tcp]> (DF) Mar 15 20:59:28.001236 rule 3/(match) pass out on em0: 192.168.1.7.47558 > 209.85.233.26.25: S 3867609451:3867609451(0) win 16384 <mss 1460,nop,nop,sackOK,nop,wscale 3,nop,nop,timestamp 2784639469[|tcp]> (DF) Mar 15 20:59:34.737431 rule 3/(match) pass out on em0: 192.168.1.7.15502 > 74.125.23.27.25: S 1309788951:1309788951(0) win 16384 <mss 1460,nop,nop,sackOK,nop,wscale 3,nop,nop,timestamp 247667523[|tcp]> (DF)
tcpdump log port 587 (25 pusto)
20:57:39.248909 192.168.1.7.10359 > 209.85.233.26.587: S 2009824422:2009824422(0) win 16384 <mss 1460,nop,nop,sackOK,nop,wscale 3,nop,nop,timestamp 2076265953 0> (DF) 20:57:45.164652 192.168.1.7.10359 > 209.85.233.26.587: S 2009824422:2009824422(0) win 16384 <mss 1460,nop,nop,sackOK,nop,wscale 3,nop,nop,timestamp 2076265965 0> (DF) 20:57:57.005890 192.168.1.7.10359 > 209.85.233.26.587: S 2009824422:2009824422(0) win 16384 <mss 1460,nop,nop,sackOK,nop,wscale 3,nop,nop,timestamp 2076265989 0> (DF) 20:58:20.678916 192.168.1.7.10359 > 209.85.233.26.587: S 2009824422:2009824422(0) win 16384 <mss 1460,nop,nop,sackOK,nop,wscale 3,nop,nop,timestamp 2076266037 0> (DF) 20:58:53.307212 192.168.1.7.15502 > 74.125.23.27.587: S 1309788951:1309788951(0) win 16384 <mss 1460,nop,nop,sackOK,nop,wscale 3,nop,nop,timestamp 247667439 0> (DF) 20:58:59.223382 192.168.1.7.15502 > 74.125.23.27.587: S 1309788951:1309788951(0) win 16384 <mss 1460,nop,nop,sackOK,nop,wscale 3,nop,nop,timestamp 247667451 0> (DF) 20:59:10.241631 192.168.1.7.47558 > 209.85.233.26.587: S 3867609451:3867609451(0) win 16384 <mss 1460,nop,nop,sackOK,nop,wscale 3,nop,nop,timestamp 2784639433 0> (DF) 20:59:11.062621 192.168.1.7.15502 > 74.125.23.27.587: S 1309788951:1309788951(0) win 16384 <mss 1460,nop,nop,sackOK,nop,wscale 3,nop,nop,timestamp 247667475 0> (DF) 20:59:16.161589 192.168.1.7.47558 > 209.85.233.26.587: S 3867609451:3867609451(0) win 16384 <mss 1460,nop,nop,sackOK,nop,wscale 3,nop,nop,timestamp 2784639445 0> (DF) 20:59:28.001280 192.168.1.7.47558 > 209.85.233.26.587: S 3867609451:3867609451(0) win 16384 <mss 1460,nop,nop,sackOK,nop,wscale 3,nop,nop,timestamp 2784639469 0> (DF) 20:59:34.737452 192.168.1.7.15502 > 74.125.23.27.587: S 1309788951:1309788951(0) win 16384 <mss 1460,nop,nop,sackOK,nop,wscale 3,nop,nop,timestamp 247667523 0> (DF)
maillog
Mar 15 20:57:38 host smtpd[57601]: smtp-in: New session cbe0f2be69eeb340 from host host.my.domain [local] Mar 15 20:57:38 host smtpd[57601]: smtp-in: Accepted message 774a8b86 on session cbe0f2be69eeb340: from=<ja@host.my.domain>, to=<mojmail@gmail.com>, size=341, ndest=1, proto=ESMTP Mar 15 20:57:38 host smtpd[57601]: smtp-in: Closing session cbe0f2be69eeb340 Mar 15 20:57:39 host smtpd[57601]: smtp-out: Connecting to smtp+tls://209.85.233.26:25 (209.85.233.26) on session cbe0f2c81b60d355... Mar 15 20:58:53 host smtpd[57601]: smtp-out: Error on session cbe0f2c81b60d355: Connection timeout Mar 15 20:58:53 host smtpd[57601]: smtp-out: Disabling route [] <-> 209.85.233.26 (209.85.233.26) for 15s Mar 15 20:58:53 host smtpd[57601]: smtp-out: Connecting to smtp+tls://74.125.23.27:25 (tg-in-f27.1e100.net) on session cbe0f2c9fb80fcec... Mar 15 20:59:08 host smtpd[57601]: smtp-out: Enabling route [] <-> 209.85.233.26 (209.85.233.26) Mar 15 20:59:10 host smtpd[57601]: smtp-out: Connecting to smtp+tls://209.85.233.26:25 (209.85.233.26) on session cbe0f2cad6d1fae7...
mój PF
set skip on lo pass out all match out on em0 inet proto tcp to any port 25 tag zmiana_portu pass out quick log (all, to pflog0) inet proto tcp tagged zmiana_portu rdr-to 0.0.0.0/0 port 587 bitmask block in all block out to {191.168.1.0/24}
Ostatnio edytowany przez andrewdre (2016-03-15 21:16:45)
Offline
2854
Ostatnio edytowany przez uzytkownikubunt (2016-12-01 01:37:30)
Offline
Jaki serwer pocztowy masz na Openie?
Pytam, bo przekierowanie na 587 nie ma sensu - na tym porcie serwery pocztowe wymagają autoryzacji.
Dlatego przy zablokowanym porcie docelowym 25 musisz używać smarthosta i wysyłać przez niego z autoryzacją SMTP.
Samo przekierowanie sprawy nie załatwia.
Offline
Server pocztowy to smtpd ale mogę zmienić na postfixa
Ostatnio edytowany przez andrewdre (2016-03-15 22:19:43)
Offline
2855
Ostatnio edytowany przez uzytkownikubunt (2016-12-01 01:37:31)
Offline
Oczywiście masz rację OpenSMTPD.
Ostatnio edytowany przez andrewdre (2016-03-15 22:19:17)
Offline
wytłumaczmy sobie jedno. Na opnie nie ma iptables za to jest tylko pf.
Offline
Nie no jasne, że Packet Filter, tak tylko dałem regułke z iptables:) Zresztą w moim drugim poście pisałem wyłącznie o PF. Problem rozwiązałem korzystając z tego tutoriala. Pozdrawiam i dzięki za odpowiedzi:)
Offline
2935
Ostatnio edytowany przez uzytkownikubunt (2016-12-01 01:39:12)
Offline
Strony: 1