Skip to content

Commit 8c787e5

Browse files
committed
feat: forward html variant if it exists
1 parent 1297dbc commit 8c787e5

File tree

8 files changed

+183
-2
lines changed

8 files changed

+183
-2
lines changed

.idea/.gitignore

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/hook2mail.iml

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules.xml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/vcs.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

hook2mail.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
import os
66
import base64
77

8-
EMAIL_FROM = os.getenv("EMAIL_FROM", "[email protected]")
9-
EMAIL_TO = os.getenv("EMAIL_TO", "you@example.com")
8+
EMAIL_FROM = os.getenv("EMAIL_FROM", "[email protected]")
9+
EMAIL_TO = os.getenv("EMAIL_TO", "[email protected], [email protected], third@example.com")
1010
PORT = int(os.getenv("PORT", 8000))
1111

1212
SMTP_HOST = os.getenv("SMTP_HOST", "localhost")
@@ -29,6 +29,7 @@ def webhook():
2929
# Extract the original sender
3030
original_sender = email_message.get('From', 'Unknown Sender')
3131

32+
payload = None
3233
if email_message.is_multipart():
3334
for part in email_message.walk():
3435
if part.get_content_type() == "text/plain":
Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
X-Postal-Spam: no
2+
X-Postal-Spam-Threshold: 5.0
3+
X-Postal-Spam-Score: 0
4+
X-Postal-Threat: no
5+
Received: from mail-io1-f46.google.com (100.64.1.143 [100.64.1.143]) by mail.cloudnative.aixmarseille.tech with SMTP; Sun, 09 Feb 2025 11:36:07 -0000
6+
Received: by mail-io1-f46.google.com with SMTP id ca18e2360f4ac-8552a15462bso4249839f.0
7+
for <[email protected]>; Sun, 09 Feb 2025 03:36:06 -0800 (PST)
8+
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
9+
d=webofmars-com.20230601.gappssmtp.com; s=20230601; t=1739100965; x=1739705765; darn=cloudnative.aixmarseille.tech;
10+
h=to:subject:message-id:date:from:mime-version:from:to:cc:subject
11+
:date:message-id:reply-to;
12+
bh=WOoWPHiTIditrKX3B7DE3ZqWCaB0dnSeYLkoNvnzlmg=;
13+
b=ibOPHXfTfQexRVDtk5CDAXirOslks4pzKFFAX1pSbHCg4zHG7UrqMpTUaoA+SbWMEu
14+
BqrxDG6JYH5wGE4z8nkR7bCBvwLSra7XmPZLwrH4f2l15kvANZolaWjUDN+PvhNEmUpz
15+
qI9HcJ/EzkyYxKB9Ljn4hMgq4MgV3leyqhlT5eJFPkyhhcAzaHZLREbRJyM2IWwVBATH
16+
M525c8k6/b38tM5k/kwxbo1Hoeissn7G8U10yV5B5lYx34oppjZtA32driuMu6bm3jKm
17+
scg0K9PUXJdwGitYUVv3oeTrNFvPO5GnUO9YmX6P2P8r0d7B42fxK4Mo4yJJfVSQs37k
18+
H+Cw==
19+
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
20+
d=1e100.net; s=20230601; t=1739100965; x=1739705765;
21+
h=to:subject:message-id:date:from:mime-version:x-gm-message-state
22+
:from:to:cc:subject:date:message-id:reply-to;
23+
bh=WOoWPHiTIditrKX3B7DE3ZqWCaB0dnSeYLkoNvnzlmg=;
24+
b=BPbs1iP6/rhrSqplS9A3WY2oerJPhIb7uAoqD0HewFtzPv0UEzlzwlueviWi+5Q2KE
25+
emzaZXFlTnbhXvAssBlISknLmojjRiPX9VK8562iK4TzwfsHuk7+I/cXT9W5UIxwnfLh
26+
qk3TBhIK5dv+0sEjLP/DsQjyp8jgnqG/1XWVXKzxpM/IuMGb8nJsYQr2Xt2tHgKVgHQx
27+
PoUkxXujTlDNdYYxIW6DTJi1XRPVRozaZmfg/NtxotZSSzGZT4zTzUVhuLeKxGUIynlI
28+
TXBaqIB42XLdcbC+l86SszZbc3dFt9zVE4Zy0uQbJsh9WrGrZnevN8GCKhS1XKLTVqzc
29+
YJEQ==
30+
X-Gm-Message-State: AOJu0Yz0pVzla1Wgam8ePdyQEIgQXvteVGdy+tSN2Pnc1MVQgFL66Z1w
31+
wtodaIXCEPXdkoqjdhOIdv2ockzbKZu6pR34qoGO1dM3nYT9Jw3ruf8vxjTtu0TXwkC58PLQI+U
32+
sR/WpNrBDn5ijpv1ovj7SQkOFh8AnAK2sT81ZDhUkm4PzLGwQ
33+
X-Gm-Gg: ASbGncvWPqgUD5/LzKrWTiMKGQajEZCOIvkwb3P0yatZt6o1yJBGxzQHZYNne69BNn4
34+
y0mU8XLp5FS95Ufm7W5MYiSIbN9hvwxslgx/caprBXBYgB7gOkmkeG+Xt+v2Cl0tCa5zaqcNJHx
35+
s/5fJ038YREufgRQ3aUZx1Okqhk+Z6
36+
X-Google-Smtp-Source: AGHT+IEmzprdE3To5Sns/1KDAVx/oxI7+GyxwIbS/gObWRTjWzc+y7LqLwTVok0n/SYVAG8P2MZoxCGSs6yJfQB2mb4=
37+
X-Received: by 2002:a05:6602:4085:b0:841:95b5:8953 with SMTP id
38+
ca18e2360f4ac-854fd907876mr1041280139f.14.1739100965122; Sun, 09 Feb 2025
39+
03:36:05 -0800 (PST)
40+
MIME-Version: 1.0
41+
From: Frederic Leger <[email protected]>
42+
Date: Sun, 9 Feb 2025 12:35:54 +0100
43+
X-Gm-Features: AWEUYZnWCtsErbnvUbi3IRN6EfM8Yw-OWKEwXtPRkpE03s6jvqmXKLh7-mtfgbo
44+
Message-ID: <CADo29dkutdwPLWoyHba4SKXAWtmA_M60GGzqy1o7V6rq6dFBog@mail.gmail.com>
45+
Subject: =?UTF-8?Q?=5Btest=5D_avec_l=27exp=C3=A9diteur_d=27origine?=
46+
To: meetups cloudnative <[email protected]>
47+
Content-Type: multipart/alternative; boundary="00000000000041538e062db3ff1d"
48+
49+
--00000000000041538e062db3ff1d
50+
Content-Type: text/plain; charset="UTF-8"
51+
Content-Transfer-Encoding: quoted-printable
52+
53+
normalement on doit avoir l'exp=C3=A9diteur maintenant
54+
55+
56+
--=20
57+
[image: webofmars | build-and-run]
58+
Frederic Leger
59+
60+
fondateur | webofmars | build-and-run
61+
M: 06.52.77.53.54
62+
63+
webofmars.com
64+
<https://twitter.com/webofmars>
65+
<https://www.linkedin.com/company/webofmars/> <https://github.com/webofmars=
66+
>
67+
<https://www.youtube.com/channel/UCi77lDIsszaryN0flTS9EOw>
68+
<https://www.build-and-run.fr/>
69+
P.S. During business hours, focus is my work philosophy. So to fully serve
70+
my customers, I do not consult emails during the day. Please send me an SMS
71+
if anything urgent otherwise my reply might take a few workdays
72+
73+
--00000000000041538e062db3ff1d
74+
Content-Type: text/html; charset="UTF-8"
75+
Content-Transfer-Encoding: quoted-printable
76+
77+
<div dir=3D"ltr"><div><div class=3D"gmail_default" style=3D"font-family:ari=
78+
al,sans-serif;font-size:small">normalement on doit avoir l&#39;exp=C3=A9dit=
79+
eur maintenant</div><br clear=3D"all"></div><div><div dir=3D"ltr" class=3D"=
80+
gmail_signature" data-smartmail=3D"gmail_signature"><div dir=3D"ltr"><div><=
81+
div dir=3D"ltr"><br></div><div dir=3D"ltr">--=C2=A0<br><table cellspacing=
82+
=3D"0" width=3D"470" cellpadding=3D"0" border=3D"0" style=3D"border-spacing=
83+
:0px;border-collapse:collapse;color:rgb(97,97,97);font-family:Lato,sans-ser=
84+
if;font-size:13px"><tbody><tr><td valign=3D"top" width=3D"100" style=3D"pad=
85+
ding:0px 12px 0px 0px;vertical-align:top"><img alt=3D"webofmars | build-and=
86+
-run" width=3D"100" src=3D"https://img.mysignature.io/p/5/3/9/539db537-73c6=
87+
-599a-be4b-573f8fe3bfe6.png?time=3D1572995421" style=3D"width:100px;border-=
88+
radius:0%"></td><td valign=3D"top" style=3D"font-size:1em;padding:0px 0px 0=
89+
px 12px;vertical-align:top;border-left:1px solid rgb(96,147,209)"><table ce=
90+
llspacing=3D"0" cellpadding=3D"0" border=3D"0" style=3D"border-spacing:0px;=
91+
border-collapse:collapse;line-height:1.4;font-family:&quot;Lucida Console&q=
92+
uot;,Monaco,monospace;font-size:10.4px;color:rgb(0,0,1)"><tbody><tr><td sty=
93+
le=3D"padding-bottom:8px"><span style=3D"font-weight:600;font-stretch:norma=
94+
l;font-size:1.3em;line-height:normal;font-family:&quot;Lucida Console&quot;=
95+
,Monaco,monospace;color:rgb(96,147,209)">Frederic Leger</span></td></tr><tr=
96+
><td style=3D"padding-bottom:8px"><div style=3D"font-family:&quot;Lucida Co=
97+
nsole&quot;,Monaco,monospace">fondateur | webofmars | build-and-run</div></=
98+
td></tr><tr><td><div style=3D"font-family:&quot;Lucida Console&quot;,Monaco=
99+
,monospace"><span style=3D"font-weight:600;color:rgb(96,147,209)">M:=C2=A0<=
100+
/span>=C2=A0<a href=3D"tel:06.52.77.53.54" style=3D"color:rgb(0,0,1)" targe=
101+
t=3D"_blank">06.52.77.53.54</a></div></td></tr><tr><td><div style=3D"font-f=
102+
amily:&quot;Lucida Console&quot;,Monaco,monospace"><span style=3D"font-weig=
103+
ht:600;font-size:1em;color:rgb(96,147,209)">E:=C2=A0</span>=C2=A0<a href=3D=
104+
"mailto:[email protected]" style=3D"color:rgb(0,0,1)" target=3D"_blank"=
105+
>[email protected]</a></div></td></tr><tr><td style=3D"padding:8px 0px =
106+
0px"><div style=3D"font-family:&quot;Lucida Console&quot;,Monaco,monospace"=
107+
><a href=3D"https://webofmars.com/" style=3D"color:rgb(96,147,209)" target=
108+
=3D"_blank">webofmars.com</a></div></td></tr><tr><td style=3D"padding-top:1=
109+
2px"><table cellspacing=3D"0" cellpadding=3D"0" border=3D"0" style=3D"borde=
110+
r-spacing:0px;border-collapse:collapse"><tbody><tr><td style=3D"font-family=
111+
:Arial;padding:0px 5px 0px 0px"><a href=3D"https://twitter.com/webofmars" s=
112+
tyle=3D"color:rgb(0,0,0)" target=3D"_blank"><img alt=3D"" width=3D"22" src=
113+
=3D"https://img.mysignature.io/s/v3/f/2/7/f27ad15e-5bd5-594a-b437-4397eae77=
114+
ba1.png" style=3D"width:22px"></a></td><td style=3D"font-family:Arial;paddi=
115+
ng:0px 5px 0px 0px"><a href=3D"https://www.linkedin.com/company/webofmars/"=
116+
style=3D"color:rgb(0,0,0)" target=3D"_blank"><img alt=3D"" width=3D"22" sr=
117+
c=3D"https://img.mysignature.io/s/v3/3/6/9/3694419a-fd67-54ff-ac24-d867d331=
118+
b2d2.png" style=3D"width:22px"></a></td><td style=3D"font-family:Arial;padd=
119+
ing:0px 5px 0px 0px"><a href=3D"https://github.com/webofmars" style=3D"colo=
120+
r:rgb(0,0,0)" target=3D"_blank"><img alt=3D"" width=3D"22" src=3D"https://i=
121+
mg.mysignature.io/s/v3/3/c/5/3c55446e-bd75-5b5e-8356-317f20f4c036.png" styl=
122+
e=3D"width:22px"></a></td><td style=3D"font-family:Arial;padding:0px 5px 0p=
123+
x 0px"><a href=3D"https://www.youtube.com/channel/UCi77lDIsszaryN0flTS9EOw"=
124+
style=3D"color:rgb(0,0,0)" target=3D"_blank"><img alt=3D"" width=3D"22" sr=
125+
c=3D"https://img.mysignature.io/s/v3/3/7/b/37b91546-fabf-55b3-a4a8-c5ff71e8=
126+
4816.png" style=3D"width:22px"></a></td><td style=3D"font-family:Arial;padd=
127+
ing:0px 5px 0px 0px"><a href=3D"https://www.build-and-run.fr/" style=3D"col=
128+
or:rgb(0,0,0)" target=3D"_blank"><img alt=3D"" width=3D"22" src=3D"https://=
129+
img.mysignature.io/s/v3/c/a/e/cae832f8-a016-5f59-b838-6f17366ea684.png" sty=
130+
le=3D"width:22px"></a></td></tr></tbody></table></td></tr></tbody></table><=
131+
/td></tr></tbody></table><table cellspacing=3D"0" cellpadding=3D"0" border=
132+
=3D"0" style=3D"border-spacing:0px;border-collapse:collapse;font-size:1em;c=
133+
olor:gray;font-family:Arial;line-height:1.3;width:500px"><tbody><tr><td sty=
134+
le=3D"font-size:9.75px;padding-top:15px">P.S. During business hours, focus =
135+
is my work philosophy. So to fully serve my customers, I do not consult ema=
136+
ils during the day. Please send me an SMS if anything urgent otherwise my r=
137+
eply might take a few workdays</td></tr></tbody></table><br></div></div></d=
138+
iv></div></div></div>
139+
140+
--00000000000041538e062db3ff1d--

0 commit comments

Comments
 (0)