On Friday, August 21, 2020 5:49:25 PM EDT, edgar wrote:
> You could probably write a filter to do this. If you search
> github there is a filter for rewriting the "from" shouldn't be
> too difficult to make it change the "to".

Thanks, found it. I suppose I could adapt it but debugging a 60 line awk
script sort of defeats the purpose.
https://github.com/jirutka/opensmtpd-filter-rewrite-from/blob/master/filter-rewrite-from

I also tried an inline "phase rcpt-to" filter, but sadly it doesn't take
format specifiers.

sendmail: command failed: 550 Invalid recipient: <%{rcpt.user}@localhost>

Basically I'm looking for something like "myorigin" here:
http://www.postfix.org/STANDARD_CONFIGURATION_README.html#null_client

I guess opensmtpd doesn't have it yet

> Edgar
>
> On Aug 20, 2020 9:13 PM, Frank Gaspari wrote:
> > I'm looking to relay all local mail from host2 to corresponding users on
> > host1.
> >
> > Here's host2 smtpd.conf
> >
> >     table aliases file:/etc/mail/aliases
> >     listen on lo
> >     action "relay" relay host smtp://10.9.0.1
> >     match for local action "relay"
> >
> > If on host2 I do
> >
> >     # sendmail -t <<- .
> >     From: root
> >     To: root
> >     Subject: Test
> >
> >     .
> >
> > it expands the address to root@host2 and gets rejected by the host1
> > because it doesn't know what to do with the address. But if I change
> > "To" explicitly to root@localhost it gets delivered.
> >
> > Is there a way to change the domain on rcpt-to for local mail being
> > relayed, similar to "mail-from"?
> >
> > If not, can the default domain be set to localhost rather than the
> > actual host name?
>

Reply via email to