XF 1.3 Understanding Server Log Mail Errors

Marcus

Well-known member
I get thousands of these errors today. The most important thing for me is whether xenforo tries to resend these mails, or whether these mails are not sent after the error is displayed [so I can just resend them with php connection, without smtp to the amazon ses service].

 
As it stands, the emails are not re-queued if you get an error while sending them. (This is one of the reasons we generally don't recommend calling a remote SMTP server directly, given an option.)
 
For reference, some queries to help fixing email issues:

Display email errors sorted by hour from today 30.06.2014
SELECT FROM_UNIXTIME(exception_date, "%H") AS hourtoday, count(*) FROM xf_error_log WHERE FROM_UNIXTIME(exception_date, "%d %m %Y") = "30 06 2014" GROUP BY hourtoday ORDER BY hourtoday DESC;
+-----------+----------+
| hourtoday | count(*) |
+-----------+----------+
| 18 | 12838 |
| 17 | 13955 |
| 16 | 94307 |
| 15 | 314327 |
| 14 | 184355 |
| 13 | 43642 |
+-----------+----------+
10 rows in set (0.01 sec)

Grab all emails from today
SELECT SUBSTRING(message,10, LOCATE("failed",message)-10) FROM xf_error_log WHERE FROM_UNIXTIME(exception_date, "%d %m %Y") = "30 06 2014";

Grab all emails from today, 6 pm
SELECT SUBSTRING(message,10, LOCATE("failed",message)-10) FROM xf_error_log WHERE FROM_UNIXTIME(exception_date, "%d %m %Y %H") = "30 06 2014 18";

Put all grabbed mails to usergroup 11 (this is only for communities WITH NO ADDITIONAL USERGROUPS. I just created usergroup with id=11. This query will remove all users from secondary usergroups, too!)
UPDATE xf_user SET secondary_group_ids = "11" WHERE email IN ("mail...", )

Grab all emails from today, 6 pm and put them to usergroup 11
UPDATE xf_user SET secondary_group_ids = "11" WHERE email IN (SELECT SUBSTRING(message,10, LOCATE("failed",message)-10) FROM xf_error_log WHERE FROM_UNIXTIME(exception_date, "%d %m %Y %H") = "30 06 2014 18");

Now you can mail the addresses not working on 6pm with "acp>send mail>to usergroup 11".
 
Last edited:
Back
Top Bottom