read_content_test.go 14 KB

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