updated log message structure

This commit is contained in:
Andris Reinman 2017-10-21 15:11:13 +03:00
parent c49f9ebc18
commit 86bad47bfe

View file

@ -846,11 +846,17 @@ module.exports = (db, server, messageHandler) => {
action: entry.action,
origin: entry.origin || entry.source,
src: entry.ip,
dst: entry.mx,
dst: entry.host,
mx: entry.mx,
reason: entry.reason,
error: entry.error,
response: entry.response,
messageId: entry['message-id'],
from: entry.from,
to: entry.forward || (entry.to && [].concat(typeof entry.to === 'string' ? entry.to.split(',') : entry.to || [])),
to:
(entry.forward &&
[].concat(typeof entry.forward === 'string' ? entry.forward.trim().split(/\s*,\s*/) : entry.forward || [])) ||
(entry.to && [].concat(typeof entry.to === 'string' ? entry.to.trim().split(/\s*,\s*/) : entry.to || [])),
transtype: entry.transtype,
time: entry.created
}))