mirror of
https://github.com/itflow-org/itflow
synced 2026-12-02 00:59:03 +00:00
Mail review stage 3: email-to-ticket reads the receiving server's Authentication-Results and treats an email failing DMARC for a domain that asks for reject or quarantine, or SPF with nothing else passing, as from a stranger - a reply is an internal note that reopens nothing, a new email still makes a ticket with a note but copies nobody in and gets no answer, and it never makes a contact; someone who isn't a contact is answered without their own subject; 26.12.3 changelog
This commit is contained in:
@@ -737,6 +737,7 @@ function ticketEmailPreview(array $email) {
|
||||
* (emailQueue()), for ticketReplyEmailed()
|
||||
* answering the Message-ID of the email it answers, when it answers one
|
||||
* auto replied or generated - one of ITFlow's own automatic emails (emailQueue()'s auto)
|
||||
* subject in place of the ticket's own (ticketEmailSubject()) - with its number, so a reply finds it
|
||||
*/
|
||||
function ticketMailSend($ticket_id, array $email, array $opts = []) {
|
||||
global $mysqli;
|
||||
@@ -786,7 +787,7 @@ function ticketMailSend($ticket_id, array $email, array $opts = []) {
|
||||
return (($b['group'] ?? '') === 'contact') <=> (($a['group'] ?? '') === 'contact');
|
||||
});
|
||||
$to_contact = ($recipients[0]['group'] ?? '') === 'contact';
|
||||
return count(emailQueue($recipients, ticketEmailSubject($row), $email, ['from' => ticketEmailFrom(), 'attachments' => $opts['attachments'] ?? [], 'cal_str' => $opts['cal_str'] ?? '',
|
||||
return count(emailQueue($recipients, (string) ($opts['subject'] ?? ticketEmailSubject($row)), $email, ['from' => ticketEmailFrom(), 'attachments' => $opts['attachments'] ?? [], 'cal_str' => $opts['cal_str'] ?? '',
|
||||
'ticket_reply_id' => intval($opts['ticket_reply_id'] ?? 0), 'ticket_id' => $ticket_id,
|
||||
'together' => ticketMailSettings()['copy'],
|
||||
'together_footnote' => $to_contact
|
||||
@@ -876,14 +877,16 @@ function ticketMailColleaguesNew($ticket_id) {
|
||||
* unless $to_ccs is false; or to $to (ticketMailSend()'s) in their
|
||||
* place. $how agent, email or scheduled (ticketEmailContent()).
|
||||
*/
|
||||
function ticketMailCreated($ticket_id, $attachments = [], $to_ccs = true, $how = 'agent', ?array $to = null) {
|
||||
function ticketMailCreated($ticket_id, $attachments = [], $to_ccs = true, $how = 'agent', ?array $to = null, ?string $subject = null) {
|
||||
$row = ticketRow($ticket_id);
|
||||
if (!$row) {
|
||||
return 0;
|
||||
}
|
||||
// Emailed in, it is an automatic answer to that email - which says so, so the other side doesn't answer it (functions/ticket_mail_auto.php)
|
||||
// Emailed in, it is an automatic answer to that email - which says so, so the other side doesn't answer it (functions/ticket_mail_auto.php).
|
||||
// $subject in place of the ticket's - an emailed ticket from someone who isn't a contact is answered without their own words
|
||||
return ticketMailSend($row['ticket_id'], ticketEmailContent($row, 'created', ['how' => $how]),
|
||||
['attachments' => $attachments, 'to_ccs' => $to_ccs, 'kind' => 'created'] + ($to !== null ? ['to' => $to] : []) + ($how === 'email' ? ['auto' => 'replied'] : []));
|
||||
['attachments' => $attachments, 'to_ccs' => $to_ccs, 'kind' => 'created'] + ($to !== null ? ['to' => $to] : []) + ($how === 'email' ? ['auto' => 'replied'] : [])
|
||||
+ ($subject !== null ? ['subject' => $subject] : []));
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user