str_array_icase_find(extensions, param.keyword)) {
/* add the rest to ext_param for specific
applications */
- if (!array_is_created(¶ms_r->extra_params))
- p_array_init(¶ms_r->extra_params, pool, 4);
- param.keyword = p_strdup(pool, param.keyword);
- param.value = p_strdup(pool, param.value);
- array_append(¶ms_r->extra_params, ¶m, 1);
+ smtp_params_mail_add_extra(params_r, pool,
+ param.keyword, param.value);
} else {
/* RFC 5321, Section 4.1.1.11:
If the server SMTP does not recognize or cannot
}
}
+void smtp_params_mail_add_extra(struct smtp_params_mail *params, pool_t pool,
+ const char *keyword, const char *value)
+{
+ struct smtp_param param;
+
+ if (!array_is_created(¶ms->extra_params))
+ p_array_init(¶ms->extra_params, pool, 4);
+
+ i_zero(¶m);
+ param.keyword = p_strdup(pool, keyword);
+ param.value = p_strdup(pool, value);
+ array_append(¶ms->extra_params, ¶m, 1);
+}
+
/* write */
static void
str_array_icase_find(extensions, param.keyword)) {
/* add the rest to ext_param for specific applications
*/
- if (!array_is_created(¶ms_r->extra_params))
- p_array_init(¶ms_r->extra_params, pool, 4);
- param.keyword = p_strdup(pool, param.keyword);
- param.value = p_strdup(pool, param.value);
- array_append(¶ms_r->extra_params, ¶m, 1);
+ smtp_params_rcpt_add_extra(params_r, pool,
+ param.keyword, param.value);
} else {
/* RFC 5321, Section 4.1.1.11:
If the server SMTP does not recognize or cannot
}
}
+void smtp_params_rcpt_add_extra(struct smtp_params_rcpt *params, pool_t pool,
+ const char *keyword, const char *value)
+{
+ struct smtp_param param;
+
+ if (!array_is_created(¶ms->extra_params))
+ p_array_init(¶ms->extra_params, pool, 4);
+
+ i_zero(¶m);
+ param.keyword = p_strdup(pool, keyword);
+ param.value = p_strdup(pool, value);
+ array_append(¶ms->extra_params, ¶m, 1);
+}
+
/* write */
static void
struct smtp_params_mail *dst, const struct smtp_params_mail *src)
ATTR_NULL(3);
+void smtp_params_mail_add_extra(struct smtp_params_mail *params, pool_t pool,
+ const char *keyword, const char *value);
+
+/* write */
+
void smtp_params_mail_write(string_t *buffer,
enum smtp_capability caps,
const struct smtp_params_mail *params);
struct smtp_params_rcpt *dst, const struct smtp_params_rcpt *src)
ATTR_NULL(3);
+void smtp_params_rcpt_add_extra(struct smtp_params_rcpt *params, pool_t pool,
+ const char *keyword, const char *value);
+
+/* write */
+
void smtp_params_rcpt_write(string_t *buffer,
enum smtp_capability caps,
const struct smtp_params_rcpt *params);