Proniewski Patrick: > Hello, > > I used to have a old SMTP server, with after-queue content filtering. > My new setup involve a before-queue content filter (amavisd). > Unfortunately, Amavisd is a little bit strict about the smtp > session: it bounces email sent using "MAIL FROM: address" instead > of "MAIL FROM:<address>". > It's ok for my all my clients but one. It's an appliance, so I > cannot change anything about its way to handle SMTP protocol.
Besides making this configurable for Amavisd-new, the other option is to use the Postfix 2.7 smtpd_command_filter feature to replace the RCPT TO command very carefully. If the applicance sends mail to only one address, be sure to modify only that RCPT TO command and nothing else. Wietse smtpd_command_filter (default: empty) A mechanism to transform commands from remote SMTP clients. This is a last-resort tool to work around client commands that break inter-oper- ability with the Postfix SMTP server. Other uses involve fault injec- tion to test Postfix's handling of invalid commands. Specify the name of a "type:table" lookup table. The search string is the SMTP command as received from the remote SMTP client, except that initial whitespace and the trailing <CR><LF> are removed. The result value is executed by the Postfix SMTP server. There is no need to use smtpd_command_filter for the following cases: o Use "resolve_numeric_domain = yes" to accept "u...@ipaddress". o Postfix already accepts the correct form "u...@[ipaddress]". Use virtual_alias_maps or canonical_maps to translate these into domain names if necessary. o Use "strict_rfc821_envelopes = no" to accept "RCPT TO:<User Name <u...@example.com>>". Postfix will ignore the "User Name" part and deliver to the <u...@example.com> address. Examples of problems that can be solved with the smtpd_command_filter feature: /etc/postfix/main.cf: smtpd_command_filter = pcre:/etc/postfix/command_filter /etc/postfix/command_filter: # Work around clients that send malformed HELO commands. /^HELO\s*$/ HELO domain.invalid # Work around clients that send empty lines. /^\s*$/ NOOP # Work around clients that send RCPT TO:<'u...@domain'>. # WARNING: do not lose the parameters that follow the address. /^RCPT\s+TO:\s*<'([^[:space:]]+)'>(.*)/ RCPT TO:<$1>$2 # Bounce-never mail sink. Use notify_classes=bounce,resource,software # to send bounced mail to the postmaster (with message body removed). /^(RCPT\s+TO:.*?)\bNOTIFY=\S+\b(.*)/ $1 NOTIFY=NEVER $2 /^(RCPT\s+TO:.*)/ $1 NOTIFY=NEVER This feature is available in Postfix 2.7.