Discussion:
Aliases and OpenSMTPD
(too old to reply)
Paul M Foster
2024-05-24 15:50:02 UTC
Permalink
Folks:

This may require someone who's familiar with OpenSMTPD. I have a machine
which does backups (buckaroo) and a desktop (yosemite) which is my main
machine. When anacron kicks off the backup, it should create an email for
root to detail what happened. Buckaroo is headless, so I want that email to
come to me at yosemite. (All this is on a LAN.)

I'm using OpenSMTPD on buckaroo to handle mail. Here's my config:

---
# $OpenBSD: smtpd.conf,v 1.10 2018/05/24 11:40:17 gilles Exp $

# This is the smtpd server system-wide configuration file.
# See smtpd.conf(5) for more information.

table aliases file:/etc/aliases
table secrets file:/etc/secrets

listen on localhost

action "relay" relay host smtp+notls://@yosemite.mars.lan:25 auth <secrets>

match from local for any action "relay"
---

If I send an email directly to ***@yosemite.mars.lan from buckaroo, it
arrives. That means this config can do what it's designed to do, basically.
However, mails to "root" on buckaroo don't get to yosemite. They should,
because my /etc/aliases table looks like this:

---
...
root ***@yosemite.mars.lan
---

But it appears that OpenSMTPD doesn't consult this table unless explicitly
instructed to. According to man smtpd.conf(5), you can tell it to scan
through aliases, but only on local delivery, not if the email is outbound.

So does anyone know how to make OpenSMTPD do alias conversions on outbound
mail? Or alternatively, is there a way to hack Debian so that mails
generated from root processes to go an offsite email rather than just root?

Paul
--
Paul M. Foster
Personal Blog: http://noferblatz.com
Company Site: http://quillandmouse.com
Software Projects: https://gitlab.com/paulmfoster
t***@tuxteam.de
2024-05-24 16:50:01 UTC
Permalink
[...]
Post by Paul M Foster
arrives. That means this config can do what it's designed to do, basically.
However, mails to "root" on buckaroo don't get to yosemite. They should,
---
...
---
Still out of my depth with OpenSMTPD, but... good ol' aliases,of sendmail
lore would have a colon after the "root" up there. The MTAs I know of
all have inherited that.

And... if your MTA distro came with a command "newaliases" try running
that. Many MTAs like to look things up in a hashed version of the textual
file.

Cheers
--
t
Paul M Foster
2024-05-24 17:10:01 UTC
Permalink
Post by t***@tuxteam.de
[...]
Post by Paul M Foster
arrives. That means this config can do what it's designed to do, basically.
However, mails to "root" on buckaroo don't get to yosemite. They should,
---
...
---
Still out of my depth with OpenSMTPD, but... good ol' aliases,of sendmail
lore would have a colon after the "root" up there. The MTAs I know of
all have inherited that.
There is a colon in my aliases file. I just omitted it in the email.

Paul
--
Paul M. Foster
Personal Blog: http://noferblatz.com
Company Site: http://quillandmouse.com
Software Projects: https://gitlab.com/paulmfoster
t***@tuxteam.de
2024-05-24 17:30:01 UTC
Permalink
Post by Paul M Foster
Post by t***@tuxteam.de
[...]
Post by Paul M Foster
arrives. That means this config can do what it's designed to do, basically.
However, mails to "root" on buckaroo don't get to yosemite. They should,
---
...
---
Still out of my depth with OpenSMTPD, but... good ol' aliases,of sendmail
lore would have a colon after the "root" up there. The MTAs I know of
all have inherited that.
There is a colon in my aliases file. I just omitted it in the email.
I see. Then I'm out of ideas (except that "newaliases" thing). Perhaps
your MTA has a log file where to find clues?

Cheers & good luck
--
tomás
David Wright
2024-05-24 17:40:01 UTC
Permalink
Post by Paul M Foster
Post by t***@tuxteam.de
Post by Paul M Foster
arrives. That means this config can do what it's designed to do, basically.
However, mails to "root" on buckaroo don't get to yosemite. They should,
---
...
---
Still out of my depth with OpenSMTPD, but... good ol' aliases,of sendmail
lore would have a colon after the "root" up there. The MTAs I know of
all have inherited that.
There is a colon in my aliases file. I just omitted it in the email.
I don't know anything about opensmtpd, but use exim4 where, to send
emails to other hosts on the LAN, AIUI you either need a DNS server
that can resolve the LAN addresses or, instead, a hubbed hosts file.

Cheers,
David.
Charles Curley
2024-05-24 18:00:01 UTC
Permalink
On Fri, 24 May 2024 13:08:56 -0400
Post by Paul M Foster
There is a colon in my aliases file. I just omitted it in the email.
Don't do that. Always use copy and paste to convey the contents of a
configuration file. Murphy only know what else you inadvertently left
out or added.
--
Does anybody read signatures any more?

https://charlescurley.com
https://charlescurley.com/blog/
didar
2024-05-27 12:10:01 UTC
Permalink
Post by Charles Curley
On Fri, 24 May 2024 13:08:56 -0400
Post by Paul M Foster
There is a colon in my aliases file. I just omitted it in the email.
Don't do that. Always use copy and paste to convey the contents of a
configuration file. Murphy only know what else you inadvertently left
out or added.
--
Does anybody read signatures any more?
https://charlescurley.com
https://charlescurley.com/blog/
Please try:

smtpctl update table aliases

...as root.

I had this command documented in my anisble recipe for OpenSMTPD.

# If you edit the file, you have to run "smtpctl update table aliases"
table aliases file:/etc/aliases
--
Regards,
Didar

Tax and title extra.

Generated by Signify v1.14 (http://www.debian.org/)
Kamil Jońca
2024-05-24 17:40:02 UTC
Permalink
Paul M Foster <***@quillandmouse.com> writes:

[...]
Post by Paul M Foster
it
What does this mean?
Post by Paul M Foster
But it appears that OpenSMTPD doesn't consult this table unless explicitly
instructed to. According to man smtpd.conf(5), you can tell it to scan
through aliases, but only on local delivery, not if the email is outbound.
So does anyone know how to make OpenSMTPD do alias conversions on outbound
mail? Or alternatively, is there a way to hack Debian so that mails
generated from root processes to go an offsite email rather than just root?
What is in the logs?

I am pretty sure you don't tell us whole truth.
KJ
--
http://wolnelektury.pl/wesprzyj/teraz/
I do enjoy a good long walk -- especially when my wife takes one.
Loading...