SES / Client / create_receipt_filter



Creates a new IP address filter.

For information about setting up IP address filters, see the Amazon SES Developer Guide.

You can execute this operation no more than once per second.

See also: AWS API Documentation

Request Syntax

response = client.create_receipt_filter(
        'Name': 'string',
        'IpFilter': {
            'Policy': 'Block'|'Allow',
            'Cidr': 'string'

Filter (dict) –


A data structure that describes the IP address filter to create, which consists of a name, an IP address range, and whether to allow or block mail from it.

  • Name (string) – [REQUIRED]

    The name of the IP address filter. The name must meet the following requirements:

    • Contain only ASCII letters (a-z, A-Z), numbers (0-9), underscores (_), or dashes (-).

    • Start and end with a letter or number.

    • Contain 64 characters or fewer.

  • IpFilter (dict) – [REQUIRED]

    A structure that provides the IP addresses to block or allow, and whether to block or allow incoming mail from them.

    • Policy (string) – [REQUIRED]

      Indicates whether to block or allow incoming mail from the specified IP addresses.

    • Cidr (string) – [REQUIRED]

      A single IP address or a range of IP addresses to block or allow, specified in Classless Inter-Domain Routing (CIDR) notation. An example of a single email address is An example of a range of IP addresses is For more information about CIDR notation, see RFC 2317.

Return type:



Response Syntax


Response Structure

  • (dict) –

    An empty element returned on a successful request.



The following example creates a new IP address filter:

response = client.create_receipt_filter(
        'IpFilter': {
            'Cidr': '',
            'Policy': 'Allow',
        'Name': 'MyFilter',


Expected Output:

    'ResponseMetadata': {
        '...': '...',