I haven't seen any mention of this, but for some reason in my limited "testing" of filters I have to use \r\n in my responses to smtpd. Is this normal? Doesn't seem to be documented and what filters I've looked at don't appear to be using \r\n.

For example without ORS = "\r\n" the following script will cause smtpd to basically just hang. There is no errors reported, but when I attempt to telnet localhost 25 the daemon doesn't greet me. After adding ORS = "\r\n" everything works as expected.

#!/usr/bin/awk -f
BEGIN {
        ARGC = 0
        FS = "|"
        OFS = FS
        ORS = "\r\n"
}

"config|ready" == $0 {
        print "register|report|smtp-in|*"
        print "register|ready"
        print $0 >> "/tmp/report.txt"
        next
}

"config" == $1 {
        next
}

"report" == $1 {
        print $0 >> "/tmp/report.txt"
        next
}


Reply via email to