Re: [exim] Set connection macro at AUTH time

Página superior
Eliminar este mensaje
Responder a este mensaje
Autor: Robert Blayzor
Fecha:  
A: Exim Users
Asunto: Re: [exim] Set connection macro at AUTH time
On Jan 5, 2015, at 1:30 PM, Robert Blayzor <rblayzor.bulk@???> wrote:
>
> Consider the following:
>
> PLAIN:
>  driver                     = plaintext
>  server_set_id              = Q_AUTHPLAIN
>  server_prompts             = :
>  server_condition           = ${if !eq{Q_AUTHPLAIN}{}{true}{false}}

>
>
> Where Q_AUTHPLAIN is just a macro for some SQL that returns either an empty string on failure or the users email address if pass.
>
> Is there any way possible to return any other data/fields that can be passed and perhaps set a connection macro at this point? ie: Would it be possible to add multiple server_conditions/calls and return another field back from the database?
>
> Trying to find a way to possibly return other user variables back to be used later in the mail connection but would rather not make another query into the database if it can be avoided.



I believe I have found a work around for this. Currently "server_set_id" (authenticated_id) is set to the users email address, which comes from the database query. I simply changed the query to return "<email address>:x:y:z" and then I can just use a macro and replace where I normally use authenticated_id:

AUTH_ID = ${extract{1}{:}{${lc:$authenticated_id}}}

and then pull other values I need later:

${if >{foo}${extract{2}{:}{$authenticated_id}}} ...


Not sure of any caveats or implications, but seems to work fine.

--
Robert
inoc.net!rblayzor
http://inoc.net/