]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Minor] Store Envelope (SMTP) information on structured task as task.envelope.
authorbradleydoherty59 <bradleydoherty59@gmail.com>
Tue, 23 Nov 2021 22:22:19 +0000 (16:22 -0600)
committerbradleydoherty59 <bradleydoherty59@gmail.com>
Tue, 23 Nov 2021 22:22:19 +0000 (16:22 -0600)
lualib/lua_mime.lua

index 24c02daaec9190e14d5f2d988b8910f7ce45b0ae..308400c93ce4edf83c6f81832765818b5f25a2ad 100644 (file)
@@ -582,6 +582,19 @@ exports.message_to_ucl = function(task)
   result.digest = task:get_digest()
   result.newlines = task:get_newlines_type()
   result.headers = task:get_headers(true) or {}
+  
+  -- Envelope (smtp) information form email
+  local envelope = {}
+  -- Want to differentiate the Mime and SMTP from/recipients here
+  envelope.from_smtp = task:get_from('smtp')
+  envelope.from_mime = task:get_from('mime')
+  envelope.recipients_smtp = task:get_recipients('smtp')
+  envelope.recipients_mime = task:get_recipients('mime')
+  
+  envelope.helo = task:get_helo()
+  envelope.hostname = task:get_hostname()
+  envelope.client_ip = task:get_client_ip()
+  result.envelope = envelope
 
   local parts = task:get_parts() or {}
   result.parts = {}