# grep maild ossec.log
2018/02/08 10:20:41 ossec-maild: DEBUG: Starting ...
2018/02/08 10:20:41 ossec-maild: INFO: Chrooted to directory: /var/ossec
2018/02/08 10:25:56 ossec-maild: DEBUG: Starting ...
2018/02/08 10:25:56 ossec-maild: INFO: Chrooted to directory: /var/ossec
<global>
<email_notification>yes</email_notification>
<email_to>doug....@myco.com</email_to>
<smtp_server>mpismtp.myco.com</smtp_server>
<email_from>os...@myco.com</email_from>
</global>
[[snip]]
<alerts>
<log_alert_level>1</log_alert_level>
<email_alert_level>7</email_alert_level>
</alerts>
# netstat -an | grep :25
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN
stat("/etc/localtime", {st_mode=S_IFREG|0644, st_size=3519, ...}) = 0
read(3, "** Alert 1518104702.94473971: ma"..., 4096) = 639
stat("/etc/localtime", {st_mode=S_IFREG|0644, st_size=3519, ...}) = 0
read(3, "", 4096) = 0
select(0, NULL, NULL, NULL, {5, 0}) = 0 (Timeout)
read(3, "", 4096) = 0
select(0, NULL, NULL, NULL, {5, 0}) = 0 (Timeout)
stat("/etc/localtime", {st_mode=S_IFREG|0644, st_size=3519, ...}) = 0
read(3, "", 4096) = 0
select(0, NULL, NULL, NULL, {5, 0}) = 0 (Timeout)
read(3, "", 4096) = 0
select(0, NULL, NULL, NULL, {5, 0}) = 0 (Timeout)
read(3, "", 4096) = 0
select(0, NULL, NULL, NULL, {5, 0}) = 0 (Timeout)
read(3, "", 4096) = 0
select(0, NULL, NULL, NULL, {5, 0}) = 0 (Timeout)
read(3, "", 4096) = 0
select(0, NULL, NULL, NULL, {5, 0} <detached ...>
--
---
You received this message because you are subscribed to the Google Groups "ossec-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ossec-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Have you reviewed alerts.log to verify that at least one alert that exceeds your configured email alert threshold of 7 has been fired?
--
Have you tried running ossec-maild with multiple instances of -d? OS_RecvMailQ() uses debug2() and requires at least two -d param instances in order for the debug message to be emitted.
# ossec-maild -d -d
2018/02/09 09:26:54 ossec-maild: DEBUG: Starting ...
2018/02/09 08:01:51 ossec-syscheckd: INFO: Ending syscheck scan.
2018/02/09 09:26:54 ossec-maild: DEBUG: Starting ...
2018/02/09 09:26:54 ossec-maild: INFO: Chrooted to directory: /var/ossec
It may be helpful - if also time intensive - to compile that version of OSSEC from source while outputting symbols and then attach gdb to ossec-maild, setting one or more breakpoints to allow you to step through the mail logic like the call to OS_RecvMailQ at https://github.com/ossec/ossec-hids/blob/master/src/os_maild/os_maild_client.c#L18.- Nathan Buuck