Re: action "relay" relay src "ip"

2019-08-13 Thread gilles
Hi,

no problem :-)

13 août 2019 17:39 mailingli...@dotbit.ro a écrit:

> Hi Gilles,
> 
> Problem solved - it was my routes + pf that were the problem.
> 
> Sorry for the noise and thank you for giving me confidence in that relay src 
> works.
> 
> BR, Dimitrios
> 
> On Tue, Aug 13, 2019 at 08:35:07AM +, gil...@poolp.org wrote:
> 
>> 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.



Re: action "relay" relay src "ip"

2019-08-13 Thread mailinglists
Hi Gilles,

Problem solved - it was my routes + pf that were the problem.

Sorry for the noise and thank you for giving me confidence in that relay src 
works.

BR, Dimitrios

On Tue, Aug 13, 2019 at 08:35:07AM +, gil...@poolp.org wrote:
> 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.



Re: action "relay" relay src "ip"

2019-08-13 Thread gilles
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  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 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 0xfff8 broadcast 86.34.153.255
> 
> dotbit# ifconfig em2
> em2: flags=8843 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 0xfffc 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



action "relay" relay src "ip"

2019-08-13 Thread mailinglists
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 port25  tag EXT
match tag EXT for domain  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 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 0xfff8 broadcast 86.34.153.255

dotbit# ifconfig em2
em2: flags=8843 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 0xfffc broadcast 109.166.210.11


dotbit# route -n show|grep default 
default109.166.210.9  UGS   12  3936306 - 8 em2  
default86.34.153.249  UGS00 -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