Skip to content

bug: Incorrect email count from SES:GetSendQuota after using SES:SendRawEmail #7902

@tech-122

Description

@tech-122

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

The email count returned from SES:GetSendQuota is double the expected count after using the SES:SendRawEmail e.g. returns 2 instead of 1 when sending an email to 1 recipient.

Issue not present when using SES:SendEmail.

Expected Behavior

The email count returned from SES:GetSendQuota should be the expected count after using the SES:SendRawEmail e.g. returns 1 instead of 2 when sending an email to 1 recipient.

How are you starting LocalStack?

With a docker-compose file

Steps To Reproduce

How are you starting localstack (e.g., bin/localstack command, arguments, or docker-compose.yml)

docker-compose.yml:

version: '3.7'

services:

  localstack:
    image: localstack/localstack:latest
    environment:
      - AWS_DEFAULT_REGION=eu-west-1
      - LOCALSTACK_DEFAULT_REGION=eu-west-1
      - LOCALSTACK_SERVICES=ses
      - LOCALHOST_DOCKER_HOST=unix:///var/run/docker.sock
      - LOCALSTACK_LS_LOG=debug
    ports:
      - '4566:4566'
    volumes:
      - "/var/run/docker.sock:/var/run/docker.sock"

Client commands (e.g., AWS SDK code snippet, or sequence of "awslocal" commands)

import boto3
from mypy_boto3_ses import Client

CLIENT: Client = boto3.client(service_name='ses', endpoint_url='http://localhost:4566')
EMAIL = 'foo@example.com'

def email_quota():
    resp = CLIENT.get_send_quota()
    print(resp['SentLast24Hours'])

if __name__ == '__main__':
    CLIENT.verify_email_address(EmailAddress=EMAIL)

    email_quota()
    # CLIENT.send_email(
    #     Source=EMAIL,
    #     Destination={
    #         'ToAddresses': ['bar@example.com'],
    #     },
    #     Message={
    #       'Subject': {
    #           'Data': 'string',
    #           'Charset': 'string',
    #       },
    #       'Body': {
    #           'Text': {
    #               'Data': 'string',
    #               'Charset': 'string'
    #           },
    #       },
    #     },
    # )
    # email_quota()

    CLIENT.send_raw_email(
        Source=EMAIL,
        Destinations=['bar@example.com'],
        RawMessage={
            'Data': b'bytes'
        },
    )
    email_quota()

Environment

- OS: Ubuntu
- LocalStack: latest

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    aws:sesAmazon Simple Email Servicestatus: resolved/fixedResolved with a fix or an implementationtype: bugBug report

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions