I don't understand how to put this into a cron job?
how does it know how to connect mysql?
// First one, used to delete quarantined mails which older than 7 days.
// Change "7 DAY" to whatever you want, e.g. 10, means delete mails older than 10 days.
DELETE FROM msgs WHERE content IN ('S', 's', 'V', 'Y') AND quar_type = 'Q' AND time_num < UNIX_TIMESTAMP(DATE_SUB(NOW(), INTERVAL 7 DAY))
// Delete old data in table msgs and msgrcpt.
DELETE msgrcpt.* FROM msgrcpt INNER JOIN msgs ON msgrcpt.mail_id=msgs.mail_id WHERE msgs.content IN ('U', 'M', 'H', 'O', 'C') AND msgs.time_num < UNIX_TIMESTAMP(DATE_SUB(NOW(), INTERVAL 7 DAY))