Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AWS::SES Response Error: InvalidParameterValue - Illegal content #51

Open
Meekohi opened this issue Mar 21, 2014 · 5 comments
Open

AWS::SES Response Error: InvalidParameterValue - Illegal content #51

Meekohi opened this issue Mar 21, 2014 · 5 comments

Comments

@Meekohi
Copy link

Meekohi commented Mar 21, 2014

This is probably an error in my usage, but I can't figure it out.

Mailer.mail_from_address = "Arqball Spin <noreply@arqspin.com>"
subject = "test"
...
mail :to => "meekohi@gmail.com",
  :from => Mailer.mail_from_address,
  :subject => subject

I know that the from address is static and works sometimes, so I cannot understand how to debug the following, which seems to be a problem with the Sender field? Is there any way to print the entire request sent to SES for debugging?

AWS::SES Response Error: InvalidParameterValue - Illegal content.
--- !ruby/exception:AWS::SES::ResponseError
message: 'AWS::SES Response Error: InvalidParameterValue - Illegal content.'
response: !ruby/string:AWS::SES::SendRawEmailResponse
  str: !binary |-
    PEVycm9yUmVzcG9uc2UgeG1sbnM9Imh0dHA6Ly9zZXMuYW1hem9uYXdzLmNv
    bS9kb2MvMjAxMC0xMi0wMS8iPgogIDxFcnJvcj4KICAgIDxUeXBlPlNlbmRl
    cjwvVHlwZT4KICAgIDxDb2RlPkludmFsaWRQYXJhbWV0ZXJWYWx1ZTwvQ29k
    ZT4KICAgIDxNZXNzYWdlPklsbGVnYWwgY29udGVudC48L01lc3NhZ2U+CiAg
    PC9FcnJvcj4KICA8UmVxdWVzdElkPjRhMTBkZmMzLWIxNGItMTFlMy1hNWQz
    LWJkZmJkZTgyNTZhMzwvUmVxdWVzdElkPgo8L0Vycm9yUmVzcG9uc2U+Cg==
  action: SendRawEmail
  response: !ruby/object:Net::HTTPBadRequest
    http_version: '1.1'
    code: '400'
    message: Bad Request
    header:
      x-amzn-requestid:
      - 4a10dfc3-b14b-11e3-a5d3-bdfbde8256a3
      content-type:
      - text/xml
      content-length:
      - '268'
      date:
      - Fri, 21 Mar 2014 22:51:07 GMT
    body: |
      <ErrorResponse xmlns="http://ses.amazonaws.com/doc/2010-12-01/">
        <Error>
          <Type>Sender</Type>
          <Code>InvalidParameterValue</Code>
          <Message>Illegal content.</Message>
        </Error>
        <RequestId>4a10dfc3-b14b-11e3-a5d3-bdfbde8256a3</RequestId>
      </ErrorResponse>
    read: true
    uri: 
    decode_content: true
    socket: 
    body_exist: true
  body: |
    <ErrorResponse xmlns="http://ses.amazonaws.com/doc/2010-12-01/">
      <Error>
        <Type>Sender</Type>
        <Code>InvalidParameterValue</Code>
        <Message>Illegal content.</Message>
      </Error>
      <RequestId>4a10dfc3-b14b-11e3-a5d3-bdfbde8256a3</RequestId>
    </ErrorResponse>
  parsed:
    xmlns: http://ses.amazonaws.com/doc/2010-12-01/
    Error: &1
      Type: Sender
      Code: InvalidParameterValue
      Message: Illegal content.
    RequestId: 4a10dfc3-b14b-11e3-a5d3-bdfbde8256a3
  error: *1
@geekdreamzz
Copy link

@Meekohi I'm curious if you see the same error if you change
Mailer.mail_from_address = "Arqball Spin noreply@arqspin.com"
to
Mailer.mail_from_address = "noreply@arqspin.com"
Also the "From" address usually needs to be "verified" by AWS SES. A verification email with a verification link would need to sent to noreply@arqspin.com before setting it as the "From" email while using SES.

@ajlanghorn
Copy link

I think the value of Mailer.mail_from_address would need to be changed to "Arqball Spin <noreply@arqspin.com>" to get this to work, due to the RFC on the headers.

@Meekohi
Copy link
Author

Meekohi commented Jun 10, 2014

@ajlanghorn I don't see the difference from the original code?

@ajlanghorn
Copy link

@Meekohi Sorry, you're right - I'm being daft.

@zakelfassi
Copy link

The safest way to deal with this issue is tightly wrap your code according to RFCs; i.e. your from address should always look like "\"#{from_name}\" <#{from_email}>".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants