def run(self, from_email, recipients, message):
        self._open_ses_conn()
        try:
            # We use the send_raw_email func here because the Django
            # EmailMessage object we got these values from constructs all of
            # the headers and such.
            self.connection.send_raw_email(
                source=from_email,
                destinations=recipients,
                raw_message=dkim_sign(message),
            )
        except SESAddressBlacklistedError, exc:
            # Blacklisted users are those which delivery failed for in the
            # last 24 hours. They'll eventually be automatically removed from
            # the blacklist, but for now, this address is marked as
            # undeliverable to.
            logger.warning(
                'Attempted to email a blacklisted user: %s' % recipients,
                exc_info=exc,
                extra={'trace': True}
            )
            return False
        except SESDomainEndsWithDotError, exc:
            # Domains ending in a dot are simply invalid.
            logger.warning(
                'Invalid recipient, ending in dot: %s' % recipients,
                exc_info=exc,
                extra={'trace': True}
            )
            return False
        except SESLocalAddressCharacterError, exc:
            # Invalid character, usually in the sender "name".
            logger.warning(
                'Local address contains control or whitespace: %s' % recipients,
                exc_info=exc,
                extra={'trace': True}
            )
            return False
        except SESIllegalAddressError, exc:
            # A clearly mal-formed address.
            logger.warning(
                'Illegal address: %s' % recipients,
                exc_info=exc,
                extra={'trace': True}
            )
            return False
        except Exception, exc:
            # Something else happened that we haven't explicitly forbade
            # retry attempts for.
            #noinspection PyUnresolvedReferences
            logger.error(
                'Something went wrong; retrying: %s' % recipients,
                exc_info=exc,
                extra={'trace': True}
            )
            self.retry(exc=exc)
        else:
            logger.info('An email has been successfully sent: %s' % recipients)

        # We shouldn't ever block long enough to see this, but here it is
        # just in case (for debugging?).
        return True
Test the decorated method when there is not an auth token
dataset/ETHPy150Open duointeractive/sea-cucumber/seacucumber/tasks.py/SendEmailTask.run--crossover with--dataset/ETHPy150Open openpermissions/koi/tests/unit/auth/test_auth_decorator.py/_AuthenticateBase.test_decorated_method_without_token