From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Robert Pluim Newsgroups: gmane.emacs.bugs Subject: bug#51733: 27.1; Detect impossible email addresses better Date: Wed, 19 Jan 2022 13:49:20 +0100 Message-ID: <87h79zoppr.fsf@gmail.com> References: <87czn8etuz.7.fsf@jidanni.org> <49EACC4C-E21E-4123-A3D2-901958CF7DC4@gnu.org> <87mtju76pp.fsf@gnus.org> <83bl0awbqq.fsf@gnu.org> <87sftm5lxc.fsf@gnus.org> <835yqiwa87.fsf@gnu.org> <87ee565l4d.fsf@gnus.org> <875yqi5kk7.fsf@gnus.org> <83zgnuuucu.fsf@gnu.org> <83r196uqni.fsf@gnu.org> <87sftm3ye5.fsf@gnus.org> <87iluh4ety.fsf@gnus.org> <87ee55474p.fsf@gnus.org> <87a6ft46mr.fsf@gnus.org> <874k6146ay.fsf@gnus.org> <87zgnt2qz9.fsf@gnus.org> <87v8yh2ot4.fsf@gnus.org> <87r1952omd.fsf@gnus.org> <831r14vq70.fsf@gnu.org> <87tue0nkrx.fsf@gmail.com> <8335lkszzc.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10157"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 51733@debbugs.gnu.org, larsi@gnus.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Jan 19 14:11:57 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nAAkn-0002XP-LP for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 19 Jan 2022 14:11:57 +0100 Original-Received: from localhost ([::1]:53238 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nAAkl-0004VD-1N for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 19 Jan 2022 08:11:55 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:48556) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nAAQ0-0004aa-3A for bug-gnu-emacs@gnu.org; Wed, 19 Jan 2022 07:50:34 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:59669) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nAAPa-0008HL-B5 for bug-gnu-emacs@gnu.org; Wed, 19 Jan 2022 07:50:16 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nAAPa-0006NK-11; Wed, 19 Jan 2022 07:50:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Robert Pluim Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org, bugs@gnus.org Resent-Date: Wed, 19 Jan 2022 12:50:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 51733 X-GNU-PR-Package: emacs,gnus Original-Received: via spool by 51733-submit@debbugs.gnu.org id=B51733.164259657224459 (code B ref 51733); Wed, 19 Jan 2022 12:50:01 +0000 Original-Received: (at 51733) by debbugs.gnu.org; 19 Jan 2022 12:49:32 +0000 Original-Received: from localhost ([127.0.0.1]:52571 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nAAP5-0006MR-L0 for submit@debbugs.gnu.org; Wed, 19 Jan 2022 07:49:31 -0500 Original-Received: from mail-wm1-f48.google.com ([209.85.128.48]:44651) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nAAP1-0006M8-Vz for 51733@debbugs.gnu.org; Wed, 19 Jan 2022 07:49:29 -0500 Original-Received: by mail-wm1-f48.google.com with SMTP id l35-20020a05600c1d2300b0034d477271c1so5762026wms.3 for <51733@debbugs.gnu.org>; Wed, 19 Jan 2022 04:49:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:references:date:in-reply-to:message-id :mime-version:content-transfer-encoding; bh=tBJn7u04vah1VkHma43pMYT5Uq/vCi+pNGv/95C7ZUU=; b=H5DpHfuSF/ZF8HKvbzwf6bGJ94pnyxmWp1a0qDULc53VT8B9kM9U5/dNgZgYncaWRi e62rntznYfDGUhaNkFTfStYkpkemJl83feXwLFjrCly4n8SkJMqcd6aQl9kf3TY6xmzt lJd/5oNJs6DqIRfeyxMBb97YRCV91aEvs6nphocVMRuVsfI4EmoZUU6ZF0oUwTLfuvfz GTyRZBEorK4IwOEHtZLrOExhhFLz8lQWDaLdTcqQx7cb0RMSZDyybpS5Fs6nBS0kd59m f6gWGG8OAwCtOWSyjtDd0Ze3tBPe+JzcrnU1UK/XB2FAiUyhoqJoNTZjnqY7wc44b4IS Qmhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:mime-version:content-transfer-encoding; bh=tBJn7u04vah1VkHma43pMYT5Uq/vCi+pNGv/95C7ZUU=; b=XSCOr3FMX1+lJpgk2xxERda4JDl8yyb/Uyu//gDWFrT0t21HrLiS3ZD2vjVE5tteAx n2yNTd8JlIJcdhAnPrWaUvTkeZDNzrTvHUjf1zF3r0+daxFZvvqH2XYtUIIZUzEKAOHs SscqOyzSMrFITXdhH/ACj0ZO6cf7I4YuaBqiPwHc1dZMTGx7oo/N/iL1SdsUQHkvRpBg q3dWNZsprSWUjwzldvSC1GKEUGNE0oKTriBXefz5SxGoySZVoIgt0YUuazmz351RN7Vf j1egZ8L1TEw21wP2+Kklz4pd0VukOrdX0fCSY9Ii/5js0NzZNVr9kalcWfjZXnXJipTa 7RPw== X-Gm-Message-State: AOAM533QmG9h8peDXWVikqj/pp+7VXI94IfTNuqlJzjbhNTJsk6U9P11 tfErYKqvr+3B0T+zGai5Ntc8ELQsrwk= X-Google-Smtp-Source: ABdhPJwb1EJRWlOaLI4voEYaP9T7fzcFy6H5tMUDpdxqAS2m1sqOceUTzPpbWg2ELPFhXDUNyaa1tw== X-Received: by 2002:a5d:6381:: with SMTP id p1mr8119653wru.108.1642596561725; Wed, 19 Jan 2022 04:49:21 -0800 (PST) Original-Received: from rltb ([2a01:e0a:3f3:fb50:5497:eb2c:1716:483e]) by smtp.gmail.com with ESMTPSA id b5sm4917202wmq.28.2022.01.19.04.49.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Jan 2022 04:49:21 -0800 (PST) In-Reply-To: <8335lkszzc.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 19 Jan 2022 13:53:59 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:224562 Archived-At: >>>>> On Wed, 19 Jan 2022 13:53:59 +0200, Eli Zaretskii said: Eli> Here: Eli> (textsec-email-suspicious-p "=D7=90=D7=91=D7=92=D7=93 ") Eli> =3D> (wrong-type-argument stringp nil) Eli> with this backtrace: Eli> Debugger entered--Lisp error: (wrong-type-argument stringp nil) Eli> string-search("=3D?" nil) Eli> rfc2047-decode-string(nil) Eli> mail-header-parse-address("=D7=90=D7=91=D7=92=D7=93 " t) Eli> textsec-email-suspicious-p("=D7=90=D7=91=D7=92=D7=93 ") Eli> (progn (textsec-email-suspicious-p "=D7=90=D7=91=D7=92=D7=93 <= foo@bar.com>")) Eli> eval((progn (textsec-email-suspicious-p "=D7=90=D7=91=D7=92=D7= =93 ")) t) Eli> elisp--eval-last-sexp(t) Eli> eval-last-sexp(t) Eli> eval-print-last-sexp(nil) Eli> funcall-interactively(eval-print-last-sexp nil) Eli> call-interactively(eval-print-last-sexp nil nil) Eli> command-execute(eval-print-last-sexp) mail-header-parse-address assumes that the display name or the local name starts with a (subset of) ASCII. The following doesn=CA=BCt signal an error: (textsec-email-suspicious-p "=D7=93=D7=92=D7=91=D7=90a ") Since it=CA=BCs now open season on display names and mailbox names, the following might be enough. Lars? diff --git a/lisp/mail/ietf-drums.el b/lisp/mail/ietf-drums.el index 4a07959189..1885f958ba 100644 --- a/lisp/mail/ietf-drums.el +++ b/lisp/mail/ietf-drums.el @@ -217,7 +217,7 @@ ietf-drums-parse-address (push (buffer-substring (1+ (point)) (progn (forward-sexp 1) (1- (point)))) display-name)) - ((looking-at (concat "[" ietf-drums-atext-token "@" "]")) + ((not (eq c ?<)) (push (buffer-substring (point) (progn (forward-sexp 1) (point))) display-name)) ((eq c ?<) @@ -240,7 +240,7 @@ ietf-drums-parse-address (cons (mapconcat #'identity (nreverse display-name) "") (ietf-drums-get-comment string))) - (cons mailbox (if decode + (cons mailbox (if (and decode display-string) (rfc2047-decode-string display-string) display-string)))))) =20 Robert --=20