You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bb-email-client: a subject containing CR/LF is sent locally, rejected with InvalidInputException on AWS #1278
I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
Which package(s) are affected?
Other (@aws-blocks/bb-email-client)
Describe the bug
send() with a subject that contains a line break (for example a subject built from user input, or one that ends in \r\n) succeeds locally: the mock logs the message and returns a messageId. On AWS, SES rejects it and the block throws InvalidInputException. The mock validates addresses and the recipient count but not the subject.
Call
Local
Deployed
send({ to, subject: 'Hello\r\nWorld', body })
ok
InvalidInputException
Since a subject is often built from form input (Order from ${name}), this is a path that works in development and fails in production for some users only.
Expected behavior
The mock rejects subjects containing CR or LF with the same InvalidInputException (or both layers strip or reject them consistently, and the README says which).
Reproduction steps
constemail=newEmailClient(scope,'mail',{fromAddress: 'noreply@example.com'});awaitemail.send({to: ['success@simulator.amazonses.com'],subject: 'Hello\r\nWorld',body: 'Hi',});// ok locally, InvalidInputException deployed
Likely location: packages/bb-email-client/src/validation.ts (address and recipient-count checks only) used by send() / sendBatch() in packages/bb-email-client/src/index.mock.ts.
Activity