-
Notifications
You must be signed in to change notification settings - Fork 513
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
Show SMTP Queue ID in Outgoing Emails #3330
Comments
It is possible to receive an SMTP Queue ID via Swiftmailer plugin:
But we can't determine to which |
I did this for another project internally. You gotta first Create the SwiftGetSmtpQueueId class where the responseReceived method extracts the SMTP queue ID from the response and then associates it with the email thread. ...and then implement the logic to associate the SMTP queue ID with the email thread. namespace App\Misc;
use Swift_Events_ResponseEvent;
use Swift_Events_ResponseListener;
class SwiftGetSmtpQueueId implements Swift_Events_ResponseListener
{
public function responseReceived(Swift_Events_ResponseEvent $evt)
{
$response = $evt->getResponse();
$response_parts = explode(' ', $response);
$smtp_queue_id = end($response_parts);
// Get the thread_id or conversation_id from the $evt object.
// The $evt object may not have this information directly,
// so you may need to modify the Freescout application
// to include this information in the $evt object when it is created.
$thread_id = $evt->getThreadId();
$conversation_id = $evt->getConversationId();
// Store the $smtp_queue_id in the database associated with the thread_id or conversation_id.
// You might create a new table in the database to store this information,
// or you might store it in an existing table.
// Here is an example of how you might store it in a new table:
$smtpQueueId = new SmtpQueueId();
$smtpQueueId->thread_id = $thread_id;
$smtpQueueId->conversation_id = $conversation_id;
$smtpQueueId->smtp_queue_id = $smtp_queue_id;
$smtpQueueId->save();
}
} ...you would need to create a new SmtpQueueId model and a new table in the database to store the thread_id, conversation_id, and smtp_queue_id. You would also need to modify the FS to include the thread_id and conversation_id in the $evt object when it is created. You will prob need to edit FS and the database schema to accommodate this new functionality. Also, you will need to handle potential errors, such as the $evt object not having the thread_id or conversation_id, or the database operation failing. |
@DavidAnderson684 We are trying to figure out why you may need SMTP Queue ID. Normally if a mail server can not deliver an email to the recipient it sends a bounce email containing all the details to FreeScout. Your mail server does not send bounce emails? |
We get bounce mails. But the cases that are more time-consuming are when the recipient doesn't see the reply for some other reason than a bounce - e.g. their spam filter silently consumed the email (far too many commercial providers do this). This results in someone having to trace the logs to see exactly whose systems lost the mail. Anything that makes this a quicker process is helpful. Without the acceptance ID showing in Freescout, someone has to read the logs and pick out the conversation via searching via non-unique fields (time, email address), so it adds inefficiency to the process (and makes it harder to automate in code). |
@DavidAnderson684 Can you give an example of your SMTP Queue ID to choose proper DB field type. |
Also what about |
Example of an SMTP queue ID from exim (www.exim.org - the most common SMTP server on the Internet according to http://www.securityspace.com/s_survey/data/man.201801/mxsurvey.html) is The Here is an example of the log entries for an uncomplicated mail that came in an out on exim. The
|
Implemented in the |
In the "Outgoing Emails" pop-up for a sent reply, when the status is "Accepted for delivery", show the ID that the receiving SMTP server gave when accepting it. This makes it much easier to trace, especially on busy SMTP servers. Plus, if the SMTP ID is known, then custom code can be written that hooks into the mailserver in order to show the log entries from there.
#3327 (comment)
The text was updated successfully, but these errors were encountered: