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".