Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
osticket
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
docker
osticket
Commits
1156e849
Commit
1156e849
authored
11 years ago
by
Peter Rotich
Browse files
Options
Downloads
Patches
Plain Diff
Make sure Delivered-To addresses are NOT added as collaborators
parent
c73a3571
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/class.mailparse.php
+25
-4
25 additions, 4 deletions
include/class.mailparse.php
include/class.ticket.php
+4
-0
4 additions, 0 deletions
include/class.ticket.php
with
29 additions
and
4 deletions
include/class.mailparse.php
+
25
−
4
View file @
1156e849
...
...
@@ -171,7 +171,7 @@ class Mail_Parse {
return
Mail_Parse
::
parseAddressList
(
$header
);
}
function
getDeliveredT
O
AddressList
()
{
function
getDeliveredT
o
AddressList
()
{
if
(
!
(
$header
=
$this
->
struct
->
headers
[
'delivered-to'
]))
return
null
;
...
...
@@ -463,7 +463,12 @@ class EmailDataParser {
$data
[
'name'
]
=
$data
[
'email'
];
}
//TO Address:Try to figure out the email address... associated with the incoming email.
/* Scan through the list of addressees (via To, Cc, and Delivered-To headers), and identify
* how the mail arrived at the system. One of the mails should be in the system email list.
* The recipient list (without the Delivered-To addressees) will be made available to the
* ticket filtering system. However, addresses in the Delivered-To header should never be
* considered for the collaborator list.
*/
$data
[
'emailId'
]
=
0
;
$data
[
'recipients'
]
=
array
();
$tolist
=
array
();
...
...
@@ -474,13 +479,13 @@ class EmailDataParser {
$tolist
[
'cc'
]
=
$cc
;
if
((
$dt
=
$parser
->
getDeliveredToAddressList
()))
$tolist
[
'd
t
'
]
=
$dt
;
$tolist
[
'd
elivered-to
'
]
=
$dt
;
foreach
(
$tolist
as
$source
=>
$list
)
{
foreach
(
$list
as
$addr
)
{
if
(
!
(
$emailId
=
Email
::
getIdByEmail
(
strtolower
(
$addr
->
mailbox
)
.
'@'
.
$addr
->
host
)))
{
//Skip virtual Delivered-To addresses
if
(
$source
==
'd
t
'
)
continue
;
if
(
$source
==
'd
elivered-to
'
)
continue
;
$data
[
'recipients'
][]
=
array
(
'source'
=>
"Email (
$source
)"
,
...
...
@@ -492,6 +497,22 @@ class EmailDataParser {
}
}
/*
* In the event that the mail was delivered to the system although none of the system
* mail addresses are in the addressee lists, be careful not to include the addressee
* in the collaborator list. Therefore, the delivered-to addressees should be flagged so they
* are not added to the collaborator list in the ticket creation process.
*/
if
(
$tolist
[
'delivered-to'
])
{
foreach
(
$tolist
[
'delivered-to'
]
as
$addr
)
{
foreach
(
$data
[
'recipients'
]
as
$i
=>
$r
)
{
if
(
strcasecmp
(
$r
[
'email'
],
$addr
->
mailbox
.
'@'
.
$addr
->
host
)
===
0
)
$data
[
'recipients'
][
$i
][
'source'
]
=
'delivered-to'
;
}
}
}
//maybe we got BCC'ed??
if
(
!
$data
[
'emailId'
])
{
$emailId
=
0
;
...
...
This diff is collapsed.
Click to expand it.
include/class.ticket.php
+
4
−
0
View file @
1156e849
...
...
@@ -1531,6 +1531,10 @@ class Ticket {
'isactive'
=>
(
$message
->
getUserId
()
==
$this
->
getUserId
())
?
1
:
0
);
$collabs
=
array
();
foreach
(
$vars
[
'recipients'
]
as
$recipient
)
{
// Skip virtual delivered-to addresses
if
(
strcasecmp
(
$recipient
[
'source'
],
'delivered-to'
)
===
0
)
continue
;
if
((
$user
=
User
::
fromVars
(
$recipient
)))
if
(
$c
=
$this
->
addCollaborator
(
$user
,
$info
,
$errors
))
$collabs
[]
=
sprintf
(
'%s%s'
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment