Hi Matthias Appelmans,
Can you check if you have logs inside the /var/log/mailtest.log file?
I have tried to replicate this. In my case, it is working fine.
This is my file name
/var/log/mail.log
And this is my configuration:
<localfile>
<log_format>syslog</log_format>
<location>/var/log/mail.log</location>
</localfile>
If you have enabled the archive log. You can use this command to check if the logs are in the archive log
cat /var/ossec/logs/archives/archives.log | grep "/var/log/mailtest.log"
Let me know your findings on the issue.
Hi Matthias,
The configuration looks fine to me.
Can you check the file permission of the
/var/log/mailtest.log file?
Are there other logs inside the archive.log
tail /var/ossec/logs/archives/archives.log
Also, it's better to test the archive log for some sacrifice logs with cat command instead of tail. The archive log file is populated very fast by different log
cat /var/ossec/logs/archives/archives.log | grep "/var/log/mailtest.log"
Check if there is any relevant log inside the ossec.log
cat /var/ossec/logs/ossec.log | grep -i -E "error|warn"
cat /var/ossec/logs/ossec.log | grep -i -E "/var/log/mailtest.log"
can you share your whole ossec.conf file if possible.
Looking forward to your update on the issue.
Hi Matthias Appelmans,
I am glad that you have successfully forwarded your log.
Now, you can write some custom decoders and rules to trigger alerts on the Dashboard.
You can write separate rules for successful and failed events.
Check this document to get help with writing custom decoders and rules
After that, Based on filters you can query those alerts on Dashbaord.
Next, Create some Dashboards to visualize those events
https://documentation.wazuh.com/current/user-manual/wazuh-dashboard/creating-custom-dashboards.html
I hope this solves your issue.
Let me know if you need any further assistance.
Hi Matthias Appelmans,
If your only motive is to find out information about failed and successful mail
As you have mentioned earlier
DSN 2.0.0 means it's successful, 4.0.0 means it failed
This information is present in this log
Apr 19 08:44:19 debian postfix/smtp[3701]: 0B5C01031F6: to=<desti...@test.com>, relay=uit.telenet.be[1.1.1.1]:25, delay=0.3, delays=0.01/0.01/0.13/0.15, dsn=2.0.0, status=sent (250 2.0.0 Message accepted for delivery
You can simply write decoder and rules based on this format log only and ignore the other log
Apr 19 08:44:19 debian postfix/qmgr[1496]: 0B5C01031F6: from=<use...@telenet.be>, size=368, nrcpt=1 (queue active)
If you want to combine these two logs in one log. You have to write a custom script to manage two logs and save those logs in a separate file and use local-file option to read the logfile and forward it to Wazuh.
<localfile>
<location>/<FILE_PATH>/file.log</location>
<log_format>syslog</log_format>
</localfile>
I hope you find this helpful. Let me know if you need any further information.