<div dir="ltr">Also, make sure the time on the machine you are running this client didn't drift too far from the server's time. If this delta crosses a threshold, you will see similar issues.</div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Apr 29, 2016 at 11:07 AM, David Johnson <span dir="ltr"><<a href="mailto:djohnson.m@gmail.com" target="_blank">djohnson.m@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">I think that package is using an outdated version of the AWS Signing algorithm.<br><pre><span><font color="#008080">"AWS3-HTTPS"
</font><font face="arial, sans-serif"><span style="white-space:normal">I think AWS is migrating most of their APIs (who have domains / services created after a certain date) to require using the V4 Signature algorithm for all API requests.<br><br>The amazonka-ses would probably work better.</span></font></span></pre></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">On Fri, Apr 29, 2016 at 1:45 AM, David Escobar <span dir="ltr"><<a href="mailto:davidescobar@ieee.org" target="_blank">davidescobar@ieee.org</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div dir="ltr">Hi everyone,<div>I'm having issues with sending email through Amazon SES. I'm using the <b>Network.Mail.Mime.SES</b> package. The error I get is:</div><div><br></div><div><b>email-test-exe: SESException {seStatus = Status {statusCode = 403, statusMessage = "Forbidden"}, seCode = "SignatureDoesNotMatch", seMessage = "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.", seRequestId = "8ceb250a-0dd3-11e6-892c-4fb1a14d4732"}</b></div><div><p>What's confusing is that I'm using the same SES settings in a Rails app as well as a small Rust console program without any issues (it works from the same machine too). The only thing I can think of is that with this Haskell package, I haven't found where to set certain things like the port number (587) and so maybe it's that? Here is a small sample app that illustrates the problem. What am I missing? Thanks.</p><p><br><font face="monospace, monospace"><b>{-# LANGUAGE OverloadedStrings #-}<br>{-# LANGUAGE QuasiQuotes #-}</b></font></p><font face="monospace, monospace"><b>module Main where</b></font></div><div><font face="monospace, monospace"><b><br>import Data.Function ((&))<br>import GHC.Generics<br>import Network.HTTP.Client<br>import Network.HTTP.Client.TLS<br>import Network.Mail.Mime<br>import Network.Mail.Mime.SES<br>import Text.Hamlet (shamlet)<br>import Text.Blaze.Html.Renderer.String (renderHtml)<br><br>import qualified Data.ByteString.Char8 as C8<br>import qualified Data.Text as T<br>import qualified Data.Text.Lazy as LT<br><br>main :: IO ()<br>main = do<br> manager <- newManager tlsManagerSettings<br> let sesConfig = SES { sesFrom = C8.pack "<a href="mailto:de@somewhere.com" target="_blank">de@somewhere.com</a>",<br> sesTo = [ C8.pack "<a href="mailto:someone.else@somewhereelse.com" target="_blank">someone.else@somewhereelse.com</a>" ],<br> sesAccessKey = "SOMEAWSACCESSKEY",<br> sesSecretKey = "ANEVENLONGERAWSSECRETKEY1234567890",<br> sesRegion = usEast1 }<br> email = Mail { mailFrom = Address (Just "David Escobar") "<a href="mailto:de@somewhere.com" target="_blank">de@somewhere.com</a>",<br> mailTo = [ Address (Just "Someone Else") "<a href="mailto:someone.else@somewhereelse.com" target="_blank">someone.else@somewhereelse.com</a>" ],<br> mailParts = [ [ htmlPart testEmail ] ],<br> mailCc = [],<br> mailBcc = [],<br> mailHeaders = [ ("subject", "Some Test Email"),<br> ("Content-Type", "text/html; charset=ISO-8859-1") ] }<br> renderSendMailSES manager sesConfig email<br><br><br>testEmail :: LT.Text<br>testEmail =<br> let rows = [ [ "1", "2", "3" ], [ "4", "5", "6" ]]<br> in<br> renderHtml [shamlet|<br> $doctype 5<br> <html><br> <body><br> <table style="border: 1px solid black; border-collapse: collapse; margin: 25px 0; width: 100%;"><br> <tr><br> <th style="background-color: #072a2d; color: white; font-weight: bold; border-right: 1px solid white; padding: 5px 10px; width: 33%;"><br> Column 1<br> <th style="background-color: #072a2d; color: white; font-weight: bold; border-right: 1px solid white; padding: 5px 10px; width: 33%;"><br> Column 2<br> <th style="background-color: #072a2d; color: white; font-weight: bold; border-right: 1px solid white; padding: 5px 10px; width: 33%;"><br> Column 3<br> $forall row <- rows<br> <tr style="background-color: #f8f9ee;"><br> <td style="border: 1px solid black; padding: 5px 10px; text-align: left; width: 33%;"><br> #{T.pack $ row !! 0}<br> <td style="border: 1px solid black; padding: 5px 10px; text-align: left; width: 33%;"><br> #{T.pack $ row !! 1}<br> <td style="border: 1px solid black; padding: 5px 10px; text-align: left; width: 33%;"><br> #{T.pack $ row !! 2}<br> |] & LT.pack</b></font></div><div><br></div></div>
<br></div></div>_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org" target="_blank">Haskell-Cafe@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe</a><br>
<br></blockquote></div><span class="HOEnZb"><font color="#888888"><br><br clear="all"><div><br></div>-- <br><div>Cell: <a href="tel:1.630.740.8204" value="+16307408204" target="_blank">1.630.740.8204</a></div>
</font></span></div>
<br>_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe</a><br>
<br></blockquote></div><br></div>