read_content_test.go 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433
  1. package smtp_server
  2. import (
  3. "bytes"
  4. log "github.com/sirupsen/logrus"
  5. "io/fs"
  6. "net"
  7. "net/netip"
  8. "os"
  9. "path/filepath"
  10. "pmail/config"
  11. "pmail/db"
  12. parsemail2 "pmail/dto/parsemail"
  13. "pmail/session"
  14. "testing"
  15. "time"
  16. )
  17. func testInit() {
  18. // 设置日志格式为json格式
  19. //log.SetFormatter(&log.JSONFormatter{})
  20. log.SetReportCaller(true)
  21. log.SetFormatter(&log.TextFormatter{
  22. //以下设置只是为了使输出更美观
  23. DisableColors: true,
  24. TimestampFormat: "2006-01-02 15:03:04",
  25. })
  26. // 设置将日志输出到标准输出(默认的输出为stderr,标准错误)
  27. // 日志消息输出可以是任意的io.writer类型
  28. log.SetOutput(os.Stdout)
  29. // 设置日志级别为warn以上
  30. log.SetLevel(log.TraceLevel)
  31. var cst, _ = time.LoadLocation("Asia/Shanghai")
  32. time.Local = cst
  33. config.Init()
  34. parsemail2.Init()
  35. db.Init()
  36. session.Init()
  37. }
  38. func TestNuisanace(t *testing.T) {
  39. testInit()
  40. s := Session{
  41. RemoteAddress: net.TCPAddrFromAddrPort(netip.AddrPortFrom(netip.AddrFrom4([4]byte{}), 25)),
  42. }
  43. data, _ := os.ReadFile("../docs/nuisance/demo.txt")
  44. s.Data(bytes.NewReader(data))
  45. }
  46. func TestSession_Data(t *testing.T) {
  47. testInit()
  48. s := Session{
  49. RemoteAddress: net.TCPAddrFromAddrPort(netip.AddrPortFrom(netip.AddrFrom4([4]byte{}), 25)),
  50. }
  51. filepath.WalkDir("docs", func(path string, d fs.DirEntry, err error) error {
  52. if !d.IsDir() {
  53. data, _ := os.ReadFile(path)
  54. s.Data(bytes.NewReader(data))
  55. }
  56. return nil
  57. })
  58. }
  59. func TestSession_DataGmail(t *testing.T) {
  60. testInit()
  61. s := Session{
  62. RemoteAddress: net.TCPAddrFromAddrPort(netip.AddrPortFrom(netip.AddrFrom4([4]byte{}), 25)),
  63. }
  64. data, _ := os.ReadFile("docs/gmail/带附件带图片.txt")
  65. s.Data(bytes.NewReader(data))
  66. }
  67. func TestPmailEmail(t *testing.T) {
  68. testInit()
  69. emailData := `DKIM-Signature: a=rsa-sha256; bh=x7Rh+N2y2K9exccEAyKCTAGDgYKfnLZpMWc25ug5Ny4=;
  70. c=simple/simple; d=domain.com;
  71. h=Content-Type:Mime-Version:Subject:To:From:Date; s=default; t=1693831868;
  72. v=1;
  73. b=1PZEupYvSMtGyYx42b4G65YbdnRj4y2QFo9kS7GXiTVhUM5EYzJhZzknwRMN5RL5aFY26W4E
  74. DmzJ85XvPPvrDtnU/B4jkc5xthE+KEsb1Go8HcL8WQqwvsE9brepeA0t0RiPnA/x7dbTo3u72SG
  75. WqtviWbJH5lPFc9PkSbEPFtc=
  76. Content-Type: multipart/mixed;
  77. boundary=3c13260efb7bd8bad8315c21215489fe283f36cdf82813674f6e11215f6c
  78. Mime-Version: 1.0
  79. Subject: =?utf-8?q?=E6=8F=92=E4=BB=B6=E6=B5=8B=E8=AF=95?=
  80. To: =?utf-8?q?=E5=90=8D?= <ok@jinnrry.com>
  81. From: =?utf-8?q?=E5=8F=91=E9=80=81=E4=BA=BA?= <j@jinnrry.com>
  82. Date: Mon, 04 Sep 2023 20:51:08 +0800
  83. --3c13260efb7bd8bad8315c21215489fe283f36cdf82813674f6e11215f6c
  84. Content-Type: multipart/alternative;
  85. boundary=9ebf2f3c4f97c51dd9a285ae28a54d2d0d84aa6d0ad28b76547e2096bb66
  86. --9ebf2f3c4f97c51dd9a285ae28a54d2d0d84aa6d0ad28b76547e2096bb66
  87. Content-Transfer-Encoding: quoted-printable
  88. Content-Disposition: inline
  89. Content-Type: text/plain
  90. =E8=BF=99=E6=98=AFText
  91. --9ebf2f3c4f97c51dd9a285ae28a54d2d0d84aa6d0ad28b76547e2096bb66
  92. Content-Transfer-Encoding: quoted-printable
  93. Content-Disposition: inline
  94. Content-Type: text/html
  95. <div>=E8=BF=99=E6=98=AFHtml</div>
  96. --9ebf2f3c4f97c51dd9a285ae28a54d2d0d84aa6d0ad28b76547e2096bb66--
  97. --3c13260efb7bd8bad8315c21215489fe283f36cdf82813674f6e11215f6c--
  98. `
  99. s := Session{
  100. RemoteAddress: net.TCPAddrFromAddrPort(netip.AddrPortFrom(netip.AddrFrom4([4]byte{}), 25)),
  101. }
  102. s.Data(bytes.NewReader([]byte(emailData)))
  103. }
  104. func TestRuleForward(t *testing.T) {
  105. testInit()
  106. forwardEmail := `DKIM-Signature: a=rsa-sha256; bh=bpOshF+iimuqAQijVxqkH6gPpWf8A+Ih30/tMjgEgS0=;
  107. c=simple/simple; d=jinnrry.com;
  108. h=Content-Type:Mime-Version:Subject:To:From:Date; s=default; t=1693992640;
  109. v=1;
  110. b=XiOgYL9iGrkuYzXBAf7DSO0sRbFr6aPOE4VikmselNKEF1UTjMPdiqpeHyx/i6BOQlJWWZEC
  111. PzceHTDFIStcZE6a5Sc1nh8Fis+gRkrheBO/zK/P5P/euK+0Fj5+0T82keNTSCgo1ZtEIubaNR0
  112. JvkwJ2ZC9g8xV6Yiq+ZhRriT8lZ6zeI55PPEFJIzFgZ7xDshDgx5E7J1xRXQqcEMV1rgVq04d3c
  113. 6wjU+LLtghmgtUToRp3ASn6DhVO+Bbc4QkmcQ/StQH3681+1GVMHvQSBhSSymSRA71SikE2u3a1
  114. JnvbOP9fThP7h+6oFEIRuF7MwDb3JWY5BXiFFKCkecdFg==
  115. Content-Type: multipart/mixed;
  116. boundary=8e9d5abb6bdac11b8d7d6e13280af1a87d12b904a59368d6e852b0a4ce3e
  117. Mime-Version: 1.0
  118. Subject: forward
  119. To: <t@jiangwei.one>
  120. From: "i" <i@jinnrry.com>
  121. Date: Wed, 06 Sep 2023 17:30:40 +0800
  122. --8e9d5abb6bdac11b8d7d6e13280af1a87d12b904a59368d6e852b0a4ce3e
  123. Content-Type: multipart/alternative;
  124. boundary=a62ae91c159ea22e8196d57d344626eb00d1ddfa9c5064a39b01588aa992
  125. --a62ae91c159ea22e8196d57d344626eb00d1ddfa9c5064a39b01588aa992
  126. Content-Transfer-Encoding: quoted-printable
  127. Content-Disposition: inline
  128. Content-Type: text/plain
  129. hello pls Forward the email.
  130. --a62ae91c159ea22e8196d57d344626eb00d1ddfa9c5064a39b01588aa992
  131. Content-Transfer-Encoding: quoted-printable
  132. Content-Disposition: inline
  133. Content-Type: text/html
  134. <p>hello pls Forward the email.</p>
  135. --a62ae91c159ea22e8196d57d344626eb00d1ddfa9c5064a39b01588aa992--
  136. --8e9d5abb6bdac11b8d7d6e13280af1a87d12b904a59368d6e852b0a4ce3e--`
  137. readEmail := `DKIM-Signature: a=rsa-sha256; bh=JcCDj6edb1bAwRbcFZ63plFZOeB5AdGWLE/PQ2FQ1Tc=;
  138. c=simple/simple; d=jinnrry.com;
  139. h=Content-Type:Mime-Version:Subject:To:From:Date; s=default; t=1693992600;
  140. v=1;
  141. b=rwlqSkDFKYH42pA1jsajemaw+4YdeLHPeqV4mLQrRdihgma1VSvXl5CEOur/KuwQuUarr2cu
  142. SntWrHE6+RnDaQcPEHbkgoMjEJw5+VPwkIvE6VSlMIB7jg93mGzvN2yjheWTePZ+cVPjOaIrgir
  143. wiT24hkrTHp+ONT8XoS0sDuY+ieyBZp/GCv/YvgE4t0JEkNozMAVWotrXxaICDzZoWP3NNmKLqg
  144. 6He6zwWAl51r3W5R5weGBi6A/FqlHgHZGroXnNi+wolDuN6pQiVAJ7MZ6hboPCbCCRrBQDTdor5
  145. wEI2+MwlJ/d2f17wxoGmluCewbeYttuVcpUOVwACJKw3g==
  146. Content-Type: multipart/mixed;
  147. boundary=9e33a130a8a976102a93e296d6408d228e151f7841ca9ee0d777234fd6f3
  148. Mime-Version: 1.0
  149. Subject: read
  150. To: <t@jiangwei.one>
  151. From: "i" <i@jinnrry.com>
  152. Date: Wed, 06 Sep 2023 17:30:00 +0800
  153. --9e33a130a8a976102a93e296d6408d228e151f7841ca9ee0d777234fd6f3
  154. Content-Type: multipart/alternative;
  155. boundary=54a95f3429f3cdb342383db10293780bed341f8dc20d2f876eb0853e3884
  156. --54a95f3429f3cdb342383db10293780bed341f8dc20d2f876eb0853e3884
  157. Content-Transfer-Encoding: quoted-printable
  158. Content-Disposition: inline
  159. Content-Type: text/plain
  160. 12 aRead 1sadf
  161. --54a95f3429f3cdb342383db10293780bed341f8dc20d2f876eb0853e3884
  162. Content-Transfer-Encoding: quoted-printable
  163. Content-Disposition: inline
  164. Content-Type: text/html
  165. <p>12 aRead 1sadf</p>
  166. --54a95f3429f3cdb342383db10293780bed341f8dc20d2f876eb0853e3884--
  167. --9e33a130a8a976102a93e296d6408d228e151f7841ca9ee0d777234fd6f3--`
  168. moveEmail := `DKIM-Signature: a=rsa-sha256; bh=YQfG/wlHGhky6FNmpIwgDYDOc/uyivdBv+9S02Z04xY=;
  169. c=simple/simple; d=jinnrry.com;
  170. h=Content-Type:Mime-Version:Subject:To:From:Date; s=default; t=1693992542;
  171. v=1;
  172. b=IhxswOCq8I7CmCas1EMp+n8loR7illqlF0IJC6eN1+OLjI/E5BPzpP4HWkyqaAkd0Vn9i+Bn
  173. MVb5kNHZ2S7qt0rqAAc6Atc0i9WpLEI3Cng+VDn+difcMZlJSAkhLLn2sUsS4Fzqqo3Cbw62qSO
  174. TgnWRmlj9aM+5xfGcl/76WOvQQpahJbGg6Go51kFMeHVom/VeGKIgFBCeMe37T/LS03c3pAV8gA
  175. i6Zy3GYE57W/qU3oCzaGeS3n5zom/i74H4VipiVIMX/OBNYhdHWrP8vyjvzLFpJlXp6RvzcRl0P
  176. ytyiCZfE8G7fAFntp20LW70Y5Xgqqczk1jR578UDczVoA==
  177. Content-Type: multipart/mixed;
  178. boundary=c84d60b253aa6caee345c73e717ad59b1975448bbdfad7a23ac4d76e022d
  179. Mime-Version: 1.0
  180. Subject: Move
  181. To: <t@jiangwei.one>
  182. From: "i" <i@jinnrry.com>
  183. Date: Wed, 06 Sep 2023 17:29:02 +0800
  184. --c84d60b253aa6caee345c73e717ad59b1975448bbdfad7a23ac4d76e022d
  185. Content-Type: multipart/alternative;
  186. boundary=a69985ebcf3c1c44d6e69e5a29c1044743cd9e44d4bc9bb6886f83a73966
  187. --a69985ebcf3c1c44d6e69e5a29c1044743cd9e44d4bc9bb6886f83a73966
  188. Content-Transfer-Encoding: quoted-printable
  189. Content-Disposition: inline
  190. Content-Type: text/plain
  191. MOVE move Move
  192. --a69985ebcf3c1c44d6e69e5a29c1044743cd9e44d4bc9bb6886f83a73966
  193. Content-Transfer-Encoding: quoted-printable
  194. Content-Disposition: inline
  195. Content-Type: text/html
  196. <p>MOVE move Move</p>
  197. --a69985ebcf3c1c44d6e69e5a29c1044743cd9e44d4bc9bb6886f83a73966--
  198. --c84d60b253aa6caee345c73e717ad59b1975448bbdfad7a23ac4d76e022d--`
  199. deleteEmail := `DKIM-Signature: a=rsa-sha256; bh=dNtHGqd1NbRj0WSwrJmPsqAcAy3h/4kZK2HFQ0Asld8=;
  200. c=simple/simple; d=jinnrry.com;
  201. h=Content-Type:Mime-Version:Subject:To:From:Date; s=default; t=1693992495;
  202. v=1;
  203. b=QllU8lqGdoOMaGYp8d13oWytb7+RebqKjq4y8Rs/kOeQxoE8dSEVliK3eBiXidsNTdDtkTqf
  204. eiwjyRBK92NVCYprdJqLbu9qZ39BC2lk3NXttTSJ1+1ZZ/bGtIW5JIYn2pToED0MqVVkxGFUtl+
  205. qFmc4mWo5a4Mbij7xaAB3uJtHpBDt7q4Ovr2hiMetQv7YrhZvCt/xrH8Q9YzZ6xzFUL5ekW40eH
  206. oWElU1GyVBHWCKh31aweyhA+1XLPYojjREQYd4svRqTbSFSsBqFwFIUGdnyJh2WgmF8eucmttAw
  207. oRhgzyZkHL1jAskKFBpO10SDReyk50Cvc+0kSLj+QcUpg==
  208. Content-Type: multipart/mixed;
  209. boundary=bdfa9bf94e22e218105281e06bd59bd6df3ce70e71367bf49fbe73301af3
  210. Mime-Version: 1.0
  211. Subject: test
  212. To: <t@jiangwei.one>
  213. From: "i" <i@jinnrry.com>
  214. Date: Wed, 06 Sep 2023 17:28:15 +0800
  215. --bdfa9bf94e22e218105281e06bd59bd6df3ce70e71367bf49fbe73301af3
  216. Content-Type: multipart/alternative;
  217. boundary=7352524eaae801790245f6bf095460fd1f4e01f5748b4dba48635bf59b04
  218. --7352524eaae801790245f6bf095460fd1f4e01f5748b4dba48635bf59b04
  219. Content-Transfer-Encoding: quoted-printable
  220. Content-Disposition: inline
  221. Content-Type: text/plain
  222. Delete
  223. --7352524eaae801790245f6bf095460fd1f4e01f5748b4dba48635bf59b04
  224. Content-Transfer-Encoding: quoted-printable
  225. Content-Disposition: inline
  226. Content-Type: text/html
  227. <p>Delete</p>
  228. --7352524eaae801790245f6bf095460fd1f4e01f5748b4dba48635bf59b04--
  229. --bdfa9bf94e22e218105281e06bd59bd6df3ce70e71367bf49fbe73301af3--`
  230. s := Session{
  231. RemoteAddress: net.TCPAddrFromAddrPort(netip.AddrPortFrom(netip.AddrFrom4([4]byte{}), 25)),
  232. }
  233. s.Data(bytes.NewReader([]byte(deleteEmail)))
  234. s.Data(bytes.NewReader([]byte(readEmail)))
  235. s.Data(bytes.NewReader([]byte(forwardEmail)))
  236. s.Data(bytes.NewReader([]byte(moveEmail)))
  237. }
  238. func TestRuleRead(t *testing.T) {
  239. testInit()
  240. readEmail := `DKIM-Signature: a=rsa-sha256; bh=JcCDj6edb1bAwRbcFZ63plFZOeB5AdGWLE/PQ2FQ1Tc=;
  241. c=simple/simple; d=jinnrry.com;
  242. h=Content-Type:Mime-Version:Subject:To:From:Date; s=default; t=1693992600;
  243. v=1;
  244. b=rwlqSkDFKYH42pA1jsajemaw+4YdeLHPeqV4mLQrRdihgma1VSvXl5CEOur/KuwQuUarr2cu
  245. SntWrHE6+RnDaQcPEHbkgoMjEJw5+VPwkIvE6VSlMIB7jg93mGzvN2yjheWTePZ+cVPjOaIrgir
  246. wiT24hkrTHp+ONT8XoS0sDuY+ieyBZp/GCv/YvgE4t0JEkNozMAVWotrXxaICDzZoWP3NNmKLqg
  247. 6He6zwWAl51r3W5R5weGBi6A/FqlHgHZGroXnNi+wolDuN6pQiVAJ7MZ6hboPCbCCRrBQDTdor5
  248. wEI2+MwlJ/d2f17wxoGmluCewbeYttuVcpUOVwACJKw3g==
  249. Content-Type: multipart/mixed;
  250. boundary=9e33a130a8a976102a93e296d6408d228e151f7841ca9ee0d777234fd6f3
  251. Mime-Version: 1.0
  252. Subject: read
  253. To: <t@jiangwei.one>
  254. From: "i" <i@jinnrry.com>
  255. Date: Wed, 06 Sep 2023 17:30:00 +0800
  256. --9e33a130a8a976102a93e296d6408d228e151f7841ca9ee0d777234fd6f3
  257. Content-Type: multipart/alternative;
  258. boundary=54a95f3429f3cdb342383db10293780bed341f8dc20d2f876eb0853e3884
  259. --54a95f3429f3cdb342383db10293780bed341f8dc20d2f876eb0853e3884
  260. Content-Transfer-Encoding: quoted-printable
  261. Content-Disposition: inline
  262. Content-Type: text/plain
  263. 12 aRead 1sadf
  264. --54a95f3429f3cdb342383db10293780bed341f8dc20d2f876eb0853e3884
  265. Content-Transfer-Encoding: quoted-printable
  266. Content-Disposition: inline
  267. Content-Type: text/html
  268. <p>12 aRead 1sadf</p>
  269. --54a95f3429f3cdb342383db10293780bed341f8dc20d2f876eb0853e3884--
  270. --9e33a130a8a976102a93e296d6408d228e151f7841ca9ee0d777234fd6f3--`
  271. s := Session{
  272. RemoteAddress: net.TCPAddrFromAddrPort(netip.AddrPortFrom(netip.AddrFrom4([4]byte{}), 25)),
  273. }
  274. s.Data(bytes.NewReader([]byte(readEmail)))
  275. }
  276. func TestRuleDelete(t *testing.T) {
  277. testInit()
  278. deleteEmail := `DKIM-Signature: a=rsa-sha256; bh=dNtHGqd1NbRj0WSwrJmPsqAcAy3h/4kZK2HFQ0Asld8=;
  279. c=simple/simple; d=jinnrry.com;
  280. h=Content-Type:Mime-Version:Subject:To:From:Date; s=default; t=1693992495;
  281. v=1;
  282. b=QllU8lqGdoOMaGYp8d13oWytb7+RebqKjq4y8Rs/kOeQxoE8dSEVliK3eBiXidsNTdDtkTqf
  283. eiwjyRBK92NVCYprdJqLbu9qZ39BC2lk3NXttTSJ1+1ZZ/bGtIW5JIYn2pToED0MqVVkxGFUtl+
  284. qFmc4mWo5a4Mbij7xaAB3uJtHpBDt7q4Ovr2hiMetQv7YrhZvCt/xrH8Q9YzZ6xzFUL5ekW40eH
  285. oWElU1GyVBHWCKh31aweyhA+1XLPYojjREQYd4svRqTbSFSsBqFwFIUGdnyJh2WgmF8eucmttAw
  286. oRhgzyZkHL1jAskKFBpO10SDReyk50Cvc+0kSLj+QcUpg==
  287. Content-Type: multipart/mixed;
  288. boundary=bdfa9bf94e22e218105281e06bd59bd6df3ce70e71367bf49fbe73301af3
  289. Mime-Version: 1.0
  290. Subject: test
  291. To: <t@jiangwei.one>
  292. From: "i" <i@jinnrry.com>
  293. Date: Wed, 06 Sep 2023 17:28:15 +0800
  294. --bdfa9bf94e22e218105281e06bd59bd6df3ce70e71367bf49fbe73301af3
  295. Content-Type: multipart/alternative;
  296. boundary=7352524eaae801790245f6bf095460fd1f4e01f5748b4dba48635bf59b04
  297. --7352524eaae801790245f6bf095460fd1f4e01f5748b4dba48635bf59b04
  298. Content-Transfer-Encoding: quoted-printable
  299. Content-Disposition: inline
  300. Content-Type: text/plain
  301. Delete
  302. --7352524eaae801790245f6bf095460fd1f4e01f5748b4dba48635bf59b04
  303. Content-Transfer-Encoding: quoted-printable
  304. Content-Disposition: inline
  305. Content-Type: text/html
  306. <p>Delete</p>
  307. --7352524eaae801790245f6bf095460fd1f4e01f5748b4dba48635bf59b04--
  308. --bdfa9bf94e22e218105281e06bd59bd6df3ce70e71367bf49fbe73301af3--`
  309. s := Session{
  310. RemoteAddress: net.TCPAddrFromAddrPort(netip.AddrPortFrom(netip.AddrFrom4([4]byte{}), 25)),
  311. }
  312. s.Data(bytes.NewReader([]byte(deleteEmail)))
  313. }
  314. func TestRuleMove(t *testing.T) {
  315. testInit()
  316. moveEmail := `DKIM-Signature: a=rsa-sha256; bh=YQfG/wlHGhky6FNmpIwgDYDOc/uyivdBv+9S02Z04xY=;
  317. c=simple/simple; d=jinnrry.com;
  318. h=Content-Type:Mime-Version:Subject:To:From:Date; s=default; t=1693992542;
  319. v=1;
  320. b=IhxswOCq8I7CmCas1EMp+n8loR7illqlF0IJC6eN1+OLjI/E5BPzpP4HWkyqaAkd0Vn9i+Bn
  321. MVb5kNHZ2S7qt0rqAAc6Atc0i9WpLEI3Cng+VDn+difcMZlJSAkhLLn2sUsS4Fzqqo3Cbw62qSO
  322. TgnWRmlj9aM+5xfGcl/76WOvQQpahJbGg6Go51kFMeHVom/VeGKIgFBCeMe37T/LS03c3pAV8gA
  323. i6Zy3GYE57W/qU3oCzaGeS3n5zom/i74H4VipiVIMX/OBNYhdHWrP8vyjvzLFpJlXp6RvzcRl0P
  324. ytyiCZfE8G7fAFntp20LW70Y5Xgqqczk1jR578UDczVoA==
  325. Content-Type: multipart/mixed;
  326. boundary=c84d60b253aa6caee345c73e717ad59b1975448bbdfad7a23ac4d76e022d
  327. Mime-Version: 1.0
  328. Subject: Move
  329. To: <t@jiangwei.one>
  330. From: "i" <i@jinnrry.com>
  331. Date: Wed, 06 Sep 2023 17:29:02 +0800
  332. --c84d60b253aa6caee345c73e717ad59b1975448bbdfad7a23ac4d76e022d
  333. Content-Type: multipart/alternative;
  334. boundary=a69985ebcf3c1c44d6e69e5a29c1044743cd9e44d4bc9bb6886f83a73966
  335. --a69985ebcf3c1c44d6e69e5a29c1044743cd9e44d4bc9bb6886f83a73966
  336. Content-Transfer-Encoding: quoted-printable
  337. Content-Disposition: inline
  338. Content-Type: text/plain
  339. MOVE move Move
  340. --a69985ebcf3c1c44d6e69e5a29c1044743cd9e44d4bc9bb6886f83a73966
  341. Content-Transfer-Encoding: quoted-printable
  342. Content-Disposition: inline
  343. Content-Type: text/html
  344. <p>MOVE move Move</p>
  345. --a69985ebcf3c1c44d6e69e5a29c1044743cd9e44d4bc9bb6886f83a73966--
  346. --c84d60b253aa6caee345c73e717ad59b1975448bbdfad7a23ac4d76e022d--`
  347. s := Session{
  348. RemoteAddress: net.TCPAddrFromAddrPort(netip.AddrPortFrom(netip.AddrFrom4([4]byte{}), 25)),
  349. }
  350. s.Data(bytes.NewReader([]byte(moveEmail)))
  351. }