Re: I would like help matching my outgoing domains to the right IP for smtpd

2023-08-16 Thread Chris Bennett
On Wed, Aug 16, 2023 at 10:21:34AM +0200, Bruno Flückiger wrote:
> How about something like this?
> 
> match from mail-from regex "@example.net" action send_example_net
> match from mail-from regex "@example.com" action send_example_com
> 
> Cheers,
> Bruno
> 

Thank you very much.
I just had to add for any and it works perfectly.

My dad and I ate some bad food at a restaurant, so this is a happy
moment.

-- 
Chris Bennett



Re: I would like help matching my outgoing domains to the right IP for smtpd

2023-08-16 Thread Bruno Flückiger
On 11.08., Chris Bennett wrote:
> On Sat, Aug 12, 2023 at 03:49:12AM +, Philipp Buehler wrote:
> > Am 12.08.2023 03:13 schrieb Chris Bennett:
> > > I can't figure out how to match the outgoing mails to the correct IP/mx
> > > they are coming from. Just one server, different A records for the mx
> > > versus domain name.
> >
> > Difficult to understand what you're trying there...
> > I kinda understand that you have multiple IP-addresses on that smtpd
> > machine and need to send from a "correct" one?
> > If so, check back that 'action' with a relay delivery has a 'src' option.
> >
> > HTH,
> > --
> > pb
> >
> action "benn_to_outbound" relay src 108.181.26.184 helo 
> mx.bennettconstruction.us
>
> If this is correct, it works fine.
> However, right now, I am forcing a match with
>
> match from local for anyaction "benn_to_outbound"
>
> I haven't been able to think of a way to match each individual one.
>
> --
> Chris Bennett
>

How about something like this?

match from mail-from regex "@example.net" action send_example_net
match from mail-from regex "@example.com" action send_example_com

Cheers,
Bruno



Re: [cpb_m...@bennettconstruction.us: I would like help matching my outgoing domains to the right IP for smtpd]

2023-08-12 Thread Chris Bennett
It's the weekend. I will see if anyone has any advice later.

I will spend my time looking at perhaps solving the problem with a
filter and using tcpdump and the debug features of smtpd to follow what
I come up with.

-- 
Chris Bennett



Re: I would like help matching my outgoing domains to the right IP for smtpd

2023-08-11 Thread Chris Bennett
On Sat, Aug 12, 2023 at 03:49:12AM +, Philipp Buehler wrote:
> Am 12.08.2023 03:13 schrieb Chris Bennett:
> > I can't figure out how to match the outgoing mails to the correct IP/mx
> > they are coming from. Just one server, different A records for the mx
> > versus domain name.
> 
> Difficult to understand what you're trying there...
> I kinda understand that you have multiple IP-addresses on that smtpd
> machine and need to send from a "correct" one?
> If so, check back that 'action' with a relay delivery has a 'src' option.
> 
> HTH,
> -- 
> pb
> 
action "benn_to_outbound" relay src 108.181.26.184 helo 
mx.bennettconstruction.us

If this is correct, it works fine.
However, right now, I am forcing a match with

match from local for anyaction "benn_to_outbound"

I haven't been able to think of a way to match each individual one.

-- 
Chris Bennett



Re: I would like help matching my outgoing domains to the right IP for smtpd

2023-08-11 Thread Chris Bennett
On Sat, Aug 12, 2023 at 03:49:12AM +, Philipp Buehler wrote:
> Am 12.08.2023 03:13 schrieb Chris Bennett:
> > I can't figure out how to match the outgoing mails to the correct IP/mx
> > they are coming from. Just one server, different A records for the mx
> > versus domain name.
> 
> Difficult to understand what you're trying there...
> I kinda understand that you have multiple IP-addresses on that smtpd
> machine and need to send from a "correct" one?
> If so, check back that 'action' with a relay delivery has a 'src' option.
> 
> HTH,
> -- 
> pb
> 

I have one server with multiple IP addresses.
For example, bennettconstruction.us at one IP, with A record
mx.bennettconstruction.us at the same machine, different IP with it's
own A record.

Plus, several other website and mail domains on the same server.
In each case, each has it's own A record and IP, one for a domain name,
the other for it's mail domain.

bennettconstruction.us 1.2.3.4
mx.bennettconstruction.us 1.2.3.5
moron.org 1.2.3.6
mail.moron.org 1.2.3.7
wisecracker.com 1.2.3.8
mx.wisecracker.com 1.2.3.9

I'm trying to get the proper mail server to match the sent From: domain.

Also, with this switch changing the hostname, root now comes through
bennettconstruction.us instead of the other one that was the hostname
before. The change in hostname was planned.

In case it's relevant, I always use ssh and neomutt to the server for
reading and sending.
I only use K9 on my phone to read or click a link.

Thank you for putting up with my hard to understand posts. It's not
deliberate, but a lifelong problem.

-- 
Chris Bennett





Re: I would like help matching my outgoing domains to the right IP for smtpd

2023-08-11 Thread Philipp Buehler

Am 12.08.2023 03:13 schrieb Chris Bennett:

I can't figure out how to match the outgoing mails to the correct IP/mx
they are coming from. Just one server, different A records for the mx
versus domain name.


Difficult to understand what you're trying there...
I kinda understand that you have multiple IP-addresses on that smtpd
machine and need to send from a "correct" one?
If so, check back that 'action' with a relay delivery has a 'src' 
option.


HTH,
--
pb



I would like help matching my outgoing domains to the right IP for smtpd

2023-08-11 Thread Chris Bennett
Hello,
as I was updating to the new IP ranges, I changed ~all to -all
(My old IP's were crap filled with spam, so I just didn't send mails to
the big guys.)

I tried sending to gmail.com and got smacked that the spf was referring
to an unexpected address on the server.
I found that I was getting "random" choices from the tables I had setup.

Reading the manpage carefully, I saw that this was the correct
behaviour.

If the headers in this email are correct, then I have the right action.

I can't figure out how to match the outgoing mails to the correct IP/mx
they are coming from. Just one server, different A records for the mx
versus domain name.
Right now, I'm just forcing all local to this action.
After several hours trying different options and testing sending to my
other server, I'm coming up blank.
Except that I now understand much more from the manpages that confused
me previously.
I've been reading a lot of other manpages lately, too.
Time well spent.

Any advice would be nice.

-- 
Chris Bennett



[cpb_m...@bennettconstruction.us: I would like help matching my outgoing domains to the right IP for smtpd]

2023-08-11 Thread Chris Bennett
- Forwarded message from Chris Bennett  
-

To: misc@openbsd.org
From: Chris Bennett 
Subject: I would like help matching my outgoing domains to the right IP for
 smtpd
Date: Fri, 11 Aug 2023 18:13:59 -0700

Hello,
as I was updating to the new IP ranges, I changed ~all to -all
(My old IP's were crap filled with spam, so I just didn't send mails to
the big guys.)

I tried sending to gmail.com and got smacked that the spf was referring
to an unexpected address on the server.
I found that I was getting "random" choices from the tables I had setup.

Reading the manpage carefully, I saw that this was the correct
behaviour.

If the headers in this email are correct, then I have the right action.

I can't figure out how to match the outgoing mails to the correct IP/mx
they are coming from. Just one server, different A records for the mx
versus domain name.
Right now, I'm just forcing all local to this action.
After several hours trying different options and testing sending to my
other server, I'm coming up blank.
Except that I now understand much more from the manpages that confused
me previously.
I've been reading a lot of other manpages lately, too.
Time well spent.

Any advice would be nice.

-- 
Chris Bennett


- End forwarded message -

--