[Solved] Mailinglogger configuration options

Hi,

Where can i find more Informations about the Maillinglogger Options in the buildout.cfg?
This is what i have now configured:

# buildout.cfg
mailinglogger=
    <mailing-logger>
        level error
        flood-level 20
        smtp-server smtp.xxx.yz
        from webmaster@xxx.yz
        to me@xxx.yz
        subject xxx.yz [%(asctime)s] [%(hostname)s] %(line)s
    </mailing-logger>

I have looked in the Mailinglogger Docs , but the described Options are not the same. I need
the following Options to configure:

  • Port
  • Username
  • Password

Any hints?

If you are running postfix on localhost (using the Plone Ansible playbook) then the config above should 'just work' (TM) - it does for me at any rate.

I guess you are not, but if you consider doing that then it seems that you can set postfix relay to a mailserver elsewhere.

See https://github.com/plone/ansible-playbook/blob/d5bc4f394f4e9342afe67f5927169b66df091c1d/docs/mailserver.rst

I thought the library send the mail directly to the smtp server, not via a local mta.

Use the source Luke! This should show you the way:

Thanks, i have seen this. And I used the option smtp-server like:

<mailing-logger>
    level error
    flood-level 20
    smtp-server smtp.xxx.yz:587
    from user1@xxx.yz
    to user2@xxx.yz
    username user1@xxx.yz
    password *secret*
    subject [dev-local] [%(asctime)s] [%(hostname)s] %(line)s
</mailing-logger>

But this did not help. I searched and i found in the mailinglogger the issue for me.

I added three lines of code and all was fine. But i don't know is this a Bug or a misconfig of our SMTP Server :wink:

if self.username and self.password:
    smtp.ehlo()     # new
    smtp.starttls() # new
    smtp.ehlo()     # new
    smtp.login(self.username,self.password)

Well done!

As the author says in that mailinglogger issue you referred to:

Hmm, guess this is dead. I'm -0 is TLS support, not really sure a log handler should be connecting to anything other than a local MTA. Of course, if someone wants to rebase this, happy to re-open...

Maybe he's right, maybe not - but it woulda helped you

Plone Foundation Code of Conduct