From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-3.3 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI,SPF_HELO_NONE, SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 Received: from todd.t-8ch.de (todd.t-8ch.de [IPv6:2a01:4f8:c010:41de::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 42C8A1F626 for ; Sat, 18 Feb 2023 18:06:40 +0000 (UTC) Authentication-Results: dcvr.yhbt.net; dkim=pass (1024-bit key; unprotected) header.d=t-8ch.de header.i=@t-8ch.de header.a=rsa-sha256 header.s=mail header.b=lwTMZgea; dkim-atps=neutral Date: Sat, 18 Feb 2023 18:06:33 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=t-8ch.de; s=mail; t=1676743596; bh=WtQS6HQO9E6Uj9lCCdoMlJ20qz9xrWHE+ibpdc82AiI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=lwTMZgeaanAHxWSAjEHHUYZjaFac1UgOsJAfOVKVaQJAxJBANDtDrBeX/NBQb0Pqm LlrIAltAlPvgSTTaSkfD01bhVbxtv/FPe6cAu+VZAeh7CRsXFcjSqpck10ja0rsu3G H15EM6DrwohIKZhsMfNf7a114JT5jtXLY94STGFo= From: Thomas =?utf-8?Q?Wei=C3=9Fschuh?= To: Eric Wong Cc: Uwe =?utf-8?Q?Kleine-K=C3=B6nig?= , meta@public-inbox.org Subject: Re: Bug related to (maybe?) / in Message-Id Message-ID: <54bafa02-ea32-4885-a089-0a18e93cc5bc@t-8ch.de> References: <20230216210546.eo73kyzvtzaxwxko@pengutronix.de> <20230216213628.M187845@dcvr> <20230217085255.xcsaoozloz2yuxil@pengutronix.de> <20230217102828.M907338@dcvr> <20230218175857.b6g7aqx7inhbduxz@t-8ch.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20230218175857.b6g7aqx7inhbduxz@t-8ch.de> List-Id: On Sat, Feb 18, 2023 at 05:58:57PM +0000, Thomas Weißschuh wrote: > On Fri, Feb 17, 2023 at 10:28:28AM +0000, Eric Wong wrote: > > It's a tragedy that mutt changed their default Message-ID format :< > > Newer versions allow overriding $message_id_format in muttrc, > > but mutt 2.0.5 in Debian 11 won't have it. > > > > Fwiw, I run mutt on several machines/arches/OSes, getting them > > all to the same new version of mutt will take many years and I > > don't want compile + keep numerous binaries up-to-date in the > > mean time. > > Note: > > You can also use mutt's builtin facilities to get custom > Message-IDs. > > # in muttrc > send-hook . "source ./msgid" One mistake: This needs to be the full path to the "msgid" config: > send-hook . "source ~/.config/mutt/msgid" > # in file "msgid" next to muttrc > # put any command within the backticks > my_hdr Message-ID: <`uuidgen -r`@t-8ch.de> > > The extra config file and "source" command are needed to force > reevaluation of the backticks for each message. > > This should also work in older versions of mutt and has the advantage > that mutt knows about the actual Message-ID, for example showing it with > edit_headers=yes. > > > I also use msmtp and distribute my muttrc + ~/bin to all of > > them, so I wrote this msmtp wrapper which is mutt-version-agnostic: > > > > $ cat $HOME/bin/msmtp-msgid > > eval 'exec perl -w -S $0 ${1+"$@"}' > > if 0; # running under some shell > > # in muttrc: > > # set sendmail = msmtp-msgid > > use v5.12; > > my ($hdr, $bdy) = split(/\n\n/, do { local $/; }, 2); > > if ($hdr !~ /^Message-ID:\s*<\d{14}\b/aims) { > > my $h; > > if ($hdr =~ /^Message-ID:[^@]+\@([^>]+)>/ims) { > > $h = $1; > > } else { > > require Sys::Hostname; > > $h = Sys::Hostname::hostname(); > > } > > require POSIX; > > require Time::HiRes; > > my ($time, $msec) = Time::HiRes::gettimeofday(); > > my $msgid = POSIX::strftime("%Y%m%d%H%M%S.M$msec", gmtime($time)); > > $hdr =~ s/^Message-ID:[^\n]+/Message-ID: <$msgid\@$h>/msi; > > } > > my $pid = open(my $fh, '|-', 'msmtp', @ARGV) // die "popen: $!"; > > print $fh $hdr, "\n\n", $bdy or die "print $!"; > > close $fh or die "msmtp \$?=$?"; > > __END__