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.3 required=5.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, 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 5F0AB236BF for ; Tue, 6 Feb 2024 15:42:50 +0100 (CET) Received: from mail-lf1-f46.google.com ([209.85.167.46]) by 9front; Tue Feb 6 09:41:46 -0500 2024 Received: by mail-lf1-f46.google.com with SMTP id 2adb3069b0e04-5112d5ab492so7922099e87.0 for <9front@9front.org>; Tue, 06 Feb 2024 06:41:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1707230504; x=1707835304; darn=9front.org; h=content-disposition:mime-version:message-id:subject:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=wFeOT3dnBJ0CYilI/rp74s9eBdd8VRBVmlT+/epMqFo=; b=Tngp2qUmxIXqOi1kutiOxQCdQYdYi1Kp7RY4kUcfIaRVbpdpS+9i7t76LetsiDbg6R KfNZodKNAfSI7wsP5yuIH3chbeHqEI8WiE80hMGDYQcYBwcGLpjNuUGnfxOBgf17h3vk j0qaBEDSSlDegUeOTWg7V2Gxbvq7q1WXgdBAkz4PqozOPC+3ucW2eOsm/hIJMNaMY63y JcCltJap8HXSLxIIrD9wzV5y92j2MOfzW7XeI3Ii39KDFK1yrxzQx4C3AlyecSp8JWBA ELM80WuA+8n6asfA/xJulYW2nG4g8tQU71XWKCT73p3yTWiqUXztWm38uieRO/l8GfiG IO9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707230504; x=1707835304; h=content-disposition:mime-version:message-id:subject:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=wFeOT3dnBJ0CYilI/rp74s9eBdd8VRBVmlT+/epMqFo=; b=q0XIQ/2r1JtFZmOIPMvsEhUdM/H6guNyLjd4DB5Mq086vsdIGhKSUtHR2rnBuvuu3F be5OAXo4+FA0yg8fw62RKMDDad1UoB0FO1KeRO5DEN8uKHkyCH3LIAVFtoJeSLnP9M1s JP9EBecvjTbjXnr5BouOCROivRwZK4D9zs2EnYMBtod/bQUXQm7v7pG6aDVRYcVq7YbB I3vfEPxXFLmrlZc89zYCZIV70tTBgj0yjZgwylSQkQlpKh09cBw2Q3INwAz6/J54PzSk 0THc8Dqc8n59B4/fmV/8ckHqNxpOFSjDVJxsU5ZTsjL6zrwLNv8RIdlQkBNAY0MYAvF4 LEkA== X-Gm-Message-State: AOJu0YyyqF7d6dcd/qmsHXP+nCXDQkJbyl/+sB6AtqMOTV6hXsTlbz/m U9lXIU77gN7QHX2CwvJXVJpXCyaRdLZ2rwuymMwuyBCVNn3mEDwTH0nr93BB X-Google-Smtp-Source: AGHT+IFqLOa2UbYu47qRTjFB8fxZujAH/sf3HT8xu2ildZivYOWAsN1gFvu8xhgQ99crLRCTij4v/g== X-Received: by 2002:a05:6512:3142:b0:511:4860:425f with SMTP id s2-20020a056512314200b005114860425fmr1958755lfi.17.1707230503448; Tue, 06 Feb 2024 06:41:43 -0800 (PST) Received: from gmail.com (lfbn-idf1-1-161-49.w82-124.abo.wanadoo.fr. [82.124.242.49]) by smtp.gmail.com with ESMTPSA id f17-20020a05600c4e9100b0040ec66021a7sm2228176wmq.1.2024.02.06.06.41.42 for <9front@9front.org> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Feb 2024 06:41:42 -0800 (PST) Date: Tue, 6 Feb 2024 15:41:53 +0100 From: phil9 To: 9front@9front.org Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline List-ID: <9front.9front.org> List-Help: X-Glyph: ➈ X-Bullshit: lossless responsive callback-scale base-oriented locator Subject: [9front] [PATCH] nedmail: only display most useful headers Reply-To: 9front@9front.org Precedence: bulk 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)