Email with report is not sended in the "sales" panel

Hi,

When I use the “email” button to send a report in the “sales” panel, the email is sended only if I don’t check the “report” checkbox. If I do so, nothing is sended. I suppose the purpose of this check box is to send the report as an attachnment. Any Idea to explain this behaviour?

The report can be printed and looks configured properly.

Thks for your help

I guess there is an error when the server needs to render the report attached.
You should check the server logs. Normally such error should be reported by the client (which one?).

You’re right, sorry. I had checked /var/log/tryton.log but the error was in fact documented in /var/log/daemon.log. I have to look in my gandi config then.

Jan 20 12:38:06 sda-tryton trytond[30739]: convert /tmp/trytond_onwulwkr/sale.sale.odt -> /tmp/trytond_onwulwkr/sale.sale.pdf using filter : writer_pdf_Export
Jan 20 12:38:07 sda-tryton trytond[30739]: 30739 139886547957504 [2021-01-20 12:38:07,523] ERROR trytond.sendmail fail to send email
Jan 20 12:38:07 sda-tryton trytond[30739]: Traceback (most recent call last):
Jan 20 12:38:07 sda-tryton trytond[30739]:   File "/root/tryton/venv/lib/python3.7/site-packages/trytond/sendmail.py", line 39, in sendmail
Jan 20 12:38:07 sda-tryton trytond[30739]:     senderrs = server.sendmail(from_addr, to_addrs, msg.as_string())
Jan 20 12:38:07 sda-tryton trytond[30739]:   File "/usr/lib/python3.7/smtplib.py", line 888, in sendmail
Jan 20 12:38:07 sda-tryton trytond[30739]:     raise SMTPDataError(code, resp)
Jan 20 12:38:07 sda-tryton trytond[30739]: smtplib.SMTPDataError: (550, b'5.7.1  Reject for policy reason RULE3_2. See http://postmaster.gandi.net')
Jan 20 12:38:07 sda-tryton trytond[30739]: 30739 139886547957504 [2021-01-20 12:38:07,642] INFO werkzeug 192.168.0.1 - - [20/Jan/2021 12:38:07] "POST /luthierio/ HTTP/1.1" 200 -

UPDATE: It seems that the email with attachment is considered as a SPAM. If the solution may be usefull to other tryton user I’ll document it here.

Normally sending email error should be raised as error in the client. But here the problem is that the mail server is failing during the tpc_finish which can not raise error.
I strongly suggest to always use a local email server (like OpenSMTPD) as queue that will always accept Tryton emails before forwarding to the official mail server.

Most of the time when you are on Linux, you have already an MTA like postfix or sendmail running or installed. When you use postfix you just have to add a smarthost and it will do the rest for you.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.