[Exim] defer messages in authenticator

Pàgina inicial
Delete this message
Reply to this message
Autor: cboye
Data:  
A: exim-users
Assumpte: [Exim] defer messages in authenticator
--
I will use smtp authentication with ldap lookup. If the autenticated user
has an entry in the ldap database, the authentication ist correct. But if
no entry exists or the lookup or string expansion fails, exim gave a defer
message to the client. This message contains the whole lookup string. This
is not so fine...

I have written a patch against exim, which adds a new option 'defer_msg'
to the autheticator. With defer_msg you can specify your own defer message
(eg. 'permission denied'). This will override the original exim defer
message and everything is good.

Christian Boye


--
--- structs.h.orig    Wed Dec 19 12:50:30 2001
+++ structs.h    Sun Jan  6 12:28:54 2002
@@ -387,6 +387,7 @@
   char *public_name;             /* Advertised name */
   char *set_id;                  /* String to set as authenticated id */
   char *mail_auth_condition;     /* Condition for AUTH on MAIL command */
+  char *defer_msg;               /* String to set as defer message */
   BOOL  client;                  /* TRUE if client option(s) set */
   BOOL  server;                  /* TRUE if server options(s) set */
 } auth_instance;
--- globals.c.orig    Wed Dec 19 12:50:28 2001
+++ globals.c    Sun Jan  6 12:25:30 2002
@@ -49,6 +49,8 @@
 data blocks and hence have the opt_public flag set. */


 optionlist optionlist_auths[] = {
+  { "defer_msg",     opt_stringprt | opt_public,
+                 (void *)(offsetof(auth_instance, defer_msg)) },
   { "driver",        opt_stringptr | opt_public,
                  (void *)(offsetof(auth_instance, driver_name)) },
   { "public_name",   opt_stringptr | opt_public,
@@ -151,6 +153,7 @@
    NULL,                      /* public_name */
    NULL,                      /* set_id */
    NULL,                      /* server_mail_auth_condition */
+   NULL,                      /* defer_msg */
    FALSE,                     /* client */
    FALSE                      /* server */
 };
--- smtp_in.c.orig    Wed Dec 19 12:50:30 2001
+++ smtp_in.c    Sun Jan  6 12:27:30 2002
@@ -1951,6 +1951,11 @@
       break;


       case DEFER:
+      if (au->defer_msg != NULL &&
+         (auth_defer_msg = expand_string(au->defer_msg)) == NULL)
+      {
+      auth_defer_msg = expand_string_message;
+      }
       s = string_sprintf("435 Unable to authenticate at present: %s",
         auth_defer_msg);
       break;
--