+/****************************************************************************/
+/* rfc822 header parameters */
+/****************************************************************************/
+
+char *parameter_getval(parameter_t *parm, const char *s)
+{
+ while (parm) {
+ if (!ascii_strcasecmp(parm->attribute, s))
+ return parm->value;
+ parm = parm->next;
+ }
+ return NULL;
+}
+
+void parameter_setval(parameter_t **p, const char *attribute, const char *value)
+{
+ while (*p) {
+ if (!ascii_strcasecmp(attribute, (*p)->attribute)) {
+ if (value) {
+ m_strreplace(&(*p)->value, value);
+ } else {
+ parameter_t *q = parameter_list_pop(p);
+ parameter_delete(&q);
+ }
+ return;
+ }
+ p = &(*p)->next;
+ }
+
+ if (value) {
+ (*p) = parameter_new();
+ (*p)->attribute = m_strdup(attribute);
+ (*p)->value = m_strdup(value);
+ }
+}
+
+void parameter_delval(parameter_t **p, const char *attribute)
+{
+ while (*p) {
+ if (!ascii_strcasecmp(attribute, (*p)->attribute)) {
+ parameter_t *q = parameter_list_pop(p);
+ parameter_delete(&q);
+ return;
+ }
+
+ p = &(*p)->next;
+ }
+}
+
+int parameter_equal(const parameter_t *p1, const parameter_t *p2)