• Amazon не работает ключ на сервисе SES?

    @hallyaxon Автор вопроса
    Вадим, Не совсем понимаю, а как получить ответ
    https://docs.aws.amazon.com/ses/latest/DeveloperGu...
  • Amazon не работает ключ на сервисе SES?

    @hallyaxon Автор вопроса
    Денис Дерепко, но вот по документации
    https://docs.aws.amazon.com/ses/latest/DeveloperGu...
    Все проходит, и письмо приходит
    openssl s_client -crlf -quiet -starttls smtp -connect email-smtp.us-west-2.amazonaws.com:587 < input.txt
    depth=2 C = US, O = Amazon, CN = Amazon Root CA 1
    verify return:1
    depth=1 C = US, O = Amazon, OU = Server CA 1B, CN = Amazon
    verify return:1
    depth=0 CN = email-smtp.us-west-2.amazonaws.com
    verify return:1
    250 Ok
    250-email-smtp.amazonaws.com
    250-8BITMIME
    250-STARTTLS
    250-AUTH PLAIN LOGIN
    250 Ok
    334 VXNlcm5hbWU6
    334 UGFzc3dvcmQ6
    235 Authentication successful.
    250 Ok
    250 Ok
    354 End data with .
    250 Ok 0101017a5c8bacb9-442094c6-c738-4d83-839f-138b2eb8db17-000000
  • Amazon не работает ключ на сервисе SES?

    @hallyaxon Автор вопроса
    Денис Дерепко, пошел я по такому простому примеру
    https://docs.aws.amazon.com/ses/latest/DeveloperGu...

    composer require aws/aws-sdk-php

    Указываю в файле
    $SesClient = new SesClient([
    'profile' => 'default',
    'version' => '2010-12-01',
    'region' => 'us-west-2',
    'credentials' => [
    'key' => 'мой ключ',
    'secret' => 'мой секрет',
    ],
    ]);

    Даю команду на выполнение и вот что:
    php amazon-ses-sample.php

    Error executing "SendEmail" on "https://email.us-west-2.amazonaws.com"; AWS HTTP error: Client error: `POST https://email.us-west-2.amazonaws.com` resulted in a `403 Forbidden` response:


    Sender
    SignatureDo (truncated...)
     SignatureDoesNotMatch (client): The request signature we calculated does not match the signature you provided. Check your AWS Secret Access Key and signing method. Consult the service documentation for details.
    
    The Canonical String for this request should have been
    'POST
    /
    
    host:email.us-west-2.amazonaws.com
    x-amz-date:20210630T103838Z
    x-amz-user-agent:aws-sdk-php/3.185.3
    
    host;x-amz-date;x-amz-user-agent
    0c715cf587bf393b8ad6a1a60a800a2c465e4ef30da2abc89dd0f15c8ea35517'
    
    The String-to-Sign should have been
    'AWS4-HMAC-SHA256
    20210630T103838Z
    20210630/us-west-2/ses/aws4_request
    b6821aa5ce81a981b3578460ce523ea55253c5dc70524ff8291702e0e61801c3'
     - <ErrorResponse xmlns="http://ses.amazonaws.com/doc/2010-12-01/">
      <Error>
        <Type>Sender</Type>
        <Code>SignatureDoesNotMatch</Code>
        <Message>The request signature we calculated does not match the signature you provided. Check your AWS Secret Access Key and signing method. Consult the service documentation for details.
    
    The Canonical String for this request should have been
    'POST
    /
    
    host:email.us-west-2.amazonaws.com
    x-amz-date:20210630T103838Z
    x-amz-user-agent:aws-sdk-php/3.185.3
    
    host;x-amz-date;x-amz-user-agent
    0c715cf587bf393b8ad6a1a60a800a2c465e4ef30da2abc89dd0f15c8ea35517'
    
    The String-to-Sign should have been
    'AWS4-HMAC-SHA256
    20210630T103838Z
    20210630/us-west-2/ses/aws4_request
    b6821aa5ce81a981b3578460ce523ea55253c5dc70524ff8291702e0e61801c3'
    </Message>
      </Error>
      <RequestId>49a037f6-e372-4728-85c9-756f5ffcd176</RequestId>
    </ErrorResponse>
    The email was not sent. Error message: The request signature we calculated does not match the signature you provided. Check your AWS Secret Access Key and signing method. Consult the service documentation for details.
    
    The Canonical String for this request should have been
    'POST
    /
    
    host:email.us-west-2.amazonaws.com
    x-amz-date:20210630T103838Z
    x-amz-user-agent:aws-sdk-php/3.185.3
    
    host;x-amz-date;x-amz-user-agent
    0c715cf587bf393b8ad6a1a60a800a2c465e4ef30da2abc89dd0f15c8ea35517'
    
    The String-to-Sign should have been
    'AWS4-HMAC-SHA256
    20210630T103838Z
    20210630/us-west-2/ses/aws4_request
    b6821aa5ce81a981b3578460ce523ea55253c5dc70524ff8291702e0e61801c3'
    
    
    Причем поставился самый последний x-amz-user-agent:aws-sdk-php/3.185.3
    У меня же в проекте aws-sdk-php2/2.8.7 Guzzle/3.9.3
  • Amazon не работает ключ на сервисе SES?

    @hallyaxon Автор вопроса
    Только из ошибки кажется он ругается на какую то подпись

    [2021-06-30 12:02:52] Postal.ERROR: Aws\Ses\Exception\SesException: AWS Error Code: SignatureDoesNotMatch, Status Code: 403, AWS Request ID: 9ed956c6-c6d5-41ba-b446-b48b4d983179, AWS Error Type: client, AWS Error Message: The request signature we calculated does not match the signature you provided. Check your AWS Secret Access Key and signing method. Consult the service documentation for details. The Canonical String for this request should have been 'POST / host:email.us-west-2.amazonaws.com x-amz-date:20210630T090251Z host;x-amz-date a1207db1284cb2cc2b2bde552383c4cb799d8f5f520b491c6733191ddbcba9c9' The String-to-Sign should have been 'AWS4-HMAC-SHA256 20210630T090251Z 20210630/us-west-2/ses/aws4_request a068424c7867e4f708062d3ecd964f50ff99602fab9fecad199a8a657ce2b919' , User-Agent: aws-sdk-php2/2.8.7 Guzzle/3.9.3 curl/7.58.0 PHP/7.2.24-0ubuntu0.18.04.7
    O:52:"\Postal\MailBundle\Model\Report\SendReport":6:{s:10:"statusCode";i:2;s:9:"messageId";N;s:10:"messageUid";N;s:9:"errorCode";s:21:"SignatureDoesNotMatch";s:12:"errorMessage";s:835:"Aws\Ses\Exception\SesException: AWS Error Code: SignatureDoesNotMatch, Status Code: 403, AWS Request ID: 9ed956c6-c6d5-41ba-b446-b48b4d983179, AWS Error Type: client, AWS Error Message: The request signature we calculated does not match the signature you provided. Check your AWS Secret Access Key and signing method. Consult the service documentation for details.

    The Canonical String for this request should have been
    'POST
    /

    host:email.us-west-2.amazonaws.com
    x-amz-date:20210630T090251Z

    host;x-amz-date
    a1207db1284cb2cc2b2bde552383c4cb799d8f5f520b491c6733191ddbcba9c9'

    The String-to-Sign should have been
    'AWS4-HMAC-SHA256
    20210630T090251Z
    20210630/us-west-2/ses/aws4_request
    a068424c7867e4f708062d3ecd964f50ff99602fab9fecad199a8a657ce2b919'
    , User-Agent: aws-sdk-php2/2.8.7 Guzzle/3.9.3 curl/7.58.0 PHP/7.2.24-0ubuntu0.18.04.7";s:9:"timestamp";O:8:"DateTime":3:{s:4:"date";s:26:"2021-06-30 12:02:52.525424";s:13:"timezone_type";i:3;s:8:"timezone";s:13:"Europe/Moscow";}}
  • Amazon не работает ключ на сервисе SES?

    @hallyaxon Автор вопроса
    Денис Дерепко, потому что через telnet и postfix все ходит, а в проекте на symfony2 не ходят
  • Amazon не работает ключ на сервисе SES?

    @hallyaxon Автор вопроса
    Вадим,

    Ключ рабочий, под ключом понимаю security_credentials
    Access key ID
    2021-06-28 12:02 UTC+0300
    2021-06-30 10:22 UTC+0300 with ses-smtp in us-west-2

    Вот это работает
    https://docs.aws.amazon.com/ses/latest/DeveloperGu...
    Postfix тоже шлет письма
    https://docs.aws.amazon.com/ses/latest/DeveloperGu...
    также как и через telnet 127.0.0.1 25 письма уходят

    Но почему же именно из проекта на Symfony2 письма не ходят