}
}
+void smtp_reply_write_one_line(string_t *out, const struct smtp_reply *reply)
+{
+ const char *enh_code = smtp_reply_get_enh_code(reply);
+ const char *const *lines;
+
+ i_assert(reply->status < 560);
+ i_assert(reply->enhanced_code.x < 6);
+
+ str_printfa(out, "%03u", reply->status);
+ if (enh_code != NULL) {
+ str_append_c(out, ' ');
+ str_append(out, enh_code);
+ }
+
+ lines = reply->text_lines;
+ while (*lines != NULL) {
+ str_append_c(out, ' ');
+ str_append(out, *lines);
+ lines++;
+ }
+}
+
const char *smtp_reply_log(const struct smtp_reply *reply)
{
const char *const *lines;
const char *
smtp_reply_get_enh_code(const struct smtp_reply *reply);
+
+/* Write the SMTP reply as a sequence of lines according to the SMTP syntax,
+ each terminated by CRLF. */
void smtp_reply_write(string_t *out, const struct smtp_reply *reply);
+/* Write the SMTP reply as a single line without CRLF, even when it consists
+ of multiple lines. This function cannot be used with internal client error
+ replies (status code >= 560). */
+void smtp_reply_write_one_line(string_t *out, const struct smtp_reply *reply);
+/* Create a log line from the SMTP reply. This also properly handles internal
+ client error replies (status_code >= 560). */
const char *smtp_reply_log(const struct smtp_reply *reply);
void smtp_reply_copy(pool_t pool, struct smtp_reply *dst,