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: AS24940 159.69.0.0/16 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 [159.69.126.157]) (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 3A2EF1F628 for ; Sat, 18 Feb 2023 17:59:03 +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=oppJwmCN; dkim-atps=neutral Date: Sat, 18 Feb 2023 17:58:57 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=t-8ch.de; s=mail; t=1676743140; bh=bMLEzwSrSe45sArqTFPU3xnxXUU9DDGhmCPRIwDhukg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=oppJwmCNVbJf/tDuf37MCv5/MDyn6vX7+B7ra8xApClQbtmKjLfutc3kwvZU2UVCS ZiE8owDKFLx4MTopiF83mXqw1K/k5/3yvD9Nx/yUZqjxn5O8ldrnf4wH+IhiNNgLYJ X62Czlm03Tlb/wwqqutqSiIu00+fNEacmt0q5YXQ= 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: <20230218175857.b6g7aqx7inhbduxz@t-8ch.de> References: <20230216210546.eo73kyzvtzaxwxko@pengutronix.de> <20230216213628.M187845@dcvr> <20230217085255.xcsaoozloz2yuxil@pengutronix.de> <20230217102828.M907338@dcvr> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230217102828.M907338@dcvr> List-Id: 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" # 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__