The EHLO command (from SMTP) doesn't work remotely with a Postfix

Translation of the original in Catalan. Read it in: CatalàCastellano

Exactly the problem I describe in the title made me waste a good while this morning, in fact, it drove me up the wall. I was going crazy connecting to port 25 from inside the LAN:

$ telnet IP_XARXA_LOCAL 25
Trying IP_XARXA_LOCAL...
Connected to IP_XARXA_LOCAL.
Escape character is '^]'.
220 ESMTP
ehlo prova
250-nom_servidor
250-PIPELINING
250-SIZE 20480000
250-ETRN
250-AUTH LOGIN PLAIN
250-AUTH=LOGIN PLAIN
250 8BITMIME
quit
221 Bye
Connection closed by foreign host.

If I connected from an IP outside the local network:

$ telnet IP_PUBLICA 25
Trying IP_PUBLICA...
Connected to IP_PUBLICA.
Escape character is '^]'.
220 ******************
ehlo prova
502 Error: command not implemented
quit
221 Bye
Connection closed by foreign host.

I went over the postfix documentation hundreds of times to see which option was making the SMTP server behave differently whether it was on a local network IP or an IP external to the network. But I found nothing at all, in the end I found in a forum divine inspiration. The problem was that damn Cisco PIX I had in between. The bastard was filtering my connection!!!

So I had to connect to the PIX and tell it to stop treating port 25 traffic as SMTP traffic, so that it wouldn't apply any filter to it:

pix # show fixup
fixup protocol dns maximum-length 512
fixup protocol ftp 21
fixup protocol h323 h225 1720
fixup protocol h323 ras 1718-1719
fixup protocol http 80
fixup protocol rsh 514
fixup protocol rtsp 554
fixup protocol sip 5060
fixup protocol sip udp 5060
fixup protocol skinny 2000
fixup protocol smtp 25
fixup protocol sqlnet 1521
fixup protocol tftp 69
pix # conf te
pix(config)# no fixup protocol smtp 25

With just that silly little thing I could already greet the postfix (SMTP server) with the EHLO command, which lets me run authentications and other advanced SMTP commands (ESMTP).

1 comment

Comments from the old blog, as they were written. Comments are closed.

  1. anthrax

    Jeje, cisco pix rules!

    A la versió de finesse 6.3 amb el fixup al port smtp permet poques comandes smtp. Ni smtp auth, ni ehlo ni histories xD

    A les versión 7.X amb la comanda fixup es permet unes cuantes comandes més :)

    Pablo