Hi,

Guess it’s a typical case of me "not seeing the trees due to the forest”.

I’m trying to get to grips with OpenSMTPD on OpenBSD 5.9
(Hence it’s version 5.9.1)

Simple requirement actually:

send email to the "Internet" from local users with "from" in enveloppe and 
"From:" headers to be of the form [email protected] even though the machine 
itself has as hostname "bar.example.com" so: nowhere is there a 
"bar.example.com" to be seen, with the exception of Received headers (don't 
care about those)
never deliver mail locally (mailboxes will not be read by the few local users 
that exist)
process the aliases before sending the email away.
Additionally: relay from an internal network to the Internet (unmodified) 

I can’t seem get it to work.

-> I seem to have to keep /etc/mail/mailname set to example.com in order to 
keep control over the From: header

If I don’t do that, I lose control over the From: header for local users (via 
socket and/or 127.0.0.1).

As soon as I do that however, a line in the form of 

accept for local alias <aliases> deliver to mbox

(alias implies deliver, it gives a syntax error when trying relay)

the aliases of the form
root: [email protected]
deliver locally instead of relaying

There must be something simpler to do this, but I seem to only find examples 
where the smtpd is used to deliver to local mailboxes, which is exactly what I 
don’t want.
I want all mail to go away, but the mailname file seems to trigger both the 
headers on locally generated mail as well as define what mail must be locally 
delivered … and that combined makes this impossible unless there’s a trick 
somewhere I missed out on.


Essentially what I would like is:

/etc/mail/mailname:
example.com

/etc/mail/smtpd.conf:
listen on lo0
listen on internal

table aliases file:/etc/mail/aliases

#the line below is a syntax error: "aliases/virtual may not be used with a 
relay rule"]
#accept from local alias <aliases> relay via smtp://foo.isp.net:25 as 
“@example.com"
accept from local relay via smtp://foo.isp.net:25 as “@example.com"

accept for any relay via smtp://foo.isp.net:25

/etc/mail/aliases:
#[just showing a few as an example]
www:    root
_ntp: /dev/null
root: user
user: [email protected]

I can’t believe I’m the first one to want a server that sends out all relevant 
email, but never deliver email locally, yet process aliases.

Help appreciated.

Swa

Reply via email to