Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 3F731431FBC for ; Mon, 23 Nov 2009 10:29:26 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id pwJshMU-XFUA for ; Mon, 23 Nov 2009 10:29:25 -0800 (PST) Received: from mail-bw0-f210.google.com (mail-bw0-f210.google.com [209.85.218.210]) by olra.theworths.org (Postfix) with ESMTP id 679FC431FAE for ; Mon, 23 Nov 2009 10:29:25 -0800 (PST) Received: by bwz2 with SMTP id 2so5545362bwz.0 for ; Mon, 23 Nov 2009 10:29:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:from:to:cc:subject :date:message-id:x-mailer; bh=GsZ30rYyCv1Y3zZF3E/jdJq8F4pEOJqPQLn8CcKqtUk=; b=D40yURe2HwQebtIJsUIE/+5Fe8Ao40lp3+YM2tigOqlJFH5pDdndv9p4BRKl4TPWfo LOS6CgA6uAVQG62TwhRIdjyjX/nVAFPo+OlrhnHkgkIwvEE+0N8fpk9dkIQrRTLJ2AQ7 xLtM0RxlfjDTt6YY6pQVJTD+tZ804kvMt2wPs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:from:to:cc:subject:date:message-id:x-mailer; b=lflQE37PtucWgouWD3awibK4+Xsp5jPoHYz6Z32uBizP4mT14bUHn0pm5YACuSJhTI hzEXrRE55vh1rVKaziJYbG6kJxGqiDVO3f9QDzBLgyR02jFlvs2FTT6dbZKqbAfrZuko OxbdBw30tew2oeiHM43ICdij7ckqXbQm8QRvs= Received: by 10.204.7.197 with SMTP id e5mr4984860bke.184.1259000964486; Mon, 23 Nov 2009 10:29:24 -0800 (PST) Received: from localhost.localdomain (vawpc43.ethz.ch [129.132.59.11]) by mx.google.com with ESMTPS id p9sm6054851fkb.44.2009.11.23.10.29.22 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 23 Nov 2009 10:29:23 -0800 (PST) Sender: Jed Brown From: Jed Brown To: notmuch@notmuchmail.org Date: Mon, 23 Nov 2009 19:29:52 +0100 Message-Id: <1259000992-31796-1-git-send-email-jed@59A2.org> X-Mailer: git-send-email 1.6.5.3 Subject: [notmuch] [PATCH] Make addresses case insensitive for the purpose of constructing replies. X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.12 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: Mon, 23 Nov 2009 18:29:26 -0000 The domain is alway case insensitive, but in principle the username is case sensitive. Few systems actually enforce this so I think a good default is to treat the entire address as case insensitive, it will eliminate a lot of superfluous self-addressed messages and reply from the correct address in these cases. Signed-off-by: Jed Brown --- notmuch-reply.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/notmuch-reply.c b/notmuch-reply.c index 44e1766..cd81e76 100644 --- a/notmuch-reply.c +++ b/notmuch-reply.c @@ -97,12 +97,12 @@ address_is_users (const char *address, notmuch_config_t *config) size_t i, other_len; primary = notmuch_config_get_user_primary_email (config); - if (strcmp (primary, address) == 0) + if (strcasecmp (primary, address) == 0) return 1; other = notmuch_config_get_user_other_email (config, &other_len); for (i = 0; i < other_len; i++) - if (strcmp (other[i], address) == 0) + if (strcasecmp (other[i], address) == 0) return 1; return 0; -- 1.6.5.3