Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dev/core#5569 Remove obsolete zeta-patch #30969

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -299,10 +299,6 @@
},
"pear/net_smtp": {
"Add in CiviCRM custom error message for CRM-8744": "https://raw.githubusercontent.com/civicrm/civicrm-core/a6a0ff13d2a155ad962529595dceaef728116f96/tools/scripts/composer/patches/net-smtp-patch.patch"
},
"zetacomponents/mail": {
"CiviCRM Custom Patches for ZetaCompoents mail": "https://raw.githubusercontent.com/civicrm/civicrm-core/9d93748a36c7c5d44422911db1c98fb2f7067b34/tools/scripts/composer/patches/civicrm-custom-patches-zetacompoents-mail.patch",
"CiviCRM Custom patch to fix a php8.1 issue found in CiviCRM unit tests": "https://raw.githubusercontent.com/civicrm/civicrm-core/5506f4ce5d46799857b4f4ddf34069e7541e9cc5/tools/scripts/composer/zetacomponents-php-81-civicrm-custom.patch"
}
},
"compile-includes": ["ext/greenwich/composer.compile.json"],
Expand Down
39 changes: 38 additions & 1 deletion tests/phpunit/CRM/Utils/Mail/EmailProcessorInboundTest.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?php

use Civi\Api4\ActivityContact;
use Civi\Api4\File;

/**
* Class CRM_Utils_Mail_EmailProcessorInboundTest
Expand Down Expand Up @@ -179,6 +180,41 @@ public function testBadFrom() :void {
$this->assertCount(2, $activities);
}

/**
* Test messed up from.
*
* This ensures fix for https://issues.civicrm.org/jira/browse/CRM-19215.
*
* @throws \CRM_Core_Exception
*/
public function testParsedAttachment() :void {
$mail = 'text_attached.eml';
$string = 'Big Business';
$file_contents = file_get_contents(__DIR__ . '/data/inbound/' . $mail);
file_put_contents(__DIR__ . '/data/mail/' . $mail, $file_contents);
$this->callAPISuccess('Job', 'fetch_activities', []);
$attachments = File::get()
->execute();
$this->assertCount(3, $attachments);
$activity = \Civi\Api4\Activity::get()
->addWhere('activity_type_id:name', '=', 'Inbound Email')
->addSelect('custom.*')
->addSelect('details')
->execute()->single();
$this->assertStringContainsString($string, $activity['details']);

}

public function attachmentDataProvier(): array {
return [
['text_attached.eml', 'Seamus', FALSE],
['ics_gmail_attached.eml', '', TRUE],
['ics_gmail_generated.eml', '', TRUE],
['ics_thunderbird_attached.eml', '', TRUE],
['ics_thunderbird_generated.eml', '', TRUE],
];
}

/**
* test hook_civicrm_emailProcessor
*/
Expand Down Expand Up @@ -268,7 +304,8 @@ public function testHookEmailProcessorContactCatchall(): void {
}

/**
* test hook_civicrm_emailProcessorContact with catchall but matching individual
* test hook_civicrm_emailProcessorContact with catchall but matching
* individual
*/
public function testHookEmailProcessorContactCatchallWithMatch(): void {
$this->hookClass->setHook('civicrm_emailProcessorContact', [$this, 'hookImplForEmailProcessorContact']);
Expand Down
189 changes: 189 additions & 0 deletions tests/phpunit/CRM/Utils/Mail/data/inbound/ics_gmail_attached.eml
Original file line number Diff line number Diff line change
@@ -0,0 +1,189 @@
Delivered-To: [email protected]
Received: by 2002:a59:9450:0:b0:484:73f8:c060 with SMTP id q16csp1839024vqi;
Mon, 26 Aug 2024 14:48:00 -0700 (PDT)
X-Received: by 2002:a05:6512:3f19:b0:52c:e170:9d38 with SMTP id 2adb3069b0e04-5344e3dab0bmr407779e87.31.1724708879882;
Mon, 26 Aug 2024 14:47:59 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; t=1724708879; cv=none;
d=google.com; s=arc-20160816;
b=NQU+A5DyvJxBT5KZ8SjpQVXuGFWOXd+bqJi3AX7MpLC5cZuy9kMvyBMlCF9Z5FOgEt
3e9tOieBON9P8cxpN+gmN17bVwdFhpYKaAYmEZDRHvDhDBnCLeXGCA7uw/7HqTCSddqL
TRfrNAz8hG7IKQcMQym4AoxhQV7YdtwS7Qv2fJ0eof8pGG7oXXR440nbp8IHm3a/QRv1
S1gMjFzDPNvfIH8Xi3CLIDYdzoadEJKyJ8q/uJ1ahLz/hgOjxoOjok/1K2rcSbnqS2Qr
8VOWuV0BjAB4HgaghAnRMWuggKTiv5iqRLnPefOJO4NXIz9BHTRWv4fDLbm17OXkFt6d
NQmQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816;
h=to:subject:message-id:date:from:mime-version:dkim-signature;
bh=yKD21c8JHA7aJjN0oCxs55FlFD+X1Lz8+OQau8GvEFs=;
fh=emDhT3i8Q4zqQCAC8b7ideBoq+/uwZn4ylafxwc5Sg0=;
b=oIwgWpljq5UKMLWkH/1X59z+jFSC8R1TCh74Xj/l2f3h0kQLaLka88B2I5lnwyoZYG
OPiBH93vTv8EfSrsT5lhhlO+M3QLNycSEmUfXNMZAk0HQgWgablKWmkIdckFQYP3gMgw
EKARC4jK6zHBYnfFgQqXCNT1fADn+m+BvZ+nCqzVEJDUimRdHBC+Twc6Hi+ZTZk0/nNI
bN71ArLwS9u7Wn0M9Pd2TNFm1t5nICR1YmuHt/JOK0rkTQhKiPrHW54TvzwzAgBH3ptu
ZDrzxmlsp8V8QFpTEsD4rKqoS9FTokvCHeNA+2wBzW8Prx872bWQFvs5ONXIJ8wHKXw/
e2zg==;
dara=google.com
ARC-Authentication-Results: i=1; mx.google.com;
dkim=pass [email protected] header.s=20230601 header.b=Wap2MeYp;
spf=softfail (google.com: domain of transitioning [email protected] does not designate 209.85.220.41 as permitted sender) [email protected];
dara=pass [email protected]
Return-Path: <[email protected]>
Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41])
by mx.google.com with SMTPS id 2adb3069b0e04-5334ea9b027sor2450363e87.30.2024.08.26.14.47.59
for <[email protected]>
(Google Transport Security);
Mon, 26 Aug 2024 14:47:59 -0700 (PDT)
Received-SPF: softfail (google.com: domain of transitioning [email protected] does not designate 209.85.220.41 as permitted sender) client-ip=209.85.220.41;
Authentication-Results: mx.google.com;
dkim=pass [email protected] header.s=20230601 header.b=Wap2MeYp;
spf=softfail (google.com: domain of transitioning [email protected] does not designate 209.85.220.41 as permitted sender) [email protected];
dara=pass [email protected]
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=example-org.20230601.gappssmtp.com; s=20230601; t=1724708878; x=1725313678; dara=google.com;
h=to:subject:message-id:date:from:mime-version:from:to:cc:subject
:date:message-id:reply-to;
bh=yKD21c8JHA7aJjN0oCxs55FlFD+X1Lz8+OQau8GvEFs=;
b=Wap2MeYptUQlEtFadKHXhKCcQ+0ObTxBCEn5M8vZ5hXqCZS/bJVvxHHHbs+ePXOeH7
qsCcNP6vEXkmPV0nNNxi33Sne2LLzg4K4APDfJRvCBjBWN9bOa7ITRx9CtrX8xX5f+yI
nze5KANFTbqy1a7/JYHQIrI3u2McsGp2NNOPDSquwC5yUgjgHX+WF+Kk0e53sdZPDPqF
/ird+VV+oNfCwAS/+lpywIM3oUqHC2iIP5Okc9ZJdUuIJF5esojEu81Xlk04IR5BNrGQ
xpzF+9paCvQoreRUWzitCJyyyUtXf2cD2pkYDwoOkhLykW/wRVQvi68f4LUKRvpGQUK4
DpmA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20230601; t=1724708878; x=1725313678;
h=to:subject:message-id:date:from:mime-version:x-gm-message-state
:from:to:cc:subject:date:message-id:reply-to;
bh=yKD21c8JHA7aJjN0oCxs55FlFD+X1Lz8+OQau8GvEFs=;
b=WMm71tgEHd3eLgY5JlHDZzXRaXZArsotTl09kAhtcwQf40E3OE+CSawMQfTeUMKxep
mPWstUBimdOKHpJqrrSk7QZu99jgHF/XiT7Id9ExXtl3dxaXYZe9lmn5Gmo/BRYdIgqU
uqxhd3w5GLFP7stjTFBmLTz0yT3+psfj/v1jIoL7KCnLBqBgWLh/UbYYb56FmWzUDVw6
xwO19SMvhBlzni4LCqrNG0R0a2OEB9DSPzP92QKAm48vZyTN/URDKaTt9JBIj4Es8ev3
lSf8IYZs3NSwBtuhBWfo7+tVWfDns71dlw6YjN95RYVBk0yZCqzh3dk8RyDw+lY750sg
mygg==
X-Gm-Message-State: AOJu0Yx8S8J3wyaMfG7CzHZ5xQzhlx3D7f75H6dJe9/H4XzJauu68I7R 1x3uSHUZAajh4ih9ioO991wcTqJwYprIzAm+uw69UDq6k6eur1yHhxNgol7djqGlLY0tUSpUwHO yH61J3cxfqbuyVJ9ZezdWyomUp4vSAQwKJ1epXxw0gySOBwkNwA==
X-Google-Smtp-Source: AGHT+IFGqRfbACz6EEQ5gpMVXUVbTPSTzxsiUXEfPpshtdyTzUa0IzO+sYU30s4xKj2d+56fk+UiRfeNV2T2GvgCzgU=
X-Received: by 2002:a05:6512:230a:b0:52b:9c8a:734f with SMTP id 2adb3069b0e04-5344e500664mr377081e87.50.1724708878141; Mon, 26 Aug 2024 14:47:58 -0700 (PDT)
MIME-Version: 1.0
From: mail m <[email protected]>
Date: Tue, 27 Aug 2024 09:47:46 +1200
Message-ID: <CAEGyM2QL92GjJ+qwxrJikXXtLEgTymj4KEikWSarSgZ+Dat+kQ@mail.example.com>
Subject:
To: "[email protected]" <[email protected]>
Content-Type: multipart/mixed; boundary="0000000000000606dc06209d1493"

--0000000000000606dc06209d1493
Content-Type: multipart/alternative; boundary="0000000000000606db06209d1491"

--0000000000000606db06209d1491
Content-Type: text/plain; charset="UTF-8"



--0000000000000606db06209d1491
Content-Type: text/html; charset="UTF-8"

<div dir="ltr"><br></div>

--0000000000000606db06209d1491
Content-Type: text/calendar; charset="UTF-8"; method=REQUEST
Content-Transfer-Encoding: 7bit

BEGIN:VCALENDAR
PRODID:-//Google Inc//Google Calendar 70.9054//EN
VERSION:2.0
CALSCALE:GREGORIAN
METHOD:REQUEST
BEGIN:VTIMEZONE
TZID:Pacific/Auckland
X-LIC-LOCATION:Pacific/Auckland
BEGIN:STANDARD
TZOFFSETFROM:+1300
TZOFFSETTO:+1200
TZNAME:GMT+12
DTSTART:19700405T030000
RRULE:FREQ=YEARLY;BYMONTH=4;BYDAY=1SU
END:STANDARD
BEGIN:DAYLIGHT
TZOFFSETFROM:+1200
TZOFFSETTO:+1300
TZNAME:GMT+13
DTSTART:19700927T020000
RRULE:FREQ=YEARLY;BYMONTH=9;BYDAY=-1SU
END:DAYLIGHT
END:VTIMEZONE
BEGIN:VEVENT
DTSTART;TZID=Pacific/Auckland:20240827T130000
DTEND;TZID=Pacific/Auckland:20240827T140000
DTSTAMP:20240826T210910Z
ORGANIZER;CN=Bob Smith:mailto:[email protected]
UID:[email protected]
ATTENDEE;CUTYPE=INDIVIDUAL;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=
TRUE;[email protected];X-NUM-GUESTS=0:mailto:[email protected]
ATTENDEE;CUTYPE=INDIVIDUAL;ROLE=REQ-PARTICIPANT;PARTSTAT=ACCEPTED;RSVP=TRUE
;CN=Bob Smith;X-NUM-GUESTS=0:mailto:[email protected]
X-GOOGLE-CONFERENCE:https://meet.google.com/rsa-doox-kda
X-MICROSOFT-CDO-OWNERAPPTID:-1280213206
CREATED:20240826T210816Z
DESCRIPTION:-::~:~::~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~
:~:~:~:~:~:~:~:~::~:~::-\nJoin with Google Meet: https://meet.google.com/rs
a-doox-kda\nOr dial: (US) +1 518-418-5317 PIN: 234935251#\nMore phone numbe
rs: https://tel.meet/rsa-doox-kda?pin=2786074988227&hs=7\n\nLearn more abou
t Meet at: https://support.google.com/a/users/answer/9282720\n\nPlease do n
ot edit this section.\n-::~:~::~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:
~:~:~:~:~:~:~:~:~:~:~:~:~:~::~:~::-
LAST-MODIFIED:20240826T210908Z
LOCATION:
SEQUENCE:0
STATUS:CONFIRMED
SUMMARY:zeta-hack-unhack
TRANSP:OPAQUE
BEGIN:VALARM
ACTION:DISPLAY
DESCRIPTION:This is an event reminder
TRIGGER:-P0DT0H10M0S
END:VALARM
END:VEVENT
END:VCALENDAR

--0000000000000606db06209d1491--
--0000000000000606dc06209d1493
Content-Type: text/calendar; charset="US-ASCII"; name="invite.ics"
Content-Disposition: attachment; filename="invite.ics"
Content-Transfer-Encoding: base64
Content-ID: <f_m0bj4gvn0>
X-Attachment-Id: f_m0bj4gvn0

QkVHSU46VkNBTEVOREFSDQpQUk9ESUQ6LS8vR29vZ2xlIEluYy8vR29vZ2xlIENhbGVuZGFyIDcw
LjkwNTQvL0VODQpWRVJTSU9OOjIuMA0KQ0FMU0NBTEU6R1JFR09SSUFODQpNRVRIT0Q6UkVRVUVT
VA0KQkVHSU46VlRJTUVaT05FDQpUWklEOlBhY2lmaWMvQXVja2xhbmQNClgtTElDLUxPQ0FUSU9O
OlBhY2lmaWMvQXVja2xhbmQNCkJFR0lOOlNUQU5EQVJEDQpUWk9GRlNFVEZST006KzEzMDANClRa
T0ZGU0VUVE86KzEyMDANClRaTkFNRTpHTVQrMTINCkRUU1RBUlQ6MTk3MDA0MDVUMDMwMDAwDQpS
UlVMRTpGUkVRPVlFQVJMWTtCWU1PTlRIPTQ7QllEQVk9MVNVDQpFTkQ6U1RBTkRBUkQNCkJFR0lO
OkRBWUxJR0hUDQpUWk9GRlNFVEZST006KzEyMDANClRaT0ZGU0VUVE86KzEzMDANClRaTkFNRTpH
TVQrMTMNCkRUU1RBUlQ6MTk3MDA5MjdUMDIwMDAwDQpSUlVMRTpGUkVRPVlFQVJMWTtCWU1PTlRI
PTk7QllEQVk9LTFTVQ0KRU5EOkRBWUxJR0hUDQpFTkQ6VlRJTUVaT05FDQpCRUdJTjpWRVZFTlQN
CkRUU1RBUlQ7VFpJRD1QYWNpZmljL0F1Y2tsYW5kOjIwMjQwODI3VDEzMDAwM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