X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=notmuch-dump.c;h=5bbda3609d632938a33149ddd6ce5898f3f623cd;hp=d2dad40da22f2943545aa475d178e65d1e29c79b;hb=d08c714b6a172cf0018bee4f60aff069d5508d4e;hpb=7c3a995d6b6e066aa68b0adf0433f45cb3812c2a diff --git a/notmuch-dump.c b/notmuch-dump.c index d2dad40d..5bbda360 100644 --- a/notmuch-dump.c +++ b/notmuch-dump.c @@ -102,6 +102,18 @@ notmuch_dump_command (unused (void *ctx), int argc, char *argv[]) message = notmuch_messages_get (messages); message_id = notmuch_message_get_message_id (message); + if (output_format == DUMP_FORMAT_BATCH_TAG && + strchr (message_id, '\n')) { + /* This will produce a line break in the output, which + * would be difficult to handle in tools. However, it's + * also impossible to produce an email containing a line + * break in a message ID because of unfolding, so we can + * safely disallow it. */ + fprintf (stderr, "Warning: skipping message id containing line break: \"%s\"\n", message_id); + notmuch_message_destroy (message); + continue; + } + if (output_format == DUMP_FORMAT_SUP) { fprintf (output, "%s (", message_id); }