Jay Lee writes:
Jay Lee wrote:
OK, I've contacted the Thunderbird developers and they are fixing the
issue in their trunk, 3.0 code but not in 2.0.x. I need something in
place sooner than that though and changing Courier's error response
seems to be the easier quick fix. Any hints on how to include the
recipient address in the error? I've found the relevant error message
in courier/module.local/local.c line 412, but I'm not sure which
variable would carry the recipient address. Could anybody help with that?
bump. Can anyone help me with this? My C isn't all that great. I'm
not looking for an official patch to Courier, just a workaround that I
can use on my system until TB get 3.0 out the door.
It's not that straightforward. That part of code is fairly tight C. By the
time you end up here, the buffer that holds the original recipient address
has been destroyed -- line 395.
Furthermore, this is fairly low level, “bare bones”, C. Changing it is
painful. This is my best shot -- untested -- caveat emptor:
diff -U3 -r1.25 local.c
--- local.c 12 Aug 2006 02:06:35 -0000 1.25
+++ local.c 21 Sep 2007 03:39:02 -0000
@@ -392,7 +392,6 @@
not_found:
if (hostdomain) free(hostdomain);
- free(addr);
/*
** When submit is being called by the sendmail command line,
@@ -406,10 +405,21 @@
(strcmp(rwi->smodule, "local") == 0 ||
strcmp(rwi->smodule, "uucp") == 0))
{
+ free(addr);
(*delfunc)(rwi, rwi->ptr, rwi->ptr);
return;
}
- (*rwi->err_func)(550, "User unknown.", rwi);
+
+ {
+ char buf[256];
+
+ buf[255]=0;
+
+ snprintf(buf, 255, "User <%s> unknown", addr);
+ free(addr);
+
+ (*rwi->err_func)(550, buf, rwi);
+ }
return;
}