Problem/Motivation
Hi, I have no idea what that could mean or where I should look:
The error below happens for the following scenario:
Current D8.2.6
Inmail latest dev.
Sending an email from a known user to a mailbox which is handled by an imap deliverer.
Connecting works.
Please, can someone point me into the right direction?
Thanks
Error:
Call to a member function getAddress() on array in /web/modules/mailhandler/src/Plugin/inmail/Analyzer/SenderAnalyzer.php on line 47
Since recently, Inmail has been updated to support multiple From addresses instead of only one. This was correct update since RFC 5322 does not limit From field to one address. However, this change broke PGPAnalyzer and SenderAnalyzer in Mailhandler.
Proposed resolution
Update PGP Analyzer and Sender Analyzer to use first From address and support multiple in #2861923: Support multiple From addresses.
Remaining tasks
User interface changes
API changes
Data model changes
| Comment | File | Size | Author |
|---|---|---|---|
| #27 | let_analyzers_use_first-2850498-26-interdiff.txt | 1.09 KB | mbovan |
| #21 | Analyzer-2.patch | 1.15 KB | maxilein |
| #16 | Analyzer.patch | 1.08 KB | maxilein |
| #14 | PGPAnalyzer.php_.patch | 571 bytes | maxilein |
| #9 | SenderAnalyzer.php_.patch | 520 bytes | maxilein |
Comments
Comment #2
miro_dietikerFrom quickly reading the stacktrace, it looks like your mail has no valid sender information. Possibly a filtered header by MTA?
This should never happen, but we should also make sure we don't fail hard. We might want to add an invalid mail example that triggers this case.
Could you show us the full headers of this mail?
Comment #3
maxilein commentedThanks.
Where should I get the full headers of the mail from?
Comment #4
miro_dietikerYou can extract the mail headers of a message with any mail client connecting to the MDA.
Comment #5
maxilein commentedTaken from the mailbox where inmail downloads the message from:
Delivered-To: test@email.net
Return-Path:
Delivered-To: test@email.net
Received: from proxy18.mail.iad3a.rsapps.net ([172.27.0.39]) by store537a.mail.iad3a.rsapps.net (Dovecot) with LMTP id qWNHAq78mVj8fAAA3Q1/tQ for ; Tue, 07 Feb 2017 11:58:22 -0500
Received: from smtp29.gate.iad3a ([172.27.00.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy18.mail.iad3a.rsapps.net (Dovecot) with LMTP id V6bbGFj8mVjKYAAAon3hFg ; Tue, 07 Feb 2017 11:58:22 -0500
Return-Path:
X-Spam-Exception: WHITELISTED
X-Spam-Threshold: 95
X-Spam-Score: 0
X-Spam-Flag: NO
X-Virus-Scanned: OK
X-MessageSniffer-Scan-Result: 0
X-MessageSniffer-Rules: 0-0-0-6877-c
X-CMAE-Scan-Result: 0
X-CNFS-Analysis: v=2.2 cv=T9HOdLCQ c=1 sm=1 tr=0 a=T3XMvFr6cJA2U4N+7glfYQ==:117 a=T3XMvFr6cJA2U4N+7glfYQ==:17 a=IkcTkHD0fZMA:10 a=0UE7tQH-uMIA:10 a=n2v9WMKugxEA:10 a=3pPhOZIsAAAA:8 a=54cpfGXm2VLYVQu94RYA:9 a=TBXxTzI5UHQ13n7u:21 a=cFdTRT9OfdpuhP9N:21 a=QEXdDO2ut3YA:10 a=7GNzD-Y9mrcA:10 a=8C_leJKRgBfpm2z_b9d-:22
X-Orig-To: test@email.net
X-Originating-Ip: [173.203.00.117]
Authentication-Results: smtp29.gate.iad3a.rsapps.net; iprev=pass policy.iprev="173.203.00.117"; spf=pass smtp.mailfrom="my@email.net" smtp.helo="smtp117.iad3a.svr.com"; dkim=none (message not signed) header.d=none; dmarc=none (p=nil; dis=none) header.from=email.net
X-Classification-ID: a1c559ea-ed56-11e6-b774-bc305bf5a2b4-1-1
Received: from [173.203.00.117] ([173.203.00.117:60141] helo=smtp117.iad3a.svr.com) by smtp29.gate.iad3a.rsapps.net (envelope-from ) (ecelerity 4.2.1.56364 r(Core:4.2.1.14)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id C3/D6-17337-DACF9985; Tue, 07 Feb 2017 11:58:21 -0500
Received: from smtp7.relay.iad3a.svr.com (localhost [127.0.0.1]) by smtp7.relay.iad3a.svr.com (SMTP Server) with ESMTP id CF0054DB3 for ; Tue, 7 Feb 2017 11:58:21 -0500 (EST)
X-Auth-ID: m.zam@eamil.net
Received: by smtp7.relay.iad3a.svr.com (Authenticated sender: m.zam-AT-email.net) with ESMTPSA id 2F5FB4F76 for ; Tue, 7 Feb 2017 11:58:20 -0500 (EST)
X-Sender-Id: m.zam@eamil.net
Received: from INVEN (178.115.00.184.wireless.dyn.drei.com [178.115.00.184]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:465 (trex/5.7.12); Tue, 07 Feb 2017 11:58:21 -0500
From: "MY"
To:
Subject: RE: Test 3
Date: Tue, 7 Feb 2017 17:58:19 +0100
Message-ID: <000b01d28163$63776480$2a662d80$@eamil.net>
MIME-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Mailer: Microsoft Outlook 16.0
Thread-Index: AdKBY2G2I+ag7L3lQ+2wUrOILWxksQ==
Content-Language: de-at
Comment #6
kovtunos commented@miro_dietiker: I'm trying to use Inmail together with Mailhandler. They provide demo module where there are some test email messages. Inmail fails on that messages also with this error.
A couple of headers from here:
Comment #7
maxilein commentedI believe it has to do something with the entire configuration and/or sub optimal error handling - not so much with the message itself.
I am using the smtp-module for sending emails. But I could not find any documentation whether this is a supported configuration ...
Since this module lacks any kind of documentation it is very hard to figure anything out here...
Could someone please help?
Comment #8
maxilein commentedI am getting the exacct same error when testing with the paste message templates from the inmail demo module.
Can you point me to the position in code where the module tries to send its messages?
Comment #9
maxilein commentedHi,
Used settings which do not seem to be too common...
IMAP/POP3 Deleiverer/Fetcher
here is the first part of a solution which corrects the access to the returned array.
Now the fatal error is gone.
I wonder why this never came up before?
Comment #10
maxilein commentedSo now I get a notice:
Notice: Unknown: Sequence out of range (errflg=2) in main() (line of ) #0 /.../core/includes/bootstrap.inc(548): _drupal_error_handler_real(8, 'Unknown: Sequen...
Someone here says: https://github.com/geerlingguy/Imap/issues/14
https://bugs.php.net/bug.php?id=64199&thanks=6
Comment #11
maxilein commentedMoving this, because I also saw some other related issue there.
Comment #12
maxilein commentedComment #13
maxilein commentedComment #14
maxilein commentedHere is the second patch.
You need both to make the error go away for unencrypted and encrypted mail.
Comment #15
mbovan commented#9 and #14 seem correct due to changes introduced in Inmail related to
getFrom()method.Could you make one patch combined (based on #9 and #14) and upload it here? Make sure to change a comment status to "Needs review" in order to trigger test run. Thanks!
Comment #16
maxilein commentedCombined analyzer patch.
Comment #17
maxilein commentedComment #21
maxilein commentedComment #22
maxilein commentedComment #24
mbovan commentedComment #25
mbovan commentedUpdated the issue title/description.
Comment #27
mbovan commentedAs mentioned in the updated issue summary, Inmail was updated to support multiple
Fromaddresses.#21 fixes it by enabling analyzers to use the first
Fromaddress.To support this edge case, I created a follow-up #2861923: Support multiple From addresses.
Committed #21 with a comment. Thank you!