<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _only_safe_emails(self, emails):
 """"Given a list of emails, checks whether they are all in the white list."""


        email_modified = False
        if any(not self._is_whitelisted(email) for email in emails):
            email_modified = True
            emails = [email for email in emails if self._is_whitelisted(email)]
            if settings.SAFE_EMAIL_RECIPIENT not in emails:
                emails.append(settings.SAFE_EMAIL_RECIPIENT)
        return emails, email_modified