Esempio n. 1
0
def make_mx_record(domain):
    """
    Makes an mx record for a domain that we own.

    :return: The status returned from the add_mx call if it was successful.
    """
    if not domain_exists(domain):
        return None
    connection = EfficientRoute53Connection(settings.AWS_ACCESS_KEY_ID,
                                            settings.AWS_SECRET_KEY)
    zone = connection.get_hosted_zone_by_name(domain)
    if zone:
        zone = Zone(connection, zone['GetHostedZoneResponse']['HostedZone'])

    return zone.add_mx(domain , ['10 mx.sendgrid.net'])