kalys / bamboo_ses

AWS SES adapter for Bamboo
MIT License
35 stars 24 forks source link

Issues with Updating from V0.2 to V0.4 #58

Closed ckoch-cars closed 5 hours ago

ckoch-cars commented 1 week ago

Tested with BambooSes V0.2.1, BambooSes V0.4.4, and current master SHA: efe6e45 Elixir V 1.16.3 OTP 26.2.5.2

We were using Bamboo + this adapter for a while now (3+ years). When updating to the latest release, we noticed some small changes to emails that ultimately get delivered.

Example: When html_body is nil on BambooSES V0.2 The email is generated with Content-Type: multipart/alternative; boundary=... but then there is only one part to the email. The internal Content-Type within the boundary is Content-Type: text/html.

I am not sure if this is strictly correct, as there should be no html content. (Should this be "text/plain" instead)

Example: When html_body is nil on BambooSES V0.4.4 or master The email is generated with Content-Type: text/html; charset="UTF-8" (Should this be "text/plain" instead)?

Example: When html_body and text_body are both set on BambooSES V0.4.4 or master Content-Type: multipart/alternative; boundary=... The internal Content-Type within the (first) boundary is Content-Type: text/plain; charset=UTF-8 and the within the second boundary is Content-Type: text/html; charset=UTF-8

None of these changes are wrong per se, but the changes seem to be having an effect on a subset of our downstream recipients. Some messages are marked as SPAM and/or are not parsing correctly by an automated email ingestion system (think CRM to automatically read the XML contents of a text_body into a DB somewhere).

There's an amount of metaprogramming and/or "auto-magic" that happens in Bamboo.SesAdapter.deliver/2, so I'm not really sure at which point the Bamboo.Email struct is transformed into the text which gets sent as the SES message.

I would like to write a test to document this behavior, but I am not sure how I can make assertions about how the Email struct is transformed or at which point the Multipart / Content-Type is determined and set.

Again, I'm not sure of this is an issue with BambooSES or perhaps in how Mail vs SMTPMailer are handling data they receive. Any insight or guidance you can provide would be helpful.

kalys commented 1 week ago

Hey! Thank you for the comment!

I'll start looking into the problem you described within 3-5 days.

ckoch-cars commented 1 week ago

Additional testing note: Looking through the commit history, the thing that jumped out to me was the switch from Mail to :gen_smtp.

I tested an email with V0.3.2, which looks to be just prior to the gen_smtp change.

When I send the message through SES as in the examples above, I see the Content-Type is coming through as: Content-Type: text/html; charset="UTF-8" not multipart.

ckoch-cars commented 1 week ago

Additional note 2: In addition to the change noted in the content-type, it appears that messages built and sent using BambooSES V0.4.4 do not have a To: field in the received message headers.

There is a Delivered-To: field (in both 0.2 and 0.4).

Example headers from a message delivered through SES (these messages started with the same %Bamboo.Email{}

V0.4.4

Delivered-To: ckoch@cars.com
Received: by 2002:a54:37c5:0:b0:26b:5319:89fa with SMTP id v5csp512459ect;
        Fri, 11 Oct 2024 07:23:14 -0700 (PDT)
X-Forwarded-Encrypted: i=2; AJvYcCVPUlPPVw4RjxQSTHyAq7bLgSf5k3oiklenpi50hU0AH6OGOtL397PUnQki/Sqmw7sR4Dw+hw==@cars.com
X-Google-Smtp-Source: AGHT+IGUnCzhtO8wyQyb2/S09Va5eIxNoN3D+odFCDrhaqQXJ8WpkocoHQo3mH9mtKuk17ypRyUR
X-Received: by 2002:a05:6902:1384:b0:e29:430:ee55 with SMTP id 3f1490d57ef6-e2919d819femr1990739276.15.1728656594496;
        Fri, 11 Oct 2024 07:23:14 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; t=1728656594; cv=none;
        d=google.com; s=arc-20240605;
        b=dXmhzke5XGkL6641T2tMDv4PXnQZmj7Gy1qg2HNETzKCZ46mg7OHxDq2kbJsjEAymb
         50MH9qkdn/FoWFHacf0nC4r7G7xLaLRNY9x7E/1/m23ihAevmExWrX8eKz+z4bDGLYh7
         S5z3qJqBU8QQIdCFWd87Oo2qWWdbWG8DUj2ZVhbwmzUPocL5QyrN+P1EsN6x5XyoLL4a
         azIjZI776i8XGSgo/1C0IQdnqwi2xS7VuoRa+dcGBbtM0ZmxH4H2m4TMvOn0fLzbICoB
         +dNtPT6QKHqhRS2Dy6aOZ4CO+UqkqOwTvl/XT5mfPtM/sdxW05uxLTf1Ok2upX9sVCt4
         aq8Q==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605;
        h=content-transfer-encoding:feedback-id:message-id:date:mime-version
         :reply-to:subject:from:dkim-signature:dkim-signature;
        bh=5otgVf1D5/aeDcgdIznGDaRWeZ6BCAgm6mTt6P5S6qY=;
        fh=47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU=;
        b=RcPXRZE9FZGU5tibiAAkCHZtCMqibk9iaguhRLh2jMjm/OeFHBpir5JlVsDNLNZ5Cr
         evfwVHei5Fn3cUZaP1p9HkqAsglxAIElZyuW8vBYyfr0e3anJjEM5M/T7Ox/bxzBWrJ/
         kqucQ5FkwCzJ8zKJGXxXVUWNI+C5qSOJyS0mB9iJsYbdkYhr4Cc3C+MxUxCZHZk+/dzs
         zMAg0sG7nbk7PXUGyDz7uNQkXCVwe82mdhk2LpGUDOKGnozOjCIVF6B5SmE+7hPL+p6U
         0vg7CA4a73OICkmBm50P3sguowjVsaTLv8mu43qymz8lksOc2S1Bse10DuE+zoDHbfrV
         7sKQ==;
        dara=google.com
ARC-Authentication-Results: i=1; mx.google.com;
       dkim=neutral (body hash did not verify) header.i=@cars.com header.s=iab3ucass22h4hgthamhopai3whd4uk2 header.b="NZmGIzU/";
       dkim=neutral (body hash did not verify) header.i=@amazonses.com header.s=ug7nbtf4gccmlpwj322ax3p6ow6yfsug header.b="hn/nX5JA";
       spf=pass (google.com: domain of 010001927bf64f1e-cd88ab97-4f04-4484-b2b1-8e749c1f56c1-000000@amazonses.com designates 54.240.48.94 as permitted sender) smtp.mailfrom=010001927bf64f1e-cd88ab97-4f04-4484-b2b1-8e749c1f56c1-000000@amazonses.com
Return-Path: <010001927bf64f1e-cd88ab97-4f04-4484-b2b1-8e749c1f56c1-000000@amazonses.com>
Received: from mx0b-00694101.pphosted.com (mx0b-00694101.pphosted.com. [205.220.180.21])
        by mx.google.com with ESMTPS id 3f1490d57ef6-e290ef8b9aesi2373157276.596.2024.10.11.07.23.14
        for <ckoch@cars.com>
        (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Fri, 11 Oct 2024 07:23:14 -0700 (PDT)
Received-SPF: pass (google.com: domain of 010001927bf64f1e-cd88ab97-4f04-4484-b2b1-8e749c1f56c1-000000@amazonses.com designates 54.240.48.94 as permitted sender) client-ip=54.240.48.94;
Authentication-Results: mx.google.com;
       dkim=neutral (body hash did not verify) header.i=@cars.com header.s=iab3ucass22h4hgthamhopai3whd4uk2 header.b="NZmGIzU/";
       dkim=neutral (body hash did not verify) header.i=@amazonses.com header.s=ug7nbtf4gccmlpwj322ax3p6ow6yfsug header.b="hn/nX5JA";
       spf=pass (google.com: domain of 010001927bf64f1e-cd88ab97-4f04-4484-b2b1-8e749c1f56c1-000000@amazonses.com designates 54.240.48.94 as permitted sender) smtp.mailfrom=010001927bf64f1e-cd88ab97-4f04-4484-b2b1-8e749c1f56c1-000000@amazonses.com
Received: from pps.filterd (m0277857.ppops.net [127.0.0.1]) by mx0b-00694101.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 49BCokdW012036 for <ckoch@cars.com>; Fri, 11 Oct 2024 09:23:13 -0500
Authentication-Results: ppops.net; spf=pass smtp.mailfrom=010001927bf64f1e-cd88ab97-4f04-4484-b2b1-8e749c1f56c1-000000@amazonses.com; dkim=pass header.d=cars.com header.s=iab3ucass22h4hgthamhopai3whd4uk2; dkim=pass header.d=amazonses.com header.s=ug7nbtf4gccmlpwj322ax3p6ow6yfsug; dmarc=pass header.from=cars.com
Received: from a48-94.smtp-out.amazonses.com (a48-94.smtp-out.amazonses.com [54.240.48.94]) by mx0b-00694101.pphosted.com (PPS) with ESMTPS id 4232wuq4av-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA256 bits=128 verify=NOT) for <ckoch@cars.com>; Fri, 11 Oct 2024 09:23:13 -0500 (CDT)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=iab3ucass22h4hgthamhopai3whd4uk2; d=cars.com; t=1728656592; h=From:Subject:Reply-To:Content-Type:Content-Transfer-Encoding:MIME-Version:Date:Message-ID; bh=Pio9SBTcyavZDPrBWRJmzqWPTEKdI6p7kTlAgWjX2qE=; b=NZmGIzU/w3x+CSGux5LrYKsyMof0SnA4e9v/3cIbghzmqFEt6juV6PLyDAVy3yo/ ZAlC2Vlopz/QU3Nk0QPpXsj0zdVK7c3EdDz/egDYcKghSjj3bIsPycOQkSydTjgySZA KVeqHKAf4kDeADpwpXmsih/eooCegINEsnzpkijyimbZXGW5/LxCsFJ0lAu5BLQjo4s snWeEzwY0PuZpo9h+xDXKDDx7HgGb44dq+TSaAFhJHeTyZBD7q/kgOrRhMPau+auScu 9Vqt7aDD42IO4xryZ7zvkahKnF9FDrnJvjWHyfWCc2uHVBLVb22+5JVg9QzuzuHOE+o XQVB/YwtQA==
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=ug7nbtf4gccmlpwj322ax3p6ow6yfsug; d=amazonses.com; t=1728656592; h=From:Subject:Reply-To:Content-Type:Content-Transfer-Encoding:MIME-Version:Date:Message-ID:Feedback-ID; bh=Pio9SBTcyavZDPrBWRJmzqWPTEKdI6p7kTlAgWjX2qE=; b=hn/nX5JAgXTWblKk/ZFn6/Ikx5e0F8j0A86EO87lIHN2n7oX67ufkdtg8uCvlOO+ eI2yJP2Zm045PjYOjg+nOPyqvGI9tnVViSA4nCfjGWQCRf2MTdIpd18smzkys874+NY R69jkeLoLfbzjszeiKKHEgT0jlPHr7FodxEsxSkc=
From: salesleads@cars.com
Subject: Cars.com Used Car Lead for REDACTED
Reply-To: anonymous-68e79884-491e-4295-824d-75479e8c45ee@example.com
X-Email-Metadata: {"email_source":"Lead Delivery","lead_delivery_destinations_id":["f35aed9d-23ae-4019-84f1-3f475cd3384d","f50f3610-df76-4ff4-96c3-442ba836b3b3","543f7793-4d66-4805-80d8-5b293428d3d1","f363f799-eaef-4510-8f56-9aca52a0b423"]}
MIME-Version: 1.0
Date: Fri, 11 Oct 2024 14:23:12 +0000
Message-ID: <010001927bf64f1e-cd88ab97-4f04-4484-b2b1-8e749c1f56c1-000000@email.amazonses.com>
Feedback-ID: ::1.us-east-1.6uWdGliHt1qA9VWC79LTGKMv3pEbyB1s6T99OTkXLLM=:AmazonSES
X-SES-Outgoing: 2024.10.11-54.240.48.94
X-Proofpoint-ORIG-GUID: 7dJlOXyUZ0kR1QT8pJt8sG3riujUdwSI
X-Proofpoint-GUID: 7dJlOXyUZ0kR1QT8pJt8sG3riujUdwSI
X-CLX-Response: 1TFkXGBwZEQpMehcZGhEKWUQXbG1FYxwbTUgeE1kRClhYF2ESSH5nYGZFHWl nEQp4ThduYkNea1NwR0Z8ZxEKeEsXYRJIfmdgZkUdaWcRCnlMF2VeBXNoUnl9QRtoEQpDSBcHGB MdEQpDWRcHGR8dEQpDSRcaBBoaGhEKWU0XZEVETxEKWUkXGnEaEBp3BhgeGXEYHB0QGncGGBoGG hEKWV4XbGx5EQpJRhdJS1hZdUJFWV5PThEKSUcXZE9dEQpDThcdTmBGZXJTf3AaQXgbe34SWmBe ElltGVhDX0B/Tl15YxEKWFwXHwQaBBkdHAUbGgQbGhoEGxkeBBkZEBseGh8aEQpeWRdPel5GWRE KTVwXHx4TEQpMWhdpeG1dRU0RCkVZF2xrTREKTF8XegUFBQUFBQUFBWARCkxGF29ra2NraxEKQk 8Xb3toUGZnZ31+bhoRCkNaFx8eBBgeGgQeEgQTHhEKQl4XGxEKRF4XGhEKQlwXGxEKXk4XGxEKQ ksXZXMFb1JtXGhgHR0RCkJJF2VzBW9SbVxoYB0dEQpCRRdkbEgbeGZIE19rYxEKQk4XZXMFb1Jt XGhgHR0RCkJMF2RsSBt4ZkgTX2tjEQpCbBdkbEgbeGZIE19rYxEKQkAXbwVJQkFCWm8ZYUsRCkJ YF3pgX1NMYXB4SxMcEQpaWBccEQp5QxduWmN4QFtTUHpFbREKWUsXEx0ZEhEKWksXGxsTHRgRCn BnF25FY19mHWFGfXx7EBoRCnBoF2VHawESfFMcaUBSEB4SEQpwaBdrBRtZQWxdf0FZWBAaEQpwa BdmZkUBblxpZlB6XRAaEQpwaBdmYGVnQn1ASF4TTxAaEQpwaBdtbXp/Wh8SGVhPTRAaEQpwaBdn WEtASH9LYnhEYhAaEQpwaBdrZlxbUGJaGwFhaRAaEQpwaBdpc08Sc0tNRkxFBRAaEQpwfRdrc0l LcltNQ1NweBAaEQpwfRdtf2hdeE9La39MXBAaEQpwZxdtT2UfTUl4AWlNThAaEQpwfRdnYnJMb1 JNa1JsZhAcGhEKcGcXbhlNBX5wQV8FRVoQEx0RCnB/F2VybRxpeEhlRHJIEB8TEQpwXxdvWFl4U EhaGlx4bhAaEQpwXxdnYnJMb1JNa1JsZhAcGhEKbX4XGhEKWE0XSxEg
X-CLX-Shades: None
X-Proofpoint-Banner-Trigger: inbound
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html; charset="utf-8"
X-Proofpoint-Banner-Convert: 8bit mime entity
X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1051,Hydra:6.0.680,FMLib:17.12.62.30 definitions=2024-10-11_12,2024-10-11_01,2024-09-30_01
X-Proofpoint-Spam-Reason: safe

V0.2.1

Delivered-To: ckoch@cars.com
Received: by 2002:a54:37c5:0:b0:26b:5319:89fa with SMTP id v5csp503351ect;
        Fri, 11 Oct 2024 07:10:42 -0700 (PDT)
X-Google-Smtp-Source: AGHT+IEKxkfnNFEFnV6VeGvABCLRqgEg/7DG7as22lH20VaRzPvU9fZKfavurqSFoSIoEnbCcGOF
X-Received: by 2002:a05:6122:169a:b0:50a:c70b:9453 with SMTP id 71dfb90a1353d-50d1f564b6amr1541497e0c.10.1728655842175;
        Fri, 11 Oct 2024 07:10:42 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; t=1728655842; cv=none;
        d=google.com; s=arc-20240605;
        b=hbXfem059IHrpf8m7h4z0VqNLnQR1IHqhQ9hAaZ45uXgHBOpu/n7DCaFEjtbi+ubET
         0vz9feLrY76BicSCgMnrLR1QrYQlPvbaO/ldu1wS3vMD1xkWq2H/JIVmUiRIBnp+1UlQ
         aYRWmGl49R9upF966IbQrQyDYmNycalZVjTR8rZSLE1x3aSK6ZEWI7+P2rA4KQlIKk/8
         UgaH/hu5FSTxl5usL6/Ri0NHqpP8iwD9clwH/T16Y+XxJ9Gcf4nGX12qPIXN4Dk6f/LB
         GqKFlzpNGPN0XPcK3L3A/gSgqagAuvbM1AWG6/KJF19J07wlr1mAEV9QPnnAAx0Lc1IM
         Z+AA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605;
        h=feedback-id:date:message-id:from:mime-version:reply-to:subject:to
         :dkim-signature:dkim-signature;
        bh=4OmZr8dr/CCt200HZ3FKPYwhLSNeBSknjLl9BOu+sQA=;
        fh=ibww273rDoU0gvP73q2/37aToKdahOFHwf8bPYOCmrw=;
        b=Kuqa8QLcHrxMhHFlvomM3K5RCAU+hoTHW895YBuyE/+uqN0t0aIp9PCFH0IvemCgsd
         7ss6HxhR1iZsj833d1iNB4v2sc3pOpvu85c4ETR6FKO+QCo/w1qMlIkMSDnItVkQvIw8
         f0i8G5HE/UTStmXjtrqEV4CUXfgxqCyVdIyM92aVHoDm2GhKD86QxFkBf/s4m7vmJr/r
         phA42OQUYt4jlvUndYzsoKTBCQHhmgHUOBJlB+IW+dXLhh9jPofpjYM1BxZb+hIuAiHs
         RE3cqzKbTq+RaeiLVLSmeioHiTX0QnRtU8aGCoVpEHXdwpAjfWAkTKPRaZDjQeu+B2Hw
         Q8CA==;
        dara=google.com
ARC-Authentication-Results: i=1; mx.google.com;
       dkim=neutral (body hash did not verify) header.i=@cars.com header.s=iab3ucass22h4hgthamhopai3whd4uk2 header.b=hkaqqdHR;
       dkim=neutral (body hash did not verify) header.i=@amazonses.com header.s=ug7nbtf4gccmlpwj322ax3p6ow6yfsug header.b=q5ETdBb8;
       spf=pass (google.com: domain of 010001927beacfae-c2534f95-2dca-43a9-88e7-43629ed5dd30-000000@amazonses.com designates 54.240.48.110 as permitted sender) smtp.mailfrom=010001927beacfae-c2534f95-2dca-43a9-88e7-43629ed5dd30-000000@amazonses.com
Return-Path: <010001927beacfae-c2534f95-2dca-43a9-88e7-43629ed5dd30-000000@amazonses.com>
Received: from mx0a-00694101.pphosted.com (mx0a-00694101.pphosted.com. [205.220.168.21])
        by mx.google.com with ESMTPS id 71dfb90a1353d-50d0885440csi828531e0c.146.2024.10.11.07.10.41
        for <ckoch@cars.com>
        (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Fri, 11 Oct 2024 07:10:42 -0700 (PDT)
Received-SPF: pass (google.com: domain of 010001927beacfae-c2534f95-2dca-43a9-88e7-43629ed5dd30-000000@amazonses.com designates 54.240.48.110 as permitted sender) client-ip=54.240.48.110;
Authentication-Results: mx.google.com;
       dkim=neutral (body hash did not verify) header.i=@cars.com header.s=iab3ucass22h4hgthamhopai3whd4uk2 header.b=hkaqqdHR;
       dkim=neutral (body hash did not verify) header.i=@amazonses.com header.s=ug7nbtf4gccmlpwj322ax3p6ow6yfsug header.b=q5ETdBb8;
       spf=pass (google.com: domain of 010001927beacfae-c2534f95-2dca-43a9-88e7-43629ed5dd30-000000@amazonses.com designates 54.240.48.110 as permitted sender) smtp.mailfrom=010001927beacfae-c2534f95-2dca-43a9-88e7-43629ed5dd30-000000@amazonses.com
Received: from pps.filterd (m0277851.ppops.net [127.0.0.1]) by mx0b-00694101.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 49BArUkM010918 for <ckoch@cars.com>; Fri, 11 Oct 2024 09:10:41 -0500
Authentication-Results: ppops.net; spf=pass smtp.mailfrom=010001927beacfae-c2534f95-2dca-43a9-88e7-43629ed5dd30-000000@amazonses.com; dkim=pass header.s=iab3ucass22h4hgthamhopai3whd4uk2 header.d=cars.com; dkim=pass header.s=ug7nbtf4gccmlpwj322ax3p6ow6yfsug header.d=amazonses.com; dmarc=pass header.from=cars.com
Received: from a48-110.smtp-out.amazonses.com (a48-110.smtp-out.amazonses.com [54.240.48.110]) by mx0b-00694101.pphosted.com (PPS) with ESMTPS id 422y79f96s-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA256 bits=128 verify=NOT) for <ckoch@cars.com>; Fri, 11 Oct 2024 09:10:40 -0500 (CDT)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=iab3ucass22h4hgthamhopai3whd4uk2; d=cars.com; t=1728655839; h=To:Subject:Reply-To:Mime-Version:From:Content-Type:Message-ID:Date; bh=btXaxKFitfovd1myRfQE+NGpeFcMwfh6VRerYMioftI=; b=hkaqqdHRRTqXB5fPnsfrewU3uwcJvyCNNwYnQQa8KfKKzlqjWi81bOGf93Wn8sBh 1yeoetsGuGV+9Xiq+Mp917q3JHc+KqLfrx9IND5yo9h2d3qYo8LbOG2gIY2dNWkL8uj IzLlduZFisXalqFVeUD21tMMnyFnKtccLSrP2KSeA8xiSla/v49sBuVFes9pNmnoqYw 1L/MyGzoAPXnf3TSdjkOa78k+HdPpLQls6VIxb0GpO5Naqb6TDmIqtMbf3YHRHhaL5a K2MaKNU7HL/3jfNEfiu6jU5sOya+B02AwwPZZ8OOf5HzVwNFKykAKeoNuSHvOs4+kbn Dw2xGMIVqg==
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=ug7nbtf4gccmlpwj322ax3p6ow6yfsug; d=amazonses.com; t=1728655839; h=To:Subject:Reply-To:Mime-Version:From:Content-Type:Message-ID:Date:Feedback-ID; bh=btXaxKFitfovd1myRfQE+NGpeFcMwfh6VRerYMioftI=; b=q5ETdBb8Yw4tpNbhea+woVbAEEA4HnZQYPdVtZJ2YCFFGHuWeJKjYzW/3p5hm8Tk 71V1f7ubPz1xIYjaI2pUMdta2AEoGrNzQZKGOGcARuidhP8ob9C7ntdiLcWro6cH+qG DVHNKxtxBRhIWX6Jje0sJ5KvhbKIOUPpW4wIH0pw=
To: ckoch@cars.com
Subject: Cars.com Used Car Lead for  REDACTED
Reply-To: anonymous-68e79884-491e-4295-824d-75479e8c45ee@example.com
Mime-Version: 1.0
From: salesleads@cars.com
Content-Type: multipart/alternative; boundary="E08B88F9D12670C20598BCC0"
Message-ID: <010001927beacfae-c2534f95-2dca-43a9-88e7-43629ed5dd30-000000@email.amazonses.com>
Date: Fri, 11 Oct 2024 14:10:39 +0000
Feedback-ID: ::1.us-east-1.6uWdGliHt1qA9VWC79LTGKMv3pEbyB1s6T99OTkXLLM=:AmazonSES
X-SES-Outgoing: 2024.10.11-54.240.48.110
X-Proofpoint-GUID: 1H_0PgNKWn2dsQepLjhJ_SSca-efpYue
X-CLX-Response: 1TFkXGBIZEQpMehcbHBgRCllEF2xtRWMcG01IHhNZEQpYWBdhEkh+Z2BmRR1 pZxEKeE4XbmJDXmtTcEdGfGcRCnhLF2ESSH5nYGZFHWlnEQp5TBdlXgVzaFJ5fUEbaBEKQ0gXBx gfGBEKQ1kXBxkfHREKQ0kXGgQaGhoRCllNF2RFRE8RCllJFxpxGhAadwYYHBlxHhgdEBp3BhgaB hoRClleF2xseREKSUYXSUtYWXVCRVleT04RCklHF2RPXREKQ04XG2J1GnpNZGF9RBhOWXtPWmZA QmB1eXlJSwdPTFpzX08RClhcFx8EGgQZHRwFGxoEGxoaBBsZHgQZHxAbHhofGhEKXlkXT3pecB0 RCk1cFx4SEhEKTFoXaXhtXU1NEQpFWRdsa2sRCkxfF3oFBQUFBQUFBQUdEQpMRhdva2tja2sRCk JPF2B+HGJgQVprXxpfEQpDWhcfHgQYHhoEHhIEGxsaEQpCXhcbEQpCXBcbEQpeThcbEQpCSxdlc wVvUm1caGAdHREKQkkXZXMFb1JtXGhgHR0RCkJFF2RsSBt4ZkgTX2tjEQpCThdlcwVvUm1caGAd HREKQkwXZGxIG3hmSBNfa2MRCkJsF2RsSBt4ZkgTX2tjEQpCQBdvBUlCQUJabxlhSxEKQlgXemB fU0xhcHhLExwRClpYFxwRCnlDF25aY3hAW1NQekVtEQpZSxcTHRkSEQpaSxcbGxMdGBEKcGcXbk VjX2YdYUZ9fHsQGhEKcGgXZUdrARJ8UxxpQFIQHhIRCnBoF2sFG1lBbF1/QVlYEBoRCnBoF2ZmR QFuXGlmUHpdEBoRCnBoF2ZgZWdCfUBIXhNPEBoRCnBoF21ten9aHxIZWE9NEBoRCnBoF2dYS0BI f0tieERiEBoRCnBoF2tmXFtQYlobAWFpEBoRCnBoF2lzTxJzS01GTEUFEBoRCnB9F2tzSUtyW01 DU3B4EBoRCnB9F21/aF14T0trf0xcEBoRCnBnF21PZR9NSXgBaU1OEBoRCnB9F2dickxvUk1rUm xmEB4SEQpwZxduGU0FfnBBXwVFWhAbGRgRCnB/F2VybRxpeEhlRHJIEB8cEQpwXxdvWFl4UEhaG lx4bhAaEQpwXxdnYnJMb1JNa1JsZhAeEhEKbX4XGhEKWE0XSxEg
X-Proofpoint-ORIG-GUID: 1H_0PgNKWn2dsQepLjhJ_SSca-efpYue
X-CLX-Shades: None
X-Proofpoint-Banner-Trigger: inbound
X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1051,Hydra:6.0.680,FMLib:17.12.62.30 definitions=2024-10-11_12,2024-10-11_01,2024-09-30_01
X-Proofpoint-Spam-Reason: safe
kalys commented 1 week ago

Hey! I published version 0.4.5. Both payload and header problems should be solved.

ckoch-cars commented 5 days ago

Hey @kalys Thank you for the update. Testing this sending new messages this seems to have addressed the issues.

I am trying to write a test for the Raw message we are sending to SES and I am not sure where/how to emit the raw message that we are sending to SES.

I have tried something like this:

email = %Bamboo.Email{
   from: {nil, "email@example.com"},
   to: [nil: "test@test.com"],
   subject: "Test subject", 
...
}
 BambooSes.Render.Raw.render(email)

This does seem to render the email but the To: field is missing.

Is it possible to render the actual message that is sent to SES? Is there another (better} way to emit the message?

Thanks again.

Would you like me to close out this issue?

kalys commented 2 days ago

Hi! If you add an attachment to the email then Raw content will be generated. In all other cases bamboo_ses will send an email using Simple content type. https://docs.aws.amazon.com/ses/latest/APIReference-V2/API_SendEmail.html

With Simple content type Amazon SES handles almost everything: encoding, mimemail payload, headers generation.

kalys commented 2 days ago

Regarding To field in Raw content type I'll prepare a PR within next week.

ckoch-cars commented 5 hours ago

Hi! If you add an attachment to the email then Raw content will be generated. In all other cases bamboo_ses will send an email using Simple content type. https://docs.aws.amazon.com/ses/latest/APIReference-V2/API_SendEmail.html

With Simple content type Amazon SES handles almost everything: encoding, mimemail payload, headers generation.

Ah. Thank you, that is helpful insight. I couldn't see in this library how the email itself was getting created, buy relying on SES make a lot of sense.

I am going to close this issue. I really appreciate your work on this!

kalys commented 4 hours ago

Thank you for your detailed feedback! It was very helpful for investigating the problem.