rewrite of clients from and to

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

rewrite of clients from and to

Firma Averlon

Dear all,

I have a client in my network, a technical device, which I can only set some parameters to send mails (mailserver, port, sender-address, receipient-address, …), but not manipulate or administrate.

 

I have a Postfix installation in my INTRANET, using port 25, just to get e-Mails from clients and relay them to some relay-host of my provider.

 

In general, the postfix works.

 

The client sends a curious telnet command string and I would need to manipulate that when it is received by postfix to be able to perform the relay conrrect.

 

+++

SMTP 70 C: MAIL FROM:<1e>                                    

SMTP 68 S: 250 2.1.0 Ok                                      

SMTP 67 C: RCPT TO:<D>                                       

SMTP 68 S: 250 2.1.5 Ok                                      

SMTP 72 C: RCPT TO:<status>                                  

SMTP 68 S: 250 2.1.5 Ok                                      

SMTP 77 C: RCPT TO:<diagnostics>                             

SMTP 68 S: 250 2.1.5 Ok                                      

SMTP 70 C: RCPT TO:<ping>                                    

SMTP 68 S: 250 2.1.5 Ok                                      

SMTP 105 C: RCPT TO:<ping google-public-dns-a.google.com 1 1>

SMTP 94 S: 501 5.1.3 Bad recipient address syntax            

SMTP 60 C: QUIT                                              

+++

 

This is the communication of the client.

 

Now I would like to manipulate the “MAIL FROM” and the “RCPT TO” to some form that works and eliminate the “ping …..” at all.

 

I have tried with

canonical_maps = regexp:/etc/postfix/av_canonical.cf

e.g.:

/^send.*/ [hidden email]

local_header_rewrite_clients = permit_mynetworks

sender_canonical_maps = regexp:/etc/postfix/av_sender_canonical.cf

e.g:

/^1e.*/ [hidden email] ##### comment: the “1” is a one, not a letter “l”.

recipient_canonical_maps = regexp:/etc/postfix/av_recipient_canonical.cf

e.g.:

/^send.*/ [hidden email]

 

but had not success.

 

I would like you to give me advice how to get it done.

Thanks in advance

 

Kallewirsch

Reply | Threaded
Open this post in threaded view
|

Re: rewrite of clients from and to

Noel Jones-2
On 1/29/2020 9:26 AM, Averlon wrote:

> Dear all,
>
> I have a client in my network, a technical device, which I can only
> set some parameters to send mails (mailserver, port, sender-address,
> receipient-address, …), but not manipulate or administrate.
>
> I have a Postfix installation in my INTRANET, using port 25, just to
> get e-Mails from clients and relay them to some relay-host of my
> provider.
>
> In general, the postfix works.
>
> The client sends a curious telnet command string and I would need to
> manipulate that when it is received by postfix to be able to perform
> the relay conrrect.
>
> +++
>
> SMTP 70 C: MAIL FROM:<1e>
>
> SMTP 68 S: 250 2.1.0 Ok
>
> SMTP 67 C: RCPT TO:<D>
>
> SMTP 68 S: 250 2.1.5 Ok
>
> SMTP 72 C: RCPT TO:<status>
>
> SMTP 68 S: 250 2.1.5 Ok
>
> SMTP 77 C: RCPT TO:<diagnostics>
>
> SMTP 68 S: 250 2.1.5 Ok
>
> SMTP 70 C: RCPT TO:<ping>
>
> SMTP 68 S: 250 2.1.5 Ok
>
> SMTP 105 C: RCPT TO:<ping google-public-dns-a.google.com 1 1>
>
> SMTP 94 S: 501 5.1.3 Bad recipient address syntax
>
> SMTP 60 C: QUIT
>
> +++
>
> This is the communication of the client.
>
> Now I would like to manipulate the “MAIL FROM” and the “RCPT TO” to
> some form that works and eliminate the “ping …..” at all.
>
> I have tried with
>
> canonical_maps = regexp:/etc/postfix/av_canonical.cf



Look at
http://www.postfix.org/postconf.5.html#smtpd_command_filter



   -- Noel Jones