Peter Micunek:
> Wietse,
> 
> It seems that you helped me. 
> 
> Thanks a lot

Good. for posteriority, the examples below uses smtp_header_checks
syntax instead of smtp_generic_checks syntax. Either feature should
do the job, when used appropriately.

        Wietse

> PM
> 
> On Tue, 8 Feb 2011 10:26:19 -0500 (EST), Wietse Venema wrote
> > Wietse Venema:
> > > Peter Micunek:
> > > > Wietse,
> > > > 
> > > > problem is that I need to have one domain in the field "MAIL FROM:"
> > > > for all emails come from particular client for example 10.10.10.10
> > > > to my postfix server.  The mail header field "From:" will be
> > > > preserved.
> > > 
> > > You need to configure as follows:
> > > 
> > > 1) Configure Postfix to preserve the From: address in mail from
> > >    this client. For control over Postfix header rewriting, see:
> > >    http://www.postfix.org/postconf.5.html#local_header_rewrite_clients
> > > 
> > > 2) Configure the client to send mail with the "right" From:  address.
> > >    The details for doing this are specific to the client.
> > 
> > If (2) is not possible, you can use a null content filter instead,
> > where a customized Postfix SMTP client "replaces" the From: header
> > using PCRE regular expressions, and then sends the result directly
> > into a Postfix SMTP server on 127.0.0.1 port 10026.
> > 
> > /etc/postfix/main.cf:
> >     smtpd_client_restrictions = 
> >     check_client_access hash:/etc/postfix/client_access
> > 
> > /etc/postfix/client_access:
> >     10.10.10.10     FILTER foobar:127.0.0.1:10026
> > 
> > /etc/postfix/master.cf:
> >     foobar      unix  -       -       n       -       -       smtp
> >     -o smtp_generic_maps=pcre:/etc/postfix/foobar_generic.pcre
> >     127.0.0.1:10026 inet  n   -       n       -       -       smtpd
> >     -o receive_override_options=no_address_mappings,no_milters
> > 
> > /etc/postfix/foobar_generic.pcre:
> >     /^From: something/      REPLACE From: something
> > 
> > This assumes that you aren't already using FILTER for other purposes.
> > 
> > References:
> > http://www.postfix.org/FILTER_README.html
> > http://www.postfix.org/master.5.html
> > http://www.postfix.org/postconf.5.html#receive_override_options
> > http://www.postfix.org/postconf.5.html#smtp_generic_maps
> > http://www.postfix.org/generic.html
> > http://www.postfix.org/pcre_table.html
> > 
> >     Wietse
> 
> 
> -----------------------------------------------
> Stavebna fakulta STU, Bratislava
> Faculty of Civil Engineering STU, Bratislava
> http://www.svf.stuba.sk
> 
> 
> 
> 

Reply via email to