mirror of
https://github.com/itflow-org/itflow
synced 2026-12-02 09:09:01 +00:00
Mail review stage 8: Admin > Ignored Senders lists addresses and domains whose email the ticket mailbox sets aside with no ticket, reply, answer or Unprocessed Email entry, a domain taking its subdomains, each counting what it set aside and saving one that takes a contact's or client's email saying so; Ignore Sender in Unprocessed Email ignores the address or its domain and dismisses the others waiting, leaving contacts, client domains and public domains to an admin; Try an Email has the step; every queued email gets its own Message-ID and invoice and quote emails say what they are about, so a bounce marks the email it came back about as Bounced with the mail server's reason in a new Mail Queue tab, on the ticket reply for those it names and in the invoice or quote history, matched by address and subject when the report has no Message-ID; .gitignore leaves out uploads/mail_unprocessed and uploads/kb (database 4.3.5); 26.12.3 changelog
This commit is contained in:
@@ -247,7 +247,9 @@ function addTicket($contact_id, $contact_name, $contact_email, $client_id, $date
|
||||
* The addresses it failed for are marked on their contacts ("Email bounced", functions/contact_bounce.php), the ticket
|
||||
* the email was about gets a note - found by the Message-ID of the email that bounced, as ITFlow keeps each it sends
|
||||
* about a ticket, else by the number in its subject - and the agent it is assigned to gets a notice, or the admins when
|
||||
* nobody has it or it is about no ticket (ticketNotifyOwner()). A report that an email is only delayed is set aside.
|
||||
* nobody has it or it is about no ticket (ticketNotifyOwner()). The email in the mail queue is marked Bounced
|
||||
* (mailQueueBounced(), functions/mail_queue.php) - an agent's reply says so, and an invoice's or quote's history. A report
|
||||
* that an email is only delayed is set aside.
|
||||
*/
|
||||
function addBounce($message, array $headers, $from_email, $subject) {
|
||||
global $mysqli;
|
||||
@@ -279,6 +281,9 @@ function addBounce($message, array $headers, $from_email, $subject) {
|
||||
$to = $bounce['failed'] ? implode(', ', array_keys($bounce['failed'])) : 'someone it doesn\'t name';
|
||||
$why = implode('; ', array_filter($bounce['failed']));
|
||||
|
||||
// The email that bounced, in the mail queue - Bounced, where it said Sent
|
||||
mailQueueBounced($bounce['message_id'], $bounce['failed'], $bounce['subject']);
|
||||
|
||||
if ($ticket) {
|
||||
$note = '<b>An email about this ticket couldn\'t be delivered</b><br>To: ' . escapeHtml($to) . ($why !== '' ? '<br>The mail server said: ' . escapeHtml($why) : '')
|
||||
. '<br><i>From ' . escapeHtml(stripslashes($from_email)) . ' - the report is in the mailbox\'s ITFlow folder</i>';
|
||||
@@ -1013,6 +1018,19 @@ foreach ($messages as $message) {
|
||||
$message->move($targetFolderPath);
|
||||
continue;
|
||||
}
|
||||
|
||||
// An ignored sender (Admin > Ignored Senders, functions/mail_ignore.php) - set aside: no ticket, no reply on one, no
|
||||
// answer. Not an email an agent asked to make a ticket or add to one (Tickets > Unprocessed Email)
|
||||
$ignored = !($message instanceof MailUnprocessedMessage && in_array($message->asked(), ['ticket', 'reply'], true)) ? mailIgnoreFind($from_raw) : null;
|
||||
if ($ignored) {
|
||||
mailIgnoreHit($ignored['ignored_sender_id']);
|
||||
logApp("Cron-Email-Parser", "info", "Email parser set aside an email from $from_email ($subject) - " . escapeSql($ignored['ignored_sender_match']) . " is an ignored sender");
|
||||
$processed_count++;
|
||||
$message->markSeen();
|
||||
$message->move($targetFolderPath);
|
||||
continue;
|
||||
}
|
||||
|
||||
$automatic = ticketMailAutomaticKind($headers, stripslashes($subject));
|
||||
|
||||
// Whether the mail server that took it found it forged - by SPF, DKIM and DMARC (ticketMailSenderCheck()). A From line can say
|
||||
|
||||
Reference in New Issue
Block a user