Lines Matching refs:state
11 /* void smtpd_state_init(state, stream, service)
12 /* SMTPD_STATE *state;
16 /* void smtpd_state_reset(state)
17 /* SMTPD_STATE *state;
24 /* .IP state
80 void smtpd_state_init(SMTPD_STATE *state, VSTREAM *stream,
85 * Initialize the state information for this connection, and fill in the
88 state->flags = 0;
89 state->err = CLEANUP_STAT_OK;
90 state->client = stream;
91 state->service = mystrdup(service);
92 state->buffer = vstring_alloc(100);
93 state->addr_buf = vstring_alloc(100);
94 state->conn_count = state->conn_rate = 0;
95 state->error_count = 0;
96 state->error_mask = 0;
97 state->notify_mask = name_mask(VAR_NOTIFY_CLASSES, mail_error_masks,
99 state->helo_name = 0;
100 state->queue_id = 0;
101 state->cleanup = 0;
102 state->dest = 0;
103 state->rcpt_count = 0;
104 state->access_denied = 0;
105 state->history = 0;
106 state->reason = 0;
107 state->sender = 0;
108 state->verp_delims = 0;
109 state->recipient = 0;
110 state->etrn_name = 0;
111 state->protocol = mystrdup(MAIL_PROTO_SMTP);
112 state->where = SMTPD_AFTER_CONNECT;
113 state->recursion = 0;
114 state->msg_size = 0;
115 state->act_size = 0;
116 state->junk_cmds = 0;
117 state->rcpt_overshoot = 0;
118 state->defer_if_permit_client = 0;
119 state->defer_if_permit_helo = 0;
120 state->defer_if_permit_sender = 0;
121 state->defer_if_reject.dsn = 0;
122 state->defer_if_reject.reason = 0;
123 state->defer_if_permit.dsn = 0;
124 state->defer_if_permit.reason = 0;
125 state->discard = 0;
126 state->expand_buf = 0;
127 state->prepend = 0;
128 state->proxy = 0;
129 state->proxy_mail = 0;
130 state->saved_filter = 0;
131 state->saved_redirect = 0;
132 state->saved_bcc = 0;
133 state->saved_flags = 0;
135 state->saved_delay = 0;
137 state->instance = vstring_alloc(10);
138 state->seqno = 0;
139 state->rewrite_context = 0;
141 state->ehlo_discard_mask = ~0;
143 state->ehlo_discard_mask = 0;
145 state->dsn_envid = 0;
146 state->dsn_buf = vstring_alloc(100);
147 state->dsn_orcpt_buf = vstring_alloc(100);
150 state->tlsproxy = 0;
152 state->tls_context = 0;
160 if (SMTPD_STAND_ALONE(state))
162 smtpd_sasl_set_inactive(state);
163 smtpd_sasl_state_init(state);
166 state->milter_argv = 0;
167 state->milter_argc = 0;
168 state->milters = 0;
173 smtpd_peer_init(state);
178 smtpd_xforward_init(state);
183 smtpd_chat_reset(state);
185 state->ehlo_argv = 0;
186 state->ehlo_buf = 0;
191 state->bdat_state = SMTPD_BDAT_STAT_NONE;
192 state->bdat_get_stream = 0;
193 state->bdat_get_buffer = 0;
198 void smtpd_state_reset(SMTPD_STATE *state)
206 if (state->service)
207 myfree(state->service);
208 if (state->buffer)
209 vstring_free(state->buffer);
210 if (state->addr_buf)
211 vstring_free(state->addr_buf);
212 if (state->access_denied)
213 myfree(state->access_denied);
214 if (state->protocol)
215 myfree(state->protocol);
216 smtpd_peer_reset(state);
222 if (state->defer_if_permit.dsn)
223 vstring_free(state->defer_if_permit.dsn);
224 if (state->defer_if_permit.reason)
225 vstring_free(state->defer_if_permit.reason);
226 if (state->defer_if_reject.dsn)
227 vstring_free(state->defer_if_reject.dsn);
228 if (state->defer_if_reject.reason)
229 vstring_free(state->defer_if_reject.reason);
230 if (state->expand_buf)
231 vstring_free(state->expand_buf);
232 if (state->instance)
233 vstring_free(state->instance);
234 if (state->dsn_buf)
235 vstring_free(state->dsn_buf);
236 if (state->dsn_orcpt_buf)
237 vstring_free(state->dsn_orcpt_buf);
239 if (state->tlsproxy) /* still open after longjmp */
240 vstream_fclose(state->tlsproxy);
246 if (state->bdat_get_stream)
247 (void) vstream_fclose(state->bdat_get_stream);
248 if (state->bdat_get_buffer)
249 vstring_free(state->bdat_get_buffer);