0

i am using postfix 3.3.0 i have in main.cf

smtpd_command_filter = pcre:/etc/postfix/command_filter

in comman_filter

/^(RCPT\s+TO:\s*<(.*)@domaina.com>)/  RCPT TO:<$2@domainb.com>

whene querying postmap -q "RCPT TO: <user9@domaina.com>" pcre:/etc/postfix/command_filter it works just fine

output: RCPT TO: <user9@domainb.com>

i have executed postmap /etc/postfix/command_filter and restarted postfix

and still no effect on postfix smtp telnet remote hist and send rcpt command

Maybe I’m missing something.

It has to be done this way not by hash maps redirect domain 
Hichem
  • 101
  • 3
  • Why are you using the [`smtpd_command_filter`](https://www.postfix.org/postconf.5.html#smtpd_command_filter) in the first place? It is *a last-resort tool to work around client commands that break interoperability with the Postfix SMTP server*. There are better options for aliases. – Esa Jokinen Jan 23 '23 at 17:41
  • @EsaJokinen thanks for the advice in fact i don’t want to use maps hash domain redirect because I’m using transport and it’s long story basicly i want to do two transport same domain it has to be done in rcpt command rewrite when postfix’s smtp telnet the remote host and sends rcpt command – Hichem Jan 23 '23 at 17:49
  • 2
    It still sure sounds like an XY problem. – Esa Jokinen Jan 23 '23 at 19:17

0 Answers0