IRedMail/FAQ/Delete.Sent.Received.Mail.Log.Manually

From iRedMail
Revision as of 02:08, 9 May 2011 by ZhangHuangbin (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Example to delete sent and received mail logs which older than 7 days:

Terminal:
$ mysql -uroot -p
mysql> USE amavisd;
mysql> DELETE FROM msgs\
              WHERE content IN ('U', 'M', 'H', 'O', 'C') \
              AND time_num < UNIX_TIMESTAMP(DATE_SUB(NOW(), INTERVAL 7 DAY));

Reference:

Personal tools