diff options
author | Leah Neukirchen <leah@vuxu.org> | 2017-06-24 15:46:00 +0200 |
---|---|---|
committer | Leah Neukirchen <leah@vuxu.org> | 2017-06-24 15:46:00 +0200 |
commit | c15ed7a16861aaee70f8772c93952e978d20974f (patch) | |
tree | 3ba788bc6cd317beb2697cf17176092934dfb79c | |
parent | 98a40b5dd31241d870b3f2ed77f10569ec834426 (diff) | |
download | mblaze-c15ed7a16861aaee70f8772c93952e978d20974f.tar.gz mblaze-c15ed7a16861aaee70f8772c93952e978d20974f.tar.xz mblaze-c15ed7a16861aaee70f8772c93952e978d20974f.zip |
mexport: handle return-path without <>
-rw-r--r-- | mexport.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/mexport.c b/mexport.c index 1a7d599..ef31618 100644 --- a/mexport.c +++ b/mexport.c @@ -46,11 +46,15 @@ export(char *file) if ((v = blaze822_hdr(msg, "return-path")) || (v = blaze822_hdr(msg, "x-envelope-from"))) { char *s = strchr(v, '<'); - char *e = strchr(s, '>'); - if (s && e) { - s++; - memcpy(from, s, e-s); - from[e-s] = 0; + if (s) { + char *e = strchr(s, '>'); + if (e) { + s++; + snprintf(from, sizeof from, "%.*s", + (int)(e-s), s); + } + } else { // return-path without <> + snprintf(from, sizeof from, "%s", v); } } |