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:
@@ -283,6 +283,27 @@ function ticketMailFilesLeftOut($ticket_id, array $dropped) {
|
||||
return $note_id;
|
||||
}
|
||||
|
||||
/*
|
||||
* Say on a ticket made from an email that the email failed its sender checks - $why (ticketMailSenderCheck()),
|
||||
* $from the address it says it is from, $copied the people it copied in, who weren't added. An internal note,
|
||||
* as the ticket is made all the same, so nothing is lost. The note's id.
|
||||
*/
|
||||
function ticketMailForgedNote($ticket_id, $why, $from, array $copied = []) {
|
||||
global $mysqli;
|
||||
$ticket_id = intval($ticket_id);
|
||||
if (!$ticket_id) {
|
||||
return 0;
|
||||
}
|
||||
$note = '<b>This email failed its sender checks</b> - ' . escapeHtml($why) . '. It may not be from ' . escapeHtml($from) . '.<br>'
|
||||
. "<i>It was made a ticket so nothing is lost, but its sender wasn't answered" . ($copied ? ' and the people it copied in (' . escapeHtml(implode(', ', $copied)) . ') weren\'t added' : '')
|
||||
. '. Check with the client before acting on it.</i>';
|
||||
mysqli_query($mysqli, "INSERT INTO ticket_replies SET ticket_reply = '" . mysqli_real_escape_string($mysqli, $note) . "', ticket_reply_type = 'Internal',
|
||||
ticket_reply_time_worked = '00:00:00', ticket_reply_by = 0, ticket_reply_ticket_id = $ticket_id");
|
||||
$note_id = intval(mysqli_insert_id($mysqli));
|
||||
logTicketHistory($ticket_id, escapeSql("The email it came from failed its sender checks - it may not be from $from"));
|
||||
return $note_id;
|
||||
}
|
||||
|
||||
/*
|
||||
* A client's reply - by email, text or in the portal - passed on to the people an agent's reply goes to
|
||||
* (the ticket's To line, ticketReplyRecipients()) who didn't have it: not whoever wrote it, nor
|
||||
|
||||
Reference in New Issue
Block a user