[2026-09-05 05:06] Reg Barclay <[email protected]>
> I've just set up a VM running OpenBSD 7.9. :)
>
> In my LAN I have a central Postfix/Dovecot server that is used to 
> collect mails from all my VMs, e.g. cron messages, update notifications 
> from Linux machines running dnf-automatic or unattended-upgrades etc.
>
> I'd like my OpenBSD VM to deliver all locally generated emails to my 
> mail account on my central mail collector server, e.g. 10.10.20.10:25.
>
> I tried this:
>
> openbsd# cat /etc/mail/virtual
> @openbsd.int.example.org    [email protected]
> @openbsd                    [email protected]
> @localhost                  [email protected]

This will generate a local mail to [email protected].

> openbsd# cat /etc/mail/smtpd.conf
> table virtuals file:/etc/mail/virtual
> listen on lo0
> listen on socket
> action "central" mda "/usr/bin/smtp -s smtp://10.10.20.10 %{dest}" \
>      user _smtpd virtual <virtuals>
> match from local for any action "central"

This match also internal local generated mails like bounces, not shure
what about general forwords. So your mail goes in match this roule,
get's forworded to [email protected] then ther is an expantion problem.

A better abroach would be to match the socket specific and forword to
a existing user. So something like:

/etc/mail/virtual:
@openbsd.int.example.org    reg
@openbsd                    reg
@localhost                  reg

smtpd.conf:
table virtuals file:/etc/mail/virtual
listen on socket tag localmails
action 
action "central" mda "/usr/bin/smtp -s smtp://10.10.20.10 
%{dest.user}@int.example.org" \
     user _smtpd virtual <virtuals>
match tag localmails for any action "central"

I have not tetsted this, but I think you get the idea.

Philipp

>
> But unfortunately it doesn't work:
>
> openbsd# echo "Test from $(hostname)" | mail -s "OpenBSD Test" root
> openbsd# sendmail: command failed: 524 5.2.4 Mailing list expansion 
> problem: <[email protected]>
>
> Can you point me to the correct configuration?
>
> Thanks a lot in advance and have a nice weekend!
>
> Best regards,
> Reg
>
>

Reply via email to