~singpolyma/cheogram-smtp

3a86097a5388e80b2a1dac4d1e8979428da39cc0 — Stephen Paul Weber 3 months ago 828197c
Use localpart as fallback display name

Using bare JID is nice, but is detected by many SPAM filters as an attempt to
spoof an email address.
2 files changed, 7 insertions(+), 7 deletions(-)

M Email.hs
M test/EmailTest.hs
M Email.hs => Email.hs +1 -1
@@ 92,7 92,7 @@ equalsDecode =
	textToString . decodeUtf8

jidToMailbox :: XMPP.JID -> MIME.Domain -> MIME.Mailbox
jidToMailbox jid domain = MIME.Mailbox (Just $ bareTxt jid) $
jidToMailbox jid domain = MIME.Mailbox (XMPP.strNode <$> XMPP.jidNode jid) $
	MIME.AddrSpec (jidToLocalpart jid) domain

emailToMessageType :: MIME.MIMEMessage -> XMPP.MessageType

M test/EmailTest.hs => test/EmailTest.hs +6 -6
@@ 377,7 377,7 @@ unit_messageToEmailChat =
	\Message-ID: <" ++ timestamp ++ ".=00.=00@gateway.example.com>\r\n\
	\Chat-Version: 1.0\r\n\
	\To: t@example.com\r\n\
	\From: =?utf-8?B?5LiWQGV4YW1wbGUuY29t?=\r\n\
	\From: =?utf-8?B?5LiW?=\
	\ <=E4=B8=96=40example=2Ecom@gateway.example.com>\r\n\
	\Jabber-ID: =?utf-8?B?5LiWQGV4YW1wbGUuY29t?=\r\n\
	\Subject: Chat: =?utf-8?B?5LiW55WMCi4K?=\r\n\


@@ 416,7 416,7 @@ unit_messageToEmailWithSubject =
	email = s$"MIME-Version: 1.0\r\n\
	\Message-ID: <" ++ timestamp ++ ".123.=00@gateway.example.com>\r\n\
	\To: t@example.com\r\n\
	\From: \"f@example.com\" <f=40example=2Ecom@gateway.example.com>\r\n\
	\From: f <f=40example=2Ecom@gateway.example.com>\r\n\
	\Jabber-ID: f@example.com\r\n\
	\Subject: =?utf-8?B?5LiW55WM?=\r\n\
	\Date: Mon, 01 Jan 1990 00:00:00 +0000\r\n\


@@ 460,7 460,7 @@ unit_messageToEmailWithDelay =
	email = s$"MIME-Version: 1.0\r\n\
	\Message-ID: <" ++ timestamp ++ ".=00.=00@gateway.example.com>\r\n\
	\To: t@example.com\r\n\
	\From: \"f@example.com\" <f=40example=2Ecom@gateway.example.com>\r\n\
	\From: f <f=40example=2Ecom@gateway.example.com>\r\n\
	\Jabber-ID: f@example.com\r\n\
	\Date: Sun, 22 Feb 2009 00:10:00 +0000\r\n\
	\Content-Transfer-Encoding: base64\r\n\


@@ 498,7 498,7 @@ unit_messageToEmailWithThread =
	email = s$"MIME-Version: 1.0\r\n\
	\Message-ID: <" ++ timestamp ++ ".=00.athread@gateway.example.com>\r\n\
	\To: t@example.com\r\n\
	\From: \"f@example.com\" <f=40example=2Ecom@gateway.example.com>\r\n\
	\From: f <f=40example=2Ecom@gateway.example.com>\r\n\
	\Jabber-ID: f@example.com\r\n\
	\Date: Mon, 01 Jan 1990 00:00:00 +0000\r\n\
	\Content-Transfer-Encoding: base64\r\n\


@@ 536,7 536,7 @@ unit_messageToEmailWithCheoThread =
		\=40foo=2Etld=3E@gateway.example.com>\r\n\
	\References: <thing@foo.tld>\r\n\
	\To: t@example.com\r\n\
	\From: \"f@example.com\" <f=40example=2Ecom@gateway.example.com>\r\n\
	\From: f <f=40example=2Ecom@gateway.example.com>\r\n\
	\Jabber-ID: f@example.com\r\n\
	\Date: Mon, 01 Jan 1990 00:00:00 +0000\r\n\
	\Content-Transfer-Encoding: base64\r\n\


@@ 577,7 577,7 @@ unit_messageToEmailWithDeepCheoThread =
		\40t=2Et=3E=20=3C6=40t=2Et=3E@gateway.example.com>\r\n\
	\References: <1@t.t> <3@t.t> <4@t.t> <5@t.t> <6@t.t>\r\n\
	\To: t@example.com\r\n\
	\From: \"f@example.com\" <f=40example=2Ecom@gateway.example.com>\r\n\
	\From: f <f=40example=2Ecom@gateway.example.com>\r\n\
	\Jabber-ID: f@example.com\r\n\
	\Date: Mon, 01 Jan 1990 00:00:00 +0000\r\n\
	\Content-Transfer-Encoding: base64\r\n\