TECHZEN Zenoss User Community ARCHIVE  

Zenoss 6.1.0 Zenmail daemon not creating events

Subject: Zenoss 6.1.0 Zenmail daemon not creating events
Author: Joan Arbona
Posted: 2018-05-23 07:35

Hello all,

We have an installation of Zenoss Core 6.1.0 and I am trying to configure Zenmail events so when I write an email to Zenoss SMTP's server it gets reflected as a new event. We have our corporative mail server configured to redirect all messages with a given destination (zenoss@zenoss...) to Zenoss SMTP's server.

The problem is that, although messages get recieved in ZenMail, then they do not appear as events in Zenoss event console. I know that ZenMail recieves the e-mails because zenmail.log shows e-mails like the following:

2018-05-23 11:16:58,319 INFO zen.zenmail: to: zenoss@zenoss.uib.es
2018-05-23 11:16:58,335 INFO zen.zenmail: Relayed (or sent directly) from: 10.80.82.41
2018-05-23 11:16:58,338 INFO zen.zenmail: Message data completed ['Received: by balitx.uib.es from 10.80.82.41 with ESMTP ;\n Wed, 23 May 2018 11:16:58 +0000', 'Received: from sm1.nges.uib.es (unknown [192.168.41.40])', '\tby esvaout1.sbl.uib.es (Postfix) with SMTP id 81919286F7', '\tfor <zenoss@uib.es>; Wed, 23 May 2018 12:57:59 +0200 (CEST)', 'Date: Wed, 23 May 2018 12:57:59 +0200', 'From: zenoss@panell-estats.sint.uib.es', 'To: zenoss@uib.es', 'Subject: Actualitza Estats Panell error', 'Message-ID: <5b054937.ynx3lxZFSsbzdd4l%zenoss@panell-estats.sint.uib.es>', 'User-Agent: Heirloom mailx 12.4 7/29/08', 'MIME-Version: 1.0', 'Content-Type: text/plain; charset=us-ascii', 'Content-Transfer-Encoding: 7bit', 'X-CTI-MailScanner-ESVA-Information: Please contact for more information', 'X-CTI-MailScanner-ESVA-ID: 81919286F7.A9E9F', 'X-CTI-MailScanner-ESVA: Found to be clean', 'X-CTI-MailScanner-ESVA-From: zenoss@panell-estats.sint.uib.es', 'X-Spam-Status: No', '', 'Actualitza Estats Panell ended successfully. Code 0'].

I have tried with different e-mail clients, including the perl and python test scripts that the official guide( ZenMail) gives. None of them work. However, when sending e-mails with Thunderbird from my workstation, some of them eventually appear in event console!

On the other hand, when using our corporative server to relay e-mails to Zenoss SMTP's server, e-mails get deferred a long time before getting recieved. Also, when using mailx client, the following error appears, even though e-mail is received:
Unexpected EOF on SMTP connection
"/root/dead.letter" 0/0
. . . message not sent.
I don't know if it has something to do with the other issue.


Does anybody have any idea? I have no more clues to debug this trouble.

As I said, I am following the guide ZenMail. Furthermore, I have checked the following:

- E-mail fields are correct.
- ZenMail is running
- Checked DEBUG logs of ZenMail. Saw nothing weird.
- Checked that I can telnet to Zenoss SMTP's server (also sent e-mails with Telnet without getting events created either)


Thanks,
Joan

------------------------------
Joan Arbona
Universitat de les Illes Balears
------------------------------


Subject: RE: Zenoss 6.1.0 Zenmail daemon not creating events
Author: Joan Arbona
Posted: 2018-05-24 09:20

Problem solved.

Looking into the code I have found a bad code line. It's the line that parses the "from" field from e-mails. It's located in the file MailProcessor.py at function process(). It shows the following:

        pattern = re.compile(r'(.*) <(.*?)>$')
        match = pattern.match(fromAddr)
        fromAddr = match.group(2).split('@')[-1]


Re.compile does not match if, when writing the FROM field of the e-mails, it's not written with the format "Name of the person <name.surname@domain>. For example, it accepts "John Cobra <john.cobra[at]mit.ko>" but does not accept "john.cobra[at]mit.ko". If re.compile does not match, the variable match gets empty and gives an error in the third line (and no debug message appears).

This is different at Zenoss 4. The same rutine does not include this regex check:
       fromAddr = fromAddr.split('@')[1].rstrip('>')
       fromAddr = fromAddr.split(' ')[0]

Solution is, in consequence, to change the routine removing the regex check or write all FROM fields in the denoted format.

Cheers,
Joan.



------------------------------
Joan Arbona
Universitat de les Illes Balears
------------------------------


< Previous
2 error: "error getting driver status for path /opt/serviced/var/volumes" and " ...
  Next
Looking for a description of how the Zenoss Core source is organized
>