1letter
(Jan)
February 12, 2019, 9:48am
1
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:
Any hints?
djowett
(Djowett)
February 12, 2019, 11:38am
2
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
1letter
(Jan)
February 12, 2019, 5:31pm
3
I thought the library send the mail directly to the smtp server, not via a local mta.
djowett
(Djowett)
February 13, 2019, 8:05pm
4
Use the source Luke! This should show you the way:
1letter
(Jan)
February 15, 2019, 4:57pm
5
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.
email[header]=value
email['Subject']=self.getSubject(record)
email['From']=self.fromaddr
email['To']=', '.join(self.toaddrs)
email['X-Mailer']=x_mailer
email['X-Log-Level']=record.levelname
email['Date']=formatdate()
email['Message-ID']=make_msgid('MailingLogger')
smtp = smtplib.SMTP(self.mailhost, self.mailport)
if self.username and self.password:
smtp.login(self.username,self.password)
smtp.sendmail(self.fromaddr, self.toaddrs, email.as_string())
smtp.quit()
except:
self.handleError(record)
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
if self.username and self.password:
smtp.ehlo() # new
smtp.starttls() # new
smtp.ehlo() # new
smtp.login(self.username,self.password)
djowett
(Djowett)
February 15, 2019, 8:41pm
6
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