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 "86.34.153.250"

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 86.34.153.250 netmask 0xfffffff8 broadcast 86.34.153.255

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 109.166.210.10 netmask 0xfffffffc broadcast 109.166.210.11


dotbit# route -n show|grep default 
default            109.166.210.9      UGS       12  3936306     -     8 em2  
default            86.34.153.249      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 
109.166.210.10 (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[15641]: ee7e33319534dd82 mta connecting 
address=smtp://98.137.159.26:25 host=mta-v42.mail.vip.ne1.yahoo.com
Aug 13 07:54:24 dotbit smtpd[15641]: ee7e33319534dd82 mta error 
reason=Connection failed: Permission denied
Aug 13 07:54:24 dotbit smtpd[15641]: smtp-out: Disabling route 86.34.153.250 
<-> 98.137.159.26 (mta-v42.mail.vip.ne1.yahoo.com) for 15s

but it I also have "pass out on em2" the mail gets sent from em2 
(109.166.210.10).

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

Reply via email to