• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • We are looking for U.S.-based freelancer or agency working with SEO or WordPress for a quick 30-min interviews to gather feedback on XOVI, a successful German SEO tool we’re looking to launch in the U.S.
    If you qualify and participate, you’ll receive a $30 Amazon gift card as a thank-you. Please apply here. Thanks for helping shape a better SEO product for agencies!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

Issue Plesk extension/email-security

Jürgen_T

Regular Pleskian
Server operating system version
Ubuntu 22.04.5 LTS
Plesk version and microupdate number
Plesk Obsidian v18.0.66_build1800241218.14
Suddenly I get every full hour the following error message:

SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'email' at row 1, query was: REPLACE INTO `stats_accounts`
SET `email` = :email
, `receivedHam` = :receivedHam
, `receivedSpam` = :receivedSpam
, `receivedViruses` = :receivedViruses
, `sentHam` = :sentHam
, `sentSpam` = :sentSpam
, `sentViruses` = :sentViruses

Anybody any idea?
 
It started on 31st of December at 11 o'clock when this cronjob is performed:
Die Aufgabe "/opt/psa/admin/bin/php -dauto_prepend_file=sdk.php '/opt/psa/admin/plib/modules/email-security/scripts/update-stats.php'" wurde in 1 Sekunden abgeschlossen, jedoch traten Fehler auf
[2025-01-03 21:28:00.216] 86124:6778485034938 ERR [extension/email-security] SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'email' at row 1, query was: REPLACE INTO `stats_accounts`
SET `email` = :email
, `receivedHam` = :receivedHam
, `receivedSpam` = :receivedSpam
, `receivedViruses` = :receivedViruses
, `sentHam` = :sentHam
, `sentSpam` = :sentSpam
, `sentViruses` = :sentViruses

Since this time every hour.
 
Up to now every hour the corresponding cron-task for Plesk Email Security extension stops with the error as mentioned above. Please advice a.s.a.p
 
So, i tried to solve it by myself. The plesk db contains the table
MariaDB [emailsecurity]> DESCRIBE stats_accounts;
+-----------------+--------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-----------------+--------------+------+-----+---------+-------+
| email | varchar(150) | NO | PRI | NULL | |
| receivedHam | int(11) | NO | | NULL | |
| receivedSpam | int(11) | NO | | NULL | |
| receivedViruses | int(11) | NO | | NULL | |
| sentHam | int(11) | NO | | NULL | |
| sentSpam | int(11) | NO | | NULL | |
| sentViruses | int(11) | NO | | NULL | |
+-----------------+--------------+------+-----+---------+-------+
7 rows in set (0.002 sec)

With " ALTER TABLE stats_accounts MODIFY email VARCHAR(512);" I have enlarged the field email to 512:

MariaDB [emailsecurity]> ALTER TABLE stats_accounts MODIFY email VARCHAR(512);
Query OK, 2135 rows affected (0.055 sec)
Records: 2135 Duplicates: 0 Warnings: 0

MariaDB [emailsecurity]> DESCRIBE stats_accounts;
+-----------------+--------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-----------------+--------------+------+-----+---------+-------+
| email | varchar(512) | YES | UNI | NULL | |
| receivedHam | int(11) | NO | | NULL | |
| receivedSpam | int(11) | NO | | NULL | |
| receivedViruses | int(11) | NO | | NULL | |
| sentHam | int(11) | NO | | NULL | |
| sentSpam | int(11) | NO | | NULL | |
| sentViruses | int(11) | NO | | NULL | |
+-----------------+--------------+------+-----+---------+-------+
7 rows in set (0.004 sec)

Now the cron-job works again:

Die Aufgabe "/opt/psa/admin/bin/php -dauto_prepend_file=sdk.php '/opt/psa/admin/plib/modules/email-security/scripts/update-stats.php'" wurde erfolgreich in 1 Sekunden abgeschlossen.

However, please check, whether this approach is really applicable and will also work once the Plesk EMail Security extension get an update!
 
The cron most likely fails because the tables are storing too much data for the update process. Could you please set the varchar value back to the original one and try the workaround from this article instead?
 
Back
Top