Lines Matching refs:state

12 /*	int	smtpd_sasl_auth_cmd(state, argc, argv)
13 /* SMTPD_STATE *state;
17 /* void smtpd_sasl_auth_extern(state, username, method)
18 /* SMTPD_STATE *state;
22 /* void smtpd_sasl_auth_reset(state)
23 /* SMTPD_STATE *state;
25 /* char *smtpd_sasl_mail_opt(state, sender)
26 /* SMTPD_STATE *state;
29 /* void smtpd_sasl_mail_reset(state)
30 /* SMTPD_STATE *state;
32 /* static int permit_sasl_auth(state, authenticated, unauthenticated)
33 /* SMTPD_STATE *state;
42 /* the following state structure members:
73 /* .IP state
151 int smtpd_sasl_auth_cmd(SMTPD_STATE *state, int argc, SMTPD_TOKEN *argv)
157 if (var_helo_required && state->helo_name == 0) {
158 state->error_mask |= MAIL_ERROR_POLICY;
159 smtpd_chat_reply(state, "503 5.5.1 Error: send HELO/EHLO first");
162 if (SMTPD_STAND_ALONE(state) || !smtpd_sasl_is_active(state)
163 || (state->ehlo_discard_mask & EHLO_MASK_AUTH)) {
164 state->error_mask |= MAIL_ERROR_PROTOCOL;
165 smtpd_chat_reply(state, "503 5.5.1 Error: authentication not enabled");
168 if (SMTPD_IN_MAIL_TRANSACTION(state)) {
169 state->error_mask |= MAIL_ERROR_PROTOCOL;
170 smtpd_chat_reply(state, "503 5.5.1 Error: MAIL transaction in progress");
173 if (state->milters != 0 && (err = milter_other_event(state->milters)) != 0) {
175 state->error_mask |= MAIL_ERROR_POLICY;
176 smtpd_chat_reply(state, "%s", err);
181 state->error_mask |= MAIL_ERROR_POLICY;
182 smtpd_chat_reply(state, "454 4.3.0 Try again later");
187 if (var_smtpd_tls_auth_only && !state->tls_context) {
188 state->error_mask |= MAIL_ERROR_PROTOCOL;
190 smtpd_chat_reply(state, "504 5.5.4 Encryption required for requested authentication mechanism");
194 if (state->sasl_username) {
195 state->error_mask |= MAIL_ERROR_PROTOCOL;
196 smtpd_chat_reply(state, "503 5.5.1 Error: already authenticated");
200 state->error_mask |= MAIL_ERROR_PROTOCOL;
201 smtpd_chat_reply(state, "501 5.5.4 Syntax: AUTH mechanism");
208 if (state->flags & SMTPD_FLAG_AUTH_USED) {
209 smtpd_sasl_deactivate(state);
211 if (state->tls_context != 0)
212 smtpd_sasl_activate(state, VAR_SMTPD_SASL_TLS_OPTS,
216 smtpd_sasl_activate(state, VAR_SMTPD_SASL_OPTS,
219 state->flags |= SMTPD_FLAG_AUTH_USED;
229 return (smtpd_sasl_authenticate(state, auth_mechanism, initial_response));
234 char *smtpd_sasl_mail_opt(SMTPD_STATE *state, const char *addr)
241 if (state->sasl_username == 0) {
242 state->error_mask |= MAIL_ERROR_PROTOCOL;
246 if (state->sasl_sender != 0) {
247 state->error_mask |= MAIL_ERROR_PROTOCOL;
251 state->sasl_sender = mystrdup(addr);
252 printable(state->sasl_sender, '?');
259 void smtpd_sasl_mail_reset(SMTPD_STATE *state)
261 if (state->sasl_sender) {
262 myfree(state->sasl_sender);
263 state->sasl_sender = 0;
269 int permit_sasl_auth(SMTPD_STATE *state, int ifyes, int ifnot)
271 if (state->sasl_method && strcasecmp(state->sasl_method, "anonymous"))