On 16-06-21 18:53:26, Edgar Pettijohn wrote: > On 16-06-21 05:58:03, Swa Frantzen wrote: > > 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 > > [email protected]" > > accept from local relay via smtp://foo.isp.net:25 as [email protected]" > > > > 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.
Sorry forgot this requirement. Easiest solution would be to have the users in alias file like so: user1: [email protected] user2: [email protected] etc. And/or you can use "forward-only" I haven't done so. You would need to consult smtpd.conf(5) and test it out. > > > > Help appreciated. > > > > Swa > It seems this should work: > > listen on lo0 > table aliases file:/etc/mail/aliases > > # I know you the local is default, but I like to make my intentions known. > accept from local for local alias <aliases> deliver to mbox > accept from local for any relay via smtp://foo.isp.net:25 as "@example.com" > > /etc/mail/mailname > example.com > > I haven't used the "as" keyword, but I'm guessing it works as expected. It > may also be your MUA adding the > unwanted headers. > -- > Edgar Pettijohn > > -- > You received this mail because you are subscribed to [email protected] > To unsubscribe, send a mail to: [email protected] > -- Edgar Pettijohn -- You received this mail because you are subscribed to [email protected] To unsubscribe, send a mail to: [email protected]
