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 803E66DE18B0 for ; Sat, 17 Mar 2018 11:11:58 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: -0.111 X-Spam-Level: X-Spam-Status: No, score=-0.111 tagged_above=-999 required=5 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01] 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 dsGNEl39Mpzz for ; Sat, 17 Mar 2018 11:11:57 -0700 (PDT) Received: from nimbus.chaotikum.eu (nimbus.chaotikum.eu [104.238.167.87]) by arlo.cworth.org (Postfix) with ESMTPS id 1712D6DE18AE for ; Sat, 17 Mar 2018 11:11:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=chaotikum.eu; s=20170824; h=Content-Type:MIME-Version:Message-ID:Date: References:In-Reply-To:Subject:To:From:Sender:Reply-To:Cc: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=KuSW5hBwHDuK6iwG3XiAMU9RHy5PFZuOKD63Xe8NbMI=; b=R1lBEWU6RJk4maUY3QJaQ0Tx3 ftByRezLTeaWi6rKhqJaoTVqo4juLXqtxKRsMMDHxCjcvVYDZ0WkFRJFcUvzvo6sLd5PMtQ0GbUKZ pU1y/iFcrkizonDKgTLA7lg4aDsvEhExtP8iHFEUXZuQouCjNsVfT4JaWHDkLLh7su4Hw4/Au4fEi W8Pspem82z1Xl1EfO7XTO3n+1U17tzqVjU8M1ureZVO6sOZNXMqLGMb5S9iAGEJtvIW1lfmngJCTM I/L0pFRszy+Qvp9iyTE/Xg38ptx6HT3/tJuOUMnGSksDf5im4zXE6JY/4tTgLpg4MQ98iNcp25A69 TsmW0fGSGDqmzBicLdP/PnQwUUtZ2UhffokZyvZkwzMZ3GRxjU/xwFk01SUQGmyNleuaNkSXbUFos NtLK4LJp1BbTnwuUpCUEiooPxGGi0qteEK9sQjfU0sCvvmmVWqhxqDUWrDfN9YBu7sHyVu/mQOIDP vvPutfqYRxXq+HHB4cjhCAlkg; Received: from static-87-79-236-180.netcologne.de ([87.79.236.180]:51034 helo=coruscant.chaotikum.eu) by nimbus.chaotikum.eu with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1exGJ4-00066v-OC; Sat, 17 Mar 2018 19:11:50 +0100 From: Thomas Schneider To: David Bremner , notmuch@notmuchmail.org Subject: Re: emacs-notmuch: Set variables based on From when composing In-Reply-To: <87efkkp5jg.fsf@tethera.net> References: <87efkkp5jg.fsf@tethera.net> User-Agent: Notmuch/0.25.3 (https://notmuchmail.org) Emacs/25.3.1 (x86_64-pc-linux-gnu) Date: Sat, 17 Mar 2018 19:11:39 +0100 Message-ID: MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.26 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, 17 Mar 2018 18:11:58 -0000 --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable David Bremner writes: > Thomas Schneider writes: > >> Hello list, >> >> I use notmuch with the Emacs frontend and multiple accounts. I=E2=80=99= d like >> it to set the domain part of Message-Id header of any mail I compose to >> something sensible, e.g. the FQDN of the host (which does not seem to be >> easy, see [0]) or the domain part of the From header. > > There is some discussion on the wiki of using gnus-alias and > message-templ with notmuch. The latter is more about setting headers. Thanks for the pointer. gnus-alias seems to work so far. I also use it to set the Fcc header to avoid duplicating address matches. >>> I was thinking about setting message-user-fqdn based on the From header >> in an appropriate hook, but I haven=E2=80=99t found yet where and how to= do >> this. > > There is notmuch-mua-send-hook (which by default just runs > message-send-hook) This seems to be run too late, so as for now, I use message-setup-hook and always define the address I want to send as beforehand. =2D-- (add-hook 'message-setup-hook (lambda () (make-local-variable 'message-user-fqdn) (setq message-user-fqdn (car (reverse (split-string (car (mail-header-parse-address (message-field-value "From"))) "@")))))) =2D-- Maybe I could add Message-ID to one of the headers added beforehand so that I see what is generated. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEs0E17FxdBc8PvMjVg4ZN/CGrpKYFAlqtWlwACgkQg4ZN/CGr pKYe9g/9E8QDdZrASAR/vuSKNFHR7K18VJSvUCbgoc83wRkkK7DJSk377GTql8gK ezl5j2HkZgVXmnlWqaHrF3TA+29Y9yuoG3iX3JYilQMasp3iPDuWMVLKJim3NQjB Z028IBYkMa19yheO5+Wl0HhR4+BiqfhUU7Sw6Z4v45DRnfUje31kyY2YM5halWdb M4ZsKKrctlkVw8CmNl7WHuXAr19Jfqm3hNLBBnAy5tklawb7P98FjMQ3V3szVNyR V+JJDYvbTS47BRodYoxV/bqq0fAKFQFGjkYpICSBcXTUZhuVkog29ufcpOh2tTn6 DFZeBz7RmFHOnOmvdvQgKlHFBrVdL5dZD5jNFOhHELqhM/cxUr2pCGTbp0BvPfsu R5l/qQ2o0Ay3FKNh5JT3oNiHrgsniXjkPryCO3vWlqhFDfh/FZTYnYPo1pVxecu0 SKGqSWBWUriEpx/UV4Zv9la42wv2lsOxxlYbgxcqh8sIDohsr3sIRjM8+GC7BJbn 7SQDvWOv8mO5h3bGBYmqG2wf3TyirkIjH2wamlRIvd4Y4CkGETsP3eGiGXVCm5HI TKHTdWrTcTHPvDZos0EOS3/87QHqCEIeP1mia+2ehKkb1WAinmZPcxdU0tPTWjtm NjiXxQMfj/ELktI5gwZnjP1xX6w4tosi+Yy/QvpqXaml1BrO+Hk= =LTGa -----END PGP SIGNATURE----- --=-=-=--