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

This is a discussion on How to work with PERM/TEMP failures on socket map (or LDAP map orHOST map) within the SendMail forums in Other Technologies category; 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....bf57a50d?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 ...

Go Back   Application Development Forum > Other Technologies > SendMail

Object Mix

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 09-01-2008, 04:41 AM
ska
Guest
 
Default How to work with PERM/TEMP failures on socket map (or LDAP map orHOST 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....bf57a50d?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
Reply With Quote
  #2  
Old 09-01-2008, 05:11 AM
ska
Guest
 
Default Re: How to work with PERM/TEMP failures on socket map (or LDAP map orHOST map)

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
Reply With Quote
  #3  
Old 09-01-2008, 05:25 AM
ska
Guest
 
Default Re: How to work with PERM/TEMP failures on socket map (or LDAP map orHOST map)

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
Reply With Quote
  #4  
Old 09-01-2008, 05:28 AM
Andrzej Adam Filip
Guest
 
Default Re: How to work with PERM/TEMP failures on socket map (or LDAP map or HOST map)

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
Reply With Quote
  #5  
Old 09-01-2008, 06:03 AM
ska
Guest
 
Default Re: How to work with PERM/TEMP failures on socket map (or LDAP map orHOST map)

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
Reply With Quote
Reply


Thread Tools
Display Modes


All times are GMT -5. The time now is 10:02 PM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
vB Ad Management by =RedTyger=

In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.