Re: openSMTPD relaying and aliases

2017-10-05 Thread Michael Hekeler
On Thu, Oct 05, 2017 at 12:41:53PM +0200, Michael Hekeler wrote:
> > aliases file:
> > root: logs+...@domain.tld

If your monitoring app on localhost sends an email to "root"
then the header of that email has:

  From: Cron Daemon  <-- I don´t know what your sender looks like
  X-Original-To: root   <-- maybe
  To: r...@domain.com
  ...
   
Because of your alias file the smtpd will add the Delivered-To field
So the header is:

  From: Cron Daemon
  X-Original-To: root
  To: r...@domain.com
  Delivered-To: logs+...@domain.tld
  ...

You can filter by Delivered-To for example or as I write before 
configure your monitoring app that it sends to logs+...@domain.tld
Then the header will be:
   
  From: Cron Daemon
  To: logs+...@domain.tld
  ...



Re: openSMTPD relaying and aliases

2017-10-05 Thread Michael Hekeler
> aliases file:
> root: logs+...@domain.tld
> 
> ...
>
> But I get mails in my log account
> From: r...@machinename.domain.tld
> To:r...@machinename.domain.tld

Isn't this the expected result? 
I think it is the purpose of mailaliases that you receive in the log 
account mbox the emails with "To: root@..."


> but i would like to have a it with
> From: r...@machinename.domain.tld
> To: logs+...@domain.tld

Then you have to tell the mailer (syslogd or logcheck or whatever)
that sends to "r...@machinename.domain.tld" that he should send his 
emails not to "root" but to "logs+...@domain.tld".


> to make my filtering easier in the mail account.
> So is it possible to get smtpd to use the alias  in the to: field by

of course it is possible to rewrite an emailheader, but you should 
better not change standards. In your case, I think you should better 
modify your filter rules in the mail client.



Re: openSMTPD relaying and aliases

2017-10-05 Thread Boudewijn Dijkstra

Op Wed, 04 Oct 2017 11:31:25 +0200 schreef rosjat :

[...]
But I get mails in my log account
From: r...@machinename.domain.tld
To:r...@machinename.domain.tld

but i would like to have a it with
From: r...@machinename.domain.tld
To: logs+...@domain.tld

to make my filtering easier in the mail account.

So is it possible to get smtpd to use the alias  in the to: field by  
default when sending a mail from a user account?


Can't you filter using the "Delivered-To" header?



--
Gemaakt met Opera's e-mailprogramma: http://www.opera.com/mail/



openSMTPD relaying and aliases

2017-10-04 Thread rosjat

Hi there,

just a simple question about relaying a local mail with an alias instead 
of the user name.


so it works to relay mail to the alias address  via the relay

aliases file:

root: logs+...@domain.tld

secrets file:
test acco...@domain.tld:secret_pass

smtpd.conf

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

listen on lo0

accept for local alias  deliver to mbox
accept for any relay via tls+auth://t...@mail.domain.tld:587 auth 


But I get mails in my log account
From: r...@machinename.domain.tld
To:r...@machinename.domain.tld

but i would like to have a it with
From: r...@machinename.domain.tld
To: logs+...@domain.tld

to make my filtering easier in the mail account.

So is it possible to get smtpd to use the alias  in the to: field by 
default when sending a mail from a user account?


Regards

--
Markus Rosjatfon: +49 351 8107223mail: ros...@ghweb.de

G+H Webservice GbR Gorzolla, Herrmann
Königsbrücker Str. 70, 01099 Dresden

http://www.ghweb.de
fon: +49 351 8107220   fax: +49 351 8107227

Bitte prüfen Sie, ob diese Mail wirklich ausgedruckt werden muss! Before 
you print it, think about your responsibility and commitment to the 
ENVIRONMENT