David B?rgin:
> Previously in a milter I have used presence of sendmail macro
> "{auth_authen}" to decide whether a sender is authenticated.
>
> Now, in another milter I am using presence of macro "{auth_type}" to
> make that decision.
>
> What is the recommended way of telling whether a sender is authenticated
> using sendmail macros? Is one of the auth macros a better choice, or is
> it the case that if one is defined all of them are?
{auth_author} is usually empty; the other {auth_*} macros contain
information from a successful client's AUTH request.
Postfix supports these {auth_*} macros:
#define S8_MAC_AUTH_TYPE "{auth_type}" /* SASL method */
#define S8_MAC_AUTH_AUTHEN "{auth_authen}" /* SASL username */
#define S8_MAC_AUTH_AUTHOR "{auth_author}" /* SASL sender */
They contain the expected ihformation:
if (strcmp(name, S8_MAC_AUTH_TYPE) == 0)
return (IF_SASL_ENABLED(state->sasl_method));
if (strcmp(name, S8_MAC_AUTH_AUTHEN) == 0)
return (IF_SASL_ENABLED(state->sasl_username));
if (strcmp(name, S8_MAC_AUTH_AUTHOR) == 0)
return (IF_SASL_ENABLED(state->sasl_sender));
They are sent during MAIL FROM:
milter_mail_macros = i {auth_type} {auth_authen} {auth_author} {mail_addr}
{mail_host} {mail_mailer}
Wietse