From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id oGZZDhRqOmFrJgEAgWs5BA (envelope-from ) for ; Thu, 09 Sep 2021 22:09:56 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id UII3ChRqOmFUZwAAB5/wlQ (envelope-from ) for ; Thu, 09 Sep 2021 20:09:56 +0000 Received: from mail.notmuchmail.org (nmbug.tethera.net [IPv6:2607:5300:201:3100::1657]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id B7E8D18728 for ; Thu, 9 Sep 2021 22:09:55 +0200 (CEST) Received: from nmbug.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id 8B7EA20675; Thu, 9 Sep 2021 16:09:51 -0400 (EDT) Received: from lahtoruutu.iki.fi (lahtoruutu.iki.fi [IPv6:2a0b:5c81:1c1::37]) by mail.notmuchmail.org (Postfix) with ESMTPS id 7D6C920646 for ; Thu, 9 Sep 2021 16:09:48 -0400 (EDT) Received: from guru.guru-group.fi (unknown [IPv6:2a02:2380:1:9:5054:ff:feb7:a4bc]) (using TLSv1.2 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: too) by lahtoruutu.iki.fi (Postfix) with ESMTPSA id 6A68F1B001E8; Thu, 9 Sep 2021 23:09:43 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=lahtoruutu; t=1631218183; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=JColmDdz1nGr4i81Wy/PoEgAqpiicLH1/7DQeDNYxu8=; b=cXMkQT07RztNZcen8yX5WT8bYfbdWVbC2QReacITzMuKpyCwBhxLyBkQxqgFXyEIMbmKd7 gV9u0OsC8h/WzVmE/hofDEc7lut14KAM2B0+wuDQJdMgMEJw1AIm+dRegkmWcorp+tR8uf NNy9OItqIRpCxAKSh56A5jsuliwuUDZvVsh4X8otCTBtqm6PV29skM6L/Y46RV1XG55bZ/ 3xr6n7fTlxJCF9tfRJYVOd2D9oWmqhJ6o+55gkUPgVd5XBQs3Dh5N0ks2KN4Kd21MHEJGN kjFKNXREV+8JCmxQWTNAo0bKgpdimwe8Az1+M7o0ZSAm3JyUzxk+VRCEk5gi+Q== From: Tomi Ollila To: David Bremner , notmuch@notmuchmail.org Subject: Re: [PATCH] lib: use 'localhost' rather than fqdn for default mail address. In-Reply-To: <20210909125103.215302-1-david@tethera.net> References: <20210909125103.215302-1-david@tethera.net> User-Agent: Notmuch/0.33+54~gcaf4513 (https://notmuchmail.org) Emacs/27.1 X-Face: HhBM'cA~ MIME-Version: 1.0 ARC-Seal: i=1; s=lahtoruutu; d=iki.fi; t=1631218183; a=rsa-sha256; cv=none; b=ldQfRrv37iin/EmpxjHqkpWpP8EHoLo3hOIFsoaRlFqtInLGOjyDTzcAUAOPRAfcfrbl9r bwwLbpdgEWgsjMPDg76fZ+AQmDlHFrJjMsOjD2ObcVmfCS/aRNNGo7sX++jMKjSZLt6GR2 0iQkycY1IvaAYdlTX9Zs/nq3M1eyxovZDhMMmieKolJcaduiOV0R+4KLX25g4D00AXoBRl 1d5a8ISqZNLHhyCva0hK9z0OtMVWrVVNMEmZ8gVAV0o4JQp5z06k/rYXD/KVZpzWQGeMcO vtcSvIXqYG5NnjFzK462E+kulrR+BLo8GX2teN/MgEu0pCvlUDCK+VQMntPTCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=lahtoruutu; t=1631218183; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=JColmDdz1nGr4i81Wy/PoEgAqpiicLH1/7DQeDNYxu8=; b=iQ96VAyFpdoTEDKsxnVqS35OlgQ/XMJhcxL8RZnKKuRYMLr0jzsTA2gELmWP4XAWElEV2u bNH1TYLXlnkLq54PdcIINRaHovpvYP3Pngr+O4BCJjG0pNhyS8l86feG233La7qx4olNcn qurYynZVwhuAuc5aYvd1Bqa8gdQMl3zBiq7XXsTzHQyLfRMlJNJnjgRGsEqCTjuoU6Bl9H s53Lic2FmULMVyZfDdI70TieTL26AbneR3sk1sKxo42Fgv3KgLdWoUd2ekY55NGIofKgY/ PDKvyHqMbq51JMN1W9B7vp7Gh4atuCUeaZM7Q0nGj/sf8rcIy3HIhRG5xTEJVg== ARC-Authentication-Results: i=1; ORIGINATING; auth=pass smtp.auth=too smtp.mailfrom=tomi.ollila@iki.fi Message-ID-Hash: SLW3WMNKW4BWU5TGOSXFRC6OCY7Y55F2 X-Message-ID-Hash: SLW3WMNKW4BWU5TGOSXFRC6OCY7Y55F2 X-MailFrom: tomi.ollila@iki.fi X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-notmuch.notmuchmail.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.2.1 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Help: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1631218196; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=vmoOfWqfjnqgpei9MOfJ8rmBSKb8KQbp9Y98LaO5viI=; b=WCI4SHSa1YNsL2EfhdWHFY8lD6VNg1a4yfV3/jScgrsGSwWExXe0d6gYpOLo5odvB/EdaL yw8WYFedSYNsVTbt09BFrPW3KzFwMi2BtmKqaFAvAu58m6X6vaoMPsO/9QK00nBALyztV9 u/j6soI9/ylgPdnacQyEXX2tW1pIY+xriOnyU9gCCHTXPFz1+p2a2m/dlw01jJvQ5eaQ96 LAU8cvJ7rpZAkNxGrEzyjnQUTgLeefPsDxZcn3MKbol36pdIpp3R4Nr72YS8sWO4oJCP4k ndVRSb9DM/7K2Y5rXta2I3vo/z98KGzJHEFtjYsTsoLSYV74j8AGMnEkCbphXg== ARC-Seal: i=2; s=key1; d=yhetil.org; t=1631218196; a=rsa-sha256; cv=fail; b=TOjWKqHDRPkWUuhPuf4plVo0kpqXpCVHSAkWf3upwR/AAk97C0RRuMpsZsQBnUg1yRaPVf Sgjq1CgWMI1qD3UsyP7w1QCMcfEkrZcUtFMrXk5BNjRBd+iJSm1HEF20hwLfEt/iQY3YD0 b0NDTfuIg5yXqkoSS+yNaC1Rpv1kmDFbCDQ/T/cUVp8g+zeH4cjnYTSAimZq79jd0+hY+C sj48vodKZdX+Da3+V3L6WDhf1Fxvx4RoD+wYzevDeOgsNKmSMBVHIO0Wk0lZ2TddcZ1Rn9 Cvkq1CnVUkHmilntGjEPQ9meSDfPVvPERrvGdrZIzFMlehBfiCgdyRbYxFIluw== ARC-Authentication-Results: i=2; aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=iki.fi header.s=lahtoruutu header.b=cXMkQT07; arc=reject ("signature check failed: fail, {[1] = sig:iki.fi:reject}"); dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 2607:5300:201:3100::1657 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Spam-Score: 1.03 Authentication-Results: aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=iki.fi header.s=lahtoruutu header.b=cXMkQT07; arc=reject ("signature check failed: fail, {[1] = sig:iki.fi:reject}"); dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 2607:5300:201:3100::1657 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Queue-Id: B7E8D18728 X-Spam-Score: 1.03 X-Migadu-Scanner: scn0.migadu.com X-TUID: Jarpx9Rl7JkE On Thu, Sep 09 2021, David Bremner wrote: > As discussed in the thread starting at [1], the fully qualified domain > name is a bit tricky to get reproducibly, might reveal information > people prefer to keep private, and somewhat unlikely to provide > reliable mail routing. > > The new approach of $current_username@localhost is better for the > first two considerations, and probably at least as good as a test mail > address. > > [1]: id:87sfyibqhj.fsf@tethera.net > --- > lib/config.cc | 17 ++--------------- > test/T590-libconfig.sh | 10 ++++------ > 2 files changed, 6 insertions(+), 21 deletions(-) > > diff --git a/lib/config.cc b/lib/config.cc > index 7ecc3c7b..408570bc 100644 > --- a/lib/config.cc > +++ b/lib/config.cc > @@ -543,25 +543,12 @@ _get_username_from_passwd_file (void *ctx) > static const char * > _get_email_from_passwd_file (void *ctx) > { > - > - char hostname[256]; > - struct hostent *hostent; > - const char *domainname; > char *email; > > char *username = _get_username_from_passwd_file (ctx); > > - gethostname (hostname, 256); > - hostname[255] = '\0'; > - > - hostent = gethostbyname (hostname); > - if (hostent && (domainname = strchr (hostent->h_name, '.'))) > - domainname += 1; > - else > - domainname = "(none)"; > - > - email = talloc_asprintf (ctx, "%s@%s.%s", > - username, hostname, domainname); > + email = talloc_asprintf (ctx, "%s@localhost", > + username); perhaps the above 2 lines as one: > + email = talloc_asprintf (ctx, "%s@localhost", username); LGTM in any way. Tomi