Hi,

[...]
> >My problem is that instead of the sender's email address, qmail-remote
puts
> ><........lo0.......> in the initial MAIL FROM: command when it forwards
an
> >email.
>
> qmail-remote doesn't make up envelope return paths. If it's using
> <........lo0.......>, that's because that's what the message had when
> it came in.

While the intent of qmail's code is NOT to make up a return path by itself,
in that case your statement is not true. I have spent some time lookup
through the code and tracing where that happens, and I found it.

There is a bug in the FreeBSD code that deals with "ifconf". What happens is
that  FreeBSD returns more data than was requested by qmail. This causes the
return path to be overwritten with garbage.


While the proper fix should be to repair FreeBSD, it has to be noted that
the method employed by qmail in the function ipme_init() to find the list of
all the interfaces of the system is really not the best. The code starts
with a 256 bytes buffer and then increments it gradually issueing a system
call each time to fill up the memory area with the proper information.

A size of 256 bytes is good enough in cases where you only have one
interface (in addition to lo0 of course). In my case, I have 8 interfaces so
to get it right the code has to do 5 iteration before it reads everything.

The quick fix is to allocate a fairly big chunk of memory (1500 bytes) right
from the start. This solves my problem. Also it would reduce the number of
system calls necessary to obtain the list of all the network interfaces. I
don't think that saving a few bytes is worth the number of system calls. Of
course the kernel needs to be fixed, but that's another story.


A patch that fixes my problem is included at the end of this email for
anybody to use if they encounter the same symptoms. Beware though that it
may not be working in all cases. It works in mine, that's all I can say.


>
> What is this? You really used abc.com, and its MX is 1.2.3.4? And the
> unbalanced '<' error is not the same as a sender of
> <........lo0.......>.


Yes the error is directly related to the problem I described. The remote end
of the SMTP connection tries to understand the sender's address and stops
processing it after 2 consecutive dots. It then complains that it did not
find the closing '>'. I just did a little bit of homework before asking a
question.



Patrick.



--- ipme.c.orig Fri Mar 10 17:15:58 2000
+++ ipme.c      Fri Mar 10 17:19:48 2000
@@ -48,7 +48,7 @@

   if ((s = socket(AF_INET,SOCK_STREAM,0)) == -1) return -1;

-  len = 256;
+  len = 2000;
   for (;;) {
     if (!stralloc_ready(&buf,len)) { close(s); return 0; }
     buf.len = 0;
@@ -60,7 +60,7 @@
         break;
       }
     if (len > 200000) { close(s); return -1; }
-    len += 100 + (len >> 2);
+    len *= 2;
   }
   x = buf.s;
   while (x < buf.s + buf.len) {

Reply via email to