bcb4e51a409d94ae670de96afb8483a4f7855294Stephan Bosch/* Copyright (c) 2013-2018 Dovecot authors, see the included COPYING file */
a8433392e8a5ddfe8a125716f62b2a4dc8f1f01eStephan Boschvoid smtp_reply_init(struct smtp_reply *reply, unsigned int status,
a8433392e8a5ddfe8a125716f62b2a4dc8f1f01eStephan Bosch const char **text_lines = t_new(const char *, 2);
a8433392e8a5ddfe8a125716f62b2a4dc8f1f01eStephan Boschvoid smtp_reply_printf(struct smtp_reply *reply, unsigned int status,
a8433392e8a5ddfe8a125716f62b2a4dc8f1f01eStephan Bosch const char *format, ...)
a8433392e8a5ddfe8a125716f62b2a4dc8f1f01eStephan Bosch smtp_reply_init(reply, status, t_strdup_vprintf(format, args));
a8433392e8a5ddfe8a125716f62b2a4dc8f1f01eStephan Boschsmtp_reply_get_enh_code(const struct smtp_reply *reply)
a8433392e8a5ddfe8a125716f62b2a4dc8f1f01eStephan Bosch reply->enhanced_code.x, reply->enhanced_code.y, reply->enhanced_code.z);
a8433392e8a5ddfe8a125716f62b2a4dc8f1f01eStephan Boschsmtp_reply_write(string_t *out, const struct smtp_reply *reply)
a8433392e8a5ddfe8a125716f62b2a4dc8f1f01eStephan Bosch prefix = t_strdup_printf("%03u", reply->status);
a8433392e8a5ddfe8a125716f62b2a4dc8f1f01eStephan Bosch if (reply->text_lines == NULL || *reply->text_lines == NULL) {
57b18ecb6fdfa9f8503fc00a6869763e6ffcecb2Stephan Boschvoid smtp_reply_write_one_line(string_t *out, const struct smtp_reply *reply)
57b18ecb6fdfa9f8503fc00a6869763e6ffcecb2Stephan Bosch const char *enh_code = smtp_reply_get_enh_code(reply);
a8433392e8a5ddfe8a125716f62b2a4dc8f1f01eStephan Boschconst char *smtp_reply_log(const struct smtp_reply *reply)
a8433392e8a5ddfe8a125716f62b2a4dc8f1f01eStephan Bosch const char *enh_code = smtp_reply_get_enh_code(reply);
a8433392e8a5ddfe8a125716f62b2a4dc8f1f01eStephan Boschvoid smtp_reply_copy(pool_t pool, struct smtp_reply *dst,
a8433392e8a5ddfe8a125716f62b2a4dc8f1f01eStephan Bosch dst->text_lines = p_strarray_dup(pool, src->text_lines);