From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: <9front-bounces@9front.inri.net> X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: from 9front.inri.net (9front.inri.net [168.235.81.73]) by inbox.vuxu.org (Postfix) with ESMTP id 6366C28BFD for ; Tue, 6 Feb 2024 19:09:16 +0100 (CET) Received: from pb-smtp20.pobox.com ([173.228.157.52]) by 9front; Tue Feb 6 13:07:33 -0500 2024 Received: from pb-smtp20.pobox.com (unknown [127.0.0.1]) by pb-smtp20.pobox.com (Postfix) with ESMTP id 256452415F for <9front@9front.org>; Tue, 6 Feb 2024 13:07:28 -0500 (EST) (envelope-from unobe@cpan.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=pobox.com; h=message-id :to:subject:date:from:in-reply-to:mime-version:content-type :content-transfer-encoding; s=sasl; bh=vczUVwI4SJ1Rsl5pIr44HPkbu NeFtE/MkiRqwK4t0is=; b=EitRNx0lJfkpPR242y34rqyhFiGX7oEc/kOC18Td8 taoi4uFt4y0Tw1yEEcK1wOGPJviC8t5DbiSRh8ZMloLy61feQQnNPEJpY1yPbNwl Jsm/1ra54795kp+NF3AzCe2d5ySWzwXG6tbBCf2F3Bxvn+4+vC5Q/0opk03pFEdn kU= Received: from pb-smtp20.sea.icgroup.com (unknown [127.0.0.1]) by pb-smtp20.pobox.com (Postfix) with ESMTP id 1DBFA2415E for <9front@9front.org>; Tue, 6 Feb 2024 13:07:28 -0500 (EST) (envelope-from unobe@cpan.org) Received: from strider.localdomain (unknown [24.205.13.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pb-smtp20.pobox.com (Postfix) with ESMTPSA id B372D2415D for <9front@9front.org>; Tue, 6 Feb 2024 13:07:23 -0500 (EST) (envelope-from unobe@cpan.org) Message-ID: <4FCA058E6DD3140BBC1AA25E7E15A4C9@smtp.pobox.com> To: 9front@9front.org Date: Tue, 06 Feb 2024 10:07:20 -0800 From: unobe@cpan.org In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Pobox-Relay-ID: 93FFA718-C51A-11EE-A86F-F515D2CDFF5E-09620299!pb-smtp20.pobox.com List-ID: <9front.9front.org> List-Help: X-Glyph: ➈ X-Bullshit: open-source overflow-preventing HTML method singleton-scale out-scaling solution Subject: Re: [9front] [PATCH] nedmail: only display most useful headers Reply-To: 9front@9front.org Precedence: bulk I like it, thanks phil! One other that I would add (like CC, only if set) is inreplyto. But maybe that's not most useful to you and others. Quoth phil9 : > Hi, > > Below patch limits the headers displayed by nedmail to the most "useful" > ones:Date, From, To, CC (is set) and Subject. > This helps with some mailing lists or mail providers adding loads of noisy headers. > This only applies to the 'p' command and all headers are still visible > when using the 'P' (display raw) command so nothing is lost. > > cheers > --phil > > > diff 081b58a69e5efc2bbf49ee31099372527edb3fa7 uncommitted > --- a/sys/src/cmd/upas/ned/nedmail.c > +++ b/sys/src/cmd/upas/ned/nedmail.c > @@ -1664,6 +1664,18 @@ > return c; > } > > +void > +printheaders(Message *m) > +{ > + Bprint(&out, "Date: %s\n", m->date); > + Bprint(&out, "From: %s\n", m->from); > + Bprint(&out, "To: %s\n", m->to); > + if(strlen(m->cc)>0) > + Bprint(&out, "CC: %s\n", m->cc); > + Bprint(&out, "Subject: %s\n", m->subject); > + Bprint(&out, "\n"); > +} > + > Message* > pcmd0(Cmd *c, Message *m, int mayplumb, char *tfmt) > { > @@ -1684,10 +1696,9 @@ > } > if(m->parent == &top){ > seen(m); > - printpart(m, "unixheader", nil); > + /* only print headers for top part */ > + printheaders(m); > } > - if(printpart(m, "header", nil) > 0) > - Bprint(&out, "\n"); > cp = findctype(m); > if(cp->flag & Display){ > if(strcmp(m->type, "text/html") == 0) >