You need to provide the full configuration otherwise we can't troubleshoot.
Given that I use the relay src feature on a daily basis and that my mail infrastructure relies on it, I would venture to say the problem is with your setup. Gilles 13 août 2019 10:28 mailingli...@dotbit.ro a écrit: > Hello, > > I have one machine doing packet forwarding, nat and smtpd. > I have two internet providers and I want to receive mails on em2 and send > mails on em1. > > dotbit# uname -a > OpenBSD dotbit.ro 6.5 GENERIC.MP#3 amd64 > > I receive on em2 with no problems using the following: > listen on em2 port 25 tag EXT > match tag EXT for domain <domains> from any action "deliver_local" > > but I seem to fail to send from em1: > action "relay" relay src "18.104.22.168" > > dotbit# ifconfig em1 > em1: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500 > lladdr 0c:c4:7a:51:6d:c2 > description: Group 3 down. Romtelekom HP router port3 > index 2 priority 0 llprio 3 > groups: egress > media: Ethernet autoselect (100baseTX full-duplex) > status: active > inet 22.214.171.124 netmask 0xfffffff8 broadcast 126.96.36.199 > > dotbit# ifconfig em2 > em2: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500 > lladdr 0c:c4:7a:51:6d:c3 > description: Group 3 up. Orange. Connect to GE1 on Huawei router. > index 3 priority 0 llprio 3 > groups: egress > media: Ethernet autoselect (1000baseT full-duplex) > status: active > inet 188.8.131.52 netmask 0xfffffffc broadcast 184.108.40.206 > > dotbit# route -n show|grep default > default 220.127.116.11 UGS 12 3936306 - 8 em2 > default 18.104.22.168 UGS 0 0 - 12 em1 > > Note: The em1 route has lower priority. > > If I send an e-mail using this setup to gmail I receive an e-mail from ip > 22.214.171.124 (em2) > > If I have a "pass out on em1" and send mail using the above setup I get: > Aug 13 07:54:24 dotbit smtpd: ee7e33319534dd82 mta connecting > address=smtp://126.96.36.199:25 host=mta-v42.mail.vip.ne1.yahoo.com > Aug 13 07:54:24 dotbit smtpd: ee7e33319534dd82 mta error > reason=Connection failed: > Permission denied > Aug 13 07:54:24 dotbit smtpd: smtp-out: Disabling route 188.8.131.52 > <-> 184.108.40.206 > (mta-v42.mail.vip.ne1.yahoo.com) for 15s > > but it I also have "pass out on em2" the mail gets sent from em2 > (220.127.116.11). > > I do not need a solution for me personally, bit I think it should be possible > to chose where to > send from. > I only need this is temporary fix until my new provider assigns me reverse > dns, > then I can send and receive from the same route. > > Thanks for smtpd, Dimitrios