Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I'm running two milters on my current postfix installation. I'm noticing that, from one particular client, they are sending an invalid command consisting of the first 3 letters of their domain name. When postfix sees this, it causes my milters to exit out.

How can I proceed past this?

I've seen this on the postfix documentation, but am not sure how to apply it:

milter_unknown_command_macros (default: see "postconf -d" output)
The macros that are sent to version 3 or higher Milter (mail filter) applications after an unknown SMTP command. See MILTER_README for a list of available macro names and their meanings.

This feature is available in Postfix 2.3 and later.

Thanks

share|improve this question

1 Answer 1

up vote 1 down vote accepted

You could use smtpd_command_filter to exclude these bogus commands:

In /etc/postfix/main.cf:

smtpd_command_filter = pcre:/etc/postfix/bogus_commands

And in /etc/postfix/bogus_commands:

/[^ ]{3}/ NOOP

You may have to test the regex to fit your needs.

There are no SMTP commands that consist of 3 letters :)

share|improve this answer
    
i like this. i'll give it a shot later today. –  Larry G. Wapnitsky Apr 18 '12 at 10:25
    
i'm not a pcre guy, but this is replacing ALL commands that I enter with NOOP –  Larry G. Wapnitsky Apr 18 '12 at 14:19
    
this seems to work: /^[^ ]{3}\s.*/ –  Larry G. Wapnitsky Apr 18 '12 at 14:27
    
Yeah sorry about that - you have to match the non-character after the three initial characters to guarantee that it's ONLY three characters ;) –  adaptr Apr 18 '12 at 15:02

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.