f



How to work with PERM/TEMP failures on socket map (or LDAP map or HOST map)

Hello,

I have a misunderstanding of the socket map protocol as written in op,
which is the same as stated in this post:
http://groups.google.com/group/comp.mail.sendmail/browse_thread/thread/f91016c9b8d92c61/a392fcbdbf57a50d?hl=en

When a socket map returns PERM or TEMP, the code stuffs the fact into
a stat pointer, the explanatory message is dropped. In the end I have
the following entry in a sendmail -d session:

map_lookup(reroute, key) => NOT FOUND (69)


but the socket map returned

PERM No such map

Funnily I found similiar in the host map, too:

map_lookup(host, myhost) => host_map_lookup(myhost) => FAIL (1)
NOT FOUND (68)

The host was not found, but the recipient accepted anyway.

I dimmly remember a problem some time ago, when the virtuser map using
the LDAP map directly rejected everybody, because the LDAP server
returned an error (rather than a nothing found) response. I guess, it
leads to the same problem.

===

So, I expected PERM responses from the socket map to generate 5xx and
TEMP responses 4xx errors. Sort of, as it is performed for
communication errors.

So, is the virtuser map expected to return
OK error: ...
instead of PERM/TEMP errors? Can you 100% differ TEMP/PERM/OK cases
with -ax and -Ty map options? I mean, PERM returns an empty string,
TEMP returns just y, and OK returns the arbitary string appended with
x?

ska
0
skg34 (195)
9/1/2008 8:41:38 AM
comp.mail.sendmail 13518 articles. 1 followers. jfretby (35) is leader. Post Follow

4 Replies
782 Views

Similar Articles

[PageSpeed] 8

Maybe, I should also add:

Is there a tutorial about socket maps?

The contrib/socketmapServer.pl is returning either OK or NOTFOUND,
just in the line of sendmail...

ska
0
skg34 (195)
9/1/2008 9:11:24 AM
I re-ran sendmail with -d38.5 :

map_lookup(reroute, key) => socket_map_lookup(reroute, key): server
returned error: type=PERM, reason=Unsupported map reroute
NOT FOUND (69)

In my mind, "NOT FOUND" is definitely wrong for a PERM _failure_, isn
it?

ska
0
skg34 (195)
9/1/2008 9:25:18 AM
ska <skg@mail.inf.fh-brs.de> wrote:
> [...]
> So, is the virtuser map expected to return
> OK error: ...
> instead of PERM/TEMP errors? Can you 100% differ TEMP/PERM/OK cases
> with -ax and -Ty map options? I mean, PERM returns an empty string,
> TEMP returns just y, and OK returns the arbitary string appended with
> x?

*IMHO*: 
In case of "virtusertable via socketmap" the simplest option is to make
socketmap server to generate virtusertable specific "error:..." replies.

P.S.
Do you volunteer to patch sendmail sources? ;-)

-- 
[pl>en Andrew] Andrzej Adam Filip : anfi@onet.eu : anfi@xl.wp.pl
"... And remember: if you don't like the news, go out and make some of
your own."
  -- "Scoop" Nisker, KFOG radio reporter Preposterous Words
0
anfi2 (1425)
9/1/2008 9:28:49 AM
Andrzej Adam Filip wrote:
> P.S.
> Do you volunteer to patch sendmail sources? ;-)

Last time I tried patching sendmail, there was no great interest and
no explanation I understood why my suggestion (to get .forward info
from LDAP) is plainly wrong.

So I would prefer hearing first, if to ignore PERM/TEMP info is
_expected_ behaviour and stays this way or if this is a design
decision still.

I suppose that hook is in sendmail/map.c:socket_map_lookup():

	if (strcmp(status, "OK") == 0)
	{
//snip
	}
	else if (strcmp(status, "NOTFOUND") == 0)
	{
//snip
	}
	else
	{
		if (tTd(38, 5))
			sm_dprintf("socket_map_lookup(%s, %s): server returned error: type=
%s, reason=%s\n",
				map->map_mname, key, status,
				value ? value : "");
		if ((strcmp(status, "TEMP") == 0) ||
		    (strcmp(status, "TIMEOUT") == 0)) {
			*statp = EX_TEMPFAIL;
syserr("451 4.3.0 %s", value);
}
		else { if(strcmp(status, "PERM") == 0)
			*statp = EX_UNAVAILABLE;
		else
			*statp = EX_PROTOCOL;
syserr("551 5.3.0 %s", value);
}
	}

With checks for value and possibly extract ### #.#.# from the value
(as done for OK error: entries in virtuser). I didn't look into LDAP,
though.

ska
0
skg34 (195)
9/1/2008 10:03:52 AM
Reply: