Purpose
This guide explains how to forward IceWarp Messaging Server logs to Logsign USO over syslog. The integration parses the SMTP session lines that IceWarp writes (client and server dialog, reply codes, sender and recipient), and on IceWarp 13 and later it also classifies anti-spam decisions, anti-virus scan results, whitelist and blacklist changes, intrusion prevention blocks, service errors, failed SQL queries, administration console logins, user authentication results, login policy counter changes, session summaries of sent and received mail, and maintenance reports.
Prerequisites
- Administrator access to the IceWarp administration console.
- Network connectivity from the IceWarp server to the Logsign USO collector on your syslog port (TCP or UDP 514 by default).
- A Logsign USO release that includes the IceWarp Messaging Server parser. The IceWarp 13+ event classes described below need a recent release. Contact Logsign Support if you are not sure which release you run.
- Logging enabled for the IceWarp services you want to see in Logsign USO (at least SMTP and Anti-Spam, Anti-Virus if you want to see virus scan results, and the authentication log of POP3/IMAP and Control if you want to see login events).
Step 1: Send IceWarp Logs to Syslog
IceWarp can send its service logs to a remote syslog server. The menu names and the exact location of the syslog setting differ between IceWarp releases, so check the logging section of the IceWarp documentation for your release.
- Log in to the IceWarp administration console.
- Open the logging settings and turn on logging for the services you need (SMTP, Anti-Spam, Anti-Virus, Control, GroupWare, POP3/IMAP).
- Enter the IP address of the Logsign USO collector as the syslog server and set the port (514 by default).
- Save the settings.
Logsign USO expects the lines exactly as IceWarp writes them, with the BSD syslog header (Mmm dd hh:mm:ss service[thread]:) in front. If a relay sits between IceWarp and Logsign USO, make sure it does not rewrite the message text.
Step 2: Add the Data Source in Logsign USO
Open the Logsign USO web interface and click + Device under Settings > Data Collection. Choose Syslog as the collection method, select IceWarp as the vendor and Messaging Server as the product, and enter the IP address of the IceWarp server as the host. Click Save. Once the server starts sending, events appear under Search.
Supported Message Formats
The parser accepts the classic SMTP session lines and the IceWarp 13+ format, which repeats the source tag and adds the thread ID and time after the syslog header. Some examples (addresses and public IPs are anonymized):
Oct 14 14:47:37 smtp.s[7F84D1FF7640]: 203.30.161.171 203.30.161.172 [00007F84D1FF7640] 14:47:37 Client session *** <sender@example.com> <rcpt@example.org> 2 4974036 00:00:18 OK 202610141446596132
Nov 12 09:40:30 smtp.s[7FE7517F5640]: 203.0.113.16 203.0.113.16 [00007FE7517F5640] 09:40:30 *** <sender@example.net> <rcpt@example.org> 1 37990 00:01:17 OK 202611120939128136
Nov 12 08:40:25 smtp.s[7FE7473FC640]: 203.0.113.102 203.0.113.102 [00007FE7473FC640] 08:40:25 >>> 550 5.7.1 <sender@example.com> Access to <rcpt@example.net> not allowed
Oct 14 14:44:24 smtp.antispam[7F84EBBFE640]: 127.0.0.1 127.0.0.1 [00007F84EBBFE640] 14:44:24 202610141444066120 '<sender@example.com>' '<rcpt@example.org>' 1 score 5.20 reason [SpamAssassin=-1.80] action SPAM
Oct 21 15:06:47 smtp.antivirus[7F84EA7F9640]: 203.0.113.20 203.0.113.20 [00007F84EA7F9640] 15:06:47 No virus in 'text/html' (56.48kB, scanned as 'att_202610211506470000.unknown'), 202610211506479521 '<sender@example.com>' '<rcpt@example.org>' 1
Oct 21 07:56:40 smtp.antivirus[7F84EBBFE640]: 203.0.113.31 203.0.113.31 [00007F84EBBFE640] 07:56:40 <sender@example.com> <rcpt@example.org>; Virus 'Exp/20180802-B' found in 'PURCHASE ORDER-PO00000001.xlam' (585.77kB, scanned as 'att_202610210756380001.xlam'), 202610210756372793 '<sender@example.com>' '<rcpt@example.org>' 1
Oct 14 14:44:25 smtp.antispam[7F84C5BF6640]: SYSTEM SYSTEM [00007F84C5BF6640] 14:44:25 Whitelist: recipient 'partner@example.org' owner 'user@example.com' whitelisted
Oct 14 14:46:24 smtp.s[7F84EBBFE640]: SYSTEM SYSTEM [00007F84EBBFE640] 14:46:24 Intrusion Prevention - closing all connections from 203.30.161.171
Oct 14 08:18:22 control.maintenance[7FC82BFFF640]: Console Console [00007FC82BFFF640] 08:18:22 Logged on successfully: user@example.com 203.30.161.171
Nov 12 09:41:23 pop3.auth[7F0BEE7F9640]: 127.0.0.1 127.0.0.1 [00007F0BEE7F9640] 09:41:23 Authentication [IMAP] - Result=1, User=user@example.com, Method=2, Account=Enabled
Nov 12 08:26:43 pop3.auth[7F0BECFF3640]: 203.0.113.5 203.0.113.5 [00007F0BECFF3640] 08:26:43 Authentication [POP3] - Result=0, User=info@example.com, Method=0, Account=Enabled
Nov 12 08:59:32 control.auth[7F6542FFB640]: 203.0.113.144 203.0.113.144 [00007F6542FFB640] 08:59:32 Login policy [Control] - increased failed login count to 3, user=user@example.com
Nov 12 09:14:37 control.auth[7F65597F5640]: 203.0.113.205 203.0.113.205 [00007F65597F5640] 09:14:37 Login policy [Control] - cleared failed login count, user=user@example.com
Nov 12 02:28:59 control.adsync[7F6530BF2640]: SYSTEM SYSTEM [00007F6530BF2640] 02:28:59 Synchronizing domain example.com
Notes and Limits
- Older parser releases wrote the sender into Mail.TO and the recipient into Mail.FROM for
Client session ***lines. Current releases write the sender into Mail.FROM. Events that were stored before the update keep the old order. - Intrusion prevention events used to appear as Application / Mail / Fail (reply code 421) or Application / Mail / Info. They now appear as Security / Intrusion Prevention / Block. If you have alert rules, searches or reports that look for these events under Mail Fail, update them.
- Anti-virus lines (Service.Name
smtp.antivirus) used to appear as Application / Mail / Info with all details in Event.Note. They now appear as Security / Virus / Scan (severity information) when no virus is found, and as Security / Virus / Detect (severity alert) when a virus is found. If you have searches or reports that look for these lines under Mail Info, update them. Events that were stored before the update keep the old class. - For anti-virus lines, the parser writes the queue ID into Mail.QueueID, the sender and recipient into Mail.FROM and Mail.TO, and the size of the scanned part into Mail.AttachSize (converted from kB to bytes). When the scanned part is a MIME type (for example
text/html), it goes into Mime.Type. When it is a file name, it goes into Mail.Attachment. For a virus detection, the virus name goes into Virus.Name and the infected file name into Virus.FileName. - Bounce messages with an empty sender (
<>) have no Mail.FROM value. The temporary file name afterscanned asand the number at the end of the line stay in Event.Note. - Session summary lines used to appear as Application / Mail / Info. When the session status is
OK, aClient session ***line (outgoing) now appears as Application / Mail / Send and a***line (incoming) appears as Application / Mail / Receive. Other statuses, for exampleINCOMPLETE-SESSION, stay under Application / Mail / Info. For both directions the parser writes the recipient count into Mail.RecipientCount, the message size in bytes into Mail.Size, the session duration (HH:MM:SS) into Session.Duration, the session status into Mail.Status and the queue ID into Mail.QueueID. If you have searches or reports that look for these lines under Mail Info, update them. - Authentication lines (Service.Name ending in
.auth, for examplepop3.auth) used to appear as Application / Mail / Info with all details in Event.Note. A line withResult=1now appears as Identity / User / Login (severity information) and a line withResult=0appears as Identity / User / Deny (severity warning). Other result values stay under Application / Mail / Info. The protocol in brackets goes into Protocol.Name, the result number into Authentication.Status and the method number into Authentication.Method. The user goes into Source.UserName and Source.Domain. Logsign USO writes Protocol.Name in upper case, so[Control]appears asCONTROL. - Login policy lines (
Login policy [...] - increased failed login count to Nandcleared failed login count) appear as Identity / User / Info. The protocol goes into Protocol.Name, the user into Source.UserName and Source.Domain, and for an increase the new counter value goes into Event.Count. A single counter step is not classified as a brute force attack. If you want an alert for repeated failed logins, build an alert rule on Event.Count. - For SMTP reply lines such as
>>> 550 5.7.1 ..., the enhanced status code (5.7.1) goes into Mail.StatusCode. Mail.ReplyCode still holds the three-digit reply code and the event class does not change. - Anti-spam verdict lines also carry the recipient count in Mail.RecipientCount. Active Directory synchronization lines (Service.Name
control.adsync,Synchronizing domain ...) carry the operation in Operation.Name and the domain in Object.Name. Their event class does not change. - The session summary, authentication, login policy and domain synchronization fields above are parsed only from IceWarp 13+ lines, where the thread ID in brackets after the source tag matches the thread in the syslog header. Lines in the older format without this thread ID keep their previous result. SpamAssassin, Bayes and body check scores are not split into separate fields. They stay in Block.Reason.
- Mail.MessageID holds the IceWarp thread ID, not the message ID of the e-mail. The anti-spam, anti-virus and session summary message ID is in Mail.QueueID.
- The BSD syslog timestamp has no year and no time zone. Set the IceWarp server clock to the same time zone as Logsign USO so that Time.Generated is correct.
Verification
- In Logsign USO, open Settings > Data Collection and confirm that the IceWarp Messaging Server source is receiving data.
- Send a test e-mail through IceWarp. In Logsign USO, go to Search and look for events with Vendor IceWarp and Product Messaging Server. Check that Mail.FROM holds the sender and Mail.TO holds the recipient. On IceWarp 13 and later, the session summary of the test e-mail should appear as Application / Mail / Send or Receive and carry Mail.Size and Session.Duration.
- If anti-spam is active, look for events with Service.Name smtp.antispam. They should carry Threat.Score and Block.Reason.
- If anti-virus is active, look for events with Service.Name smtp.antivirus. They should appear as Security / Virus / Scan and carry Mail.QueueID and Mail.AttachSize.
- Log in to a mailbox over POP3 or IMAP. Look for an event with Service.Name pop3.auth. It should appear as Identity / User / Login and carry Protocol.Name and Source.UserName.
- If the source is receiving data but no events show Vendor IceWarp, check that the messages are not changed by a relay and that the syslog header is present.