email processing stuck because of msg ID field length

This plugin allows you to report an issue in MantisBT by sending an email to a particular mail account

Moderators: Developer, Contributor

Post Reply
weilai_irl
Posts: 1
Joined: 25 Feb 2021, 12:03

email processing stuck because of msg ID field length

Post by weilai_irl »

We have seen an issue occasionally when processing certain emails failed. The email will be added multiple times as new tickets/notes, but will not be deleted/archived. As a result, all future emails will not be processed, unless the one with the issue gets moved out of inbox manually.

After some investigation, we noticed that the issue is with the length of the msg_id field in the mantis_plugin_EmailReporting_msgids_table table. The exact error we have seen is:

Code: Select all

Mailbox: newticket@sample.com
Message: Reporter: 1000 - test@sample.com --> Issue ID: #99999

APPLICATION ERROR #401: Database query failed. Error received from database was #1406: Data too long for column 'msg_id' at row 1 for the query: INSERT INTO mantis_plugin_EmailReporting_msgids_table( issue_id, msg_id ) VALUES (?, ?).
2021-01-01 01:00 GMT MAIL_VERBOSE email_api.php:2377 email_shutdown_function() Shutdown function called for /var/www/support.sample.com/www/plugins/EmailReporting/scripts/bug_report_mail.php
This was resolved after the length of the msg_id field was increased from 255 to a higher value in the database.

The msg_id of the email in question was actually over 300 chars, it's something like:
"<DB5PR1902MB1720E4D6C93CEC4049574CB4F48C9@DB6PR0902MB1320.eurprd.prod.outlook.com>,
<035907d700a1$fa223740$ee66a5c0$@sample.com>,<DB6PR1902MB1320E560E1B88A44181A49C2F48C9@DB6PR0902MB1320.eurprd09.prod.outlook.com>,<DB5PR0902MB1720D52047488B60759968C6F48C9@DB6PR0902MB1320.eurprd09.prod.outlook.com>"

According to https://stackoverflow.com/a/34811337, the msg ID of an email can be as long as 955 chars. Maybe this is something that can be fixed in the plugin?

Regards,
Lai
SL-Gundam
Posts: 729
Joined: 06 Jul 2011, 14:17

Re: email processing stuck because of msg ID field length

Post by SL-Gundam »

I take it you are running 0.10.1?
This was fixed in 0.11.0-DEV here: https://github.com/mantisbt-plugins/Ema ... 5bb7939d35

We choose to ignore anything longer then 255 chars per message id.

Please update to the latest DEV version
Post Reply