From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id DE3FA6DE0BB8 for ; Sat, 19 Jan 2019 10:17:36 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: -0.003 X-Spam-Level: X-Spam-Status: No, score=-0.003 tagged_above=-999 required=5 tests=[AWL=-0.002, SPF_PASS=-0.001] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id AsdVGHKPzh_d for ; Sat, 19 Jan 2019 10:17:35 -0800 (PST) Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197]) by arlo.cworth.org (Postfix) with ESMTPS id D2D1C6DE0BA5 for ; Sat, 19 Jan 2019 10:17:35 -0800 (PST) Received: from remotemail by fethera.tethera.net with local (Exim 4.89) (envelope-from ) id 1gkvBV-0000R5-86; Sat, 19 Jan 2019 13:17:33 -0500 Received: (nullmailer pid 3543 invoked by uid 1000); Sat, 19 Jan 2019 18:17:32 -0000 From: David Bremner To: Alvaro Herrera , notmuch@notmuchmail.org Subject: Re: BUG: "notmuch insert" fails with "Delivery of non-mail file" In-Reply-To: <201901181607.4rba4c5uyimv@alvherre.pgsql> References: <201901181607.4rba4c5uyimv@alvherre.pgsql> Date: Sat, 19 Jan 2019 14:17:32 -0400 Message-ID: <87pnssqzpf.fsf@tethera.net> MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Jan 2019 18:17:37 -0000 Alvaro Herrera writes: > In my read of the code ultimately comes from > g_mime_parser_construct_message rejecting the message. > I reported this to GMime, and they said that the problem is that notmuch > insert is using the mbox mode: > https://github.com/jstedfast/gmime/issues/58 > (Sample email is attached there). This issue (or a related one) has come up before https://nmbug.notmuchmail.org/nmweb/search/postfix+mbox Generally it seems to be caused by tools that add mbox 'From ' headers, without actually mbox escaping the file. We haven't yet reached consensus on a good solution (generally people just want to fix their own mail, which is understandable). A workaround discussed in the messages I reference above is to strip the 'From ' header before passing to notmuch-insert. Perhaps some scholar of the RFCs can convince us that that is "always" the right thing for notmuch insert to do. > As far as I can tell, this is all coming from > _notmuch_message_file_parse() which sets the is_mbox flag when it sees > the "^From " line at the start of the file ... which kinda makes sense > in general terms, but for notmuch-insert I think that's the wrong thing > to do. Maybe a solution is to pass a flag down from notmuch-insert.c's > add_file all the way down to _notmuch_message_file_parse telling it not > to treat the file as an mbox. > I'd be worried about letting notmuch-insert deliver messages that notmuch-new would not be able to parse. In particular we'd like to keep the property that a Maildir + the output of notmuch-dump should be enough to completely recover the notmuch database.