mexport: handle return-path without <>

pull/37/head
Leah Neukirchen 7 years ago
parent 98a40b5dd3
commit c15ed7a168

@ -46,11 +46,15 @@ export(char *file)
if ((v = blaze822_hdr(msg, "return-path")) || if ((v = blaze822_hdr(msg, "return-path")) ||
(v = blaze822_hdr(msg, "x-envelope-from"))) { (v = blaze822_hdr(msg, "x-envelope-from"))) {
char *s = strchr(v, '<'); char *s = strchr(v, '<');
char *e = strchr(s, '>'); if (s) {
if (s && e) { char *e = strchr(s, '>');
s++; if (e) {
memcpy(from, s, e-s); s++;
from[e-s] = 0; snprintf(from, sizeof from, "%.*s",
(int)(e-s), s);
}
} else { // return-path without <>
snprintf(from, sizeof from, "%s", v);
} }
} }

Loading…
Cancel
Save