'Garbage collect lost mail attachments. Those are attachments
- linked to res_model \'mail.compose.message\', the composer wizard
- with res_id 0, because they were created outside of an existing
wizard (typically user input through Chatter or reports
created on-the-fly by the templates)
- unused since at least one day (create_date and write_date)'

@api.model
def _garbage_collect_attachments(self):

    limit_date = (datetime.datetime.utcnow() - datetime.timedelta(days=1))
    limit_date_str = datetime.datetime.strftime(limit_date, tools.DEFAULT_SERVER_DATETIME_FORMAT)
    self.env['ir.attachment'].search([('res_model', '=', 'mail.compose.message'), ('res_id', '=', 0), ('create_date', '<', limit_date_str), ('write_date', '<', limit_date_str)]).unlink()
    return True
