Hi all:

        Today I tried to recompile qmail-smtpd to make it recognize the ETRN
command, following Anand Buddhdev's mail to this list from last june
(BTW: thanks for your clarification about setlock). I already have
serialmail and AutoTURN set up, and this change was just so that
qmail-smtpd didn't answer an "Unimplemented" to the clients that sent an
ETRN command.
        The patch that Anand proposed in his mail was, from what I can see,
trivial:

        -Add an ", { "etrn", smtp_etrn, flush }" line to the "smtpcommands
part.
        -Add a smtp_etrn function, that just returns "250 ok".
        -Add "ETRN" to the line that advertises the capabilities of the server.

        I'm adding the diff below, at the end of the mail. Even for a complete
C ignorant like me, it should be obvious that the above mentiond changes
are trivial. Right? Well, I compile it, substitute for old binary
(stopping qmail-smtpd first, of course)... and all hell breaks loose.
        A few minutes later, my coworkers tell me that they can't send mail
using Netscape, which gives a "Protocol error" or some other similarly
unhelpful message. Outlook Express, Eudora and manually telnetting to
port 25 can send mail fine. We also check that the sendmail server of
one of our customers, which receives mail for another domain, can't send
mail to our server, leaving an error message that says: "SMTP DATA-1
protocol error: 250 ok".
        Since the mail server is in production and we're on office hours, we
can't really experiment too much, so I copy over the old qmail-smtpd
binary. Then, minutes later, I try to recompile the patched
qmail-smtpd.c again, taking extra care this time to delete all the
object files that existed from the last compilation (I think I deleted
them the first time, but just in case...). The result is exactly the
same.
        Now the question: why does this happen? Not that it's a life or death
matter, since AutoTURN is working anyway, but I just can't understand
how such a trivial patch can cause these problems. Maybe one of the "250
ok" messages in the source has a newline or return carriage missing (or
has an extra one), but I just checked, and all the ones added by the
patch end in "\r\n", so...
        (I'm using Linux 2.0.34 with GCC 2.7.2. I used the same environment to
compile the qmail 1.03 that we use and didn't have any problems).
        Oh, yes, the diff between the modified qmail-smtpd.c and the original
one:


74,77d73
< void smtp_etrn()
< {
<   out("250 ok\r\n");
< }
236,237c232
<   smtp_greet("250-"); 
<   out("\r\n250-PIPELINING\r\n250 8BITMIME\r\n250 ETRN\r\n");
---
>   smtp_greet("250-"); out("\r\n250-PIPELINING\r\n250 8BITMIME\r\n");
413d407
< , { "etrn", smtp_etrn, flush }




                                                Paulo Jan.
                                                DDnet.

Reply via email to