What is the configuration to send email

En lo personal estoy siguiendo las indicaciones dadas y no logro obtener el envio de correos, por el contrario en el servidor cuando intento enviar un correo me arroja el siguiente error:

For me your email server is not accepting to relay the emails.

PS: Please do not use picture to show textual error message. It prevent indexing, searching and copy/pasting.

{‘correo@dominio.com’: (550, b’ Please turn on SMTP Authentication in your mail client. ([192.168.1.41])
[xxx.xxx.xx.xxx]:37002 is not permitted to relay through this server
without authentication.’)}

In your Tryton configuration file:

...
[email]                                                                                                                                                    
uri = smtp+tls://<username>:<password>@<your_fqdn_server>:587                                                                                                                         
from = <address>@<domain.ext>
...

as it says in the doc : Configuration file for Tryton — trytond latest documentation

Lo configure como me indicarón y funciono una vez, aunque llegó bastante retrasado.

Pero al intentar de nuevo, me llegó el siguiente mensaje al correo configurado para los envios:

namer@.co
all hosts for ‘univalle.edu.co’ have been failing for a long time (and retry time not reached)
Reporting-MTA: dns; atacama.lineadns.com

Hola Cristina,

Por lo que parece hay algun problema en el servidor SMPT y no se pueden mandar correo a univalle.edu.co
Debes revisar la configuración de tu correo ya que esto no esta relacionado con Tryton.

Buenos dias, estoy tratando con varias cuentas de correo, ejempo

[smtp]
uri = smtp+tls://jarestre@une.net.co:mipawwword@smtpmed.une.net.co:143
from = jarestre@une.net.co



[smtp]
uri = smtp+tls://agustin@tecnocarnes.com:mipasword@mail.tecnocarnes.com:587
from = agustin@tecnocarnes.com

y sin importar que configuracion ponga siempre me respode

Traceback (most recent call last):
  File "/trytond/wsgi.py", line 117, in dispatch_request
    return endpoint(request, **request.view_args)
  File "/trytond/protocols/dispatcher.py", line 47, in rpc
    return methods.get(request.rpc_method, _dispatch)(
  File "/trytond/wsgi.py", line 84, in auth_required
    return wrapped(*args, **kwargs)
  File "/trytond/protocols/wrappers.py", line 156, in wrapper
    return func(request, pool, *args, **kwargs)
  File "/trytond/protocols/dispatcher.py", line 204, in _dispatch
    transaction.commit()
  File "/trytond/transaction.py", line 224, in commit
    datamanager.tpc_vote(self)
  File "/trytond/sendmail.py", line 120, in tpc_vote
    self._server = get_smtp_server(self.uri, strict=self.strict)
  File "/trytond/sendmail.py", line 75, in get_smtp_server
    server = connector(uri.hostname, uri.port, **extra)
  File "/smtplib.py", line 255, in __init__
    (code, msg) = self.connect(host, port)
  File "/smtplib.py", line 339, in connect
    self.sock = self._get_socket(host, port, self.timeout)
  File "/smtplib.py", line 310, in _get_socket
    return socket.create_connection((host, port), timeout,
  File "/socket.py", line 808, in create_connection
    raise err
  File "/socket.py", line 796, in create_connection
    sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused

Fault: [Errno 111] Connection refused

Que puedo tener mal…

[smtp]
uri = smtp+tls://agustin@tecnocarnes.com:mipasword@mail.tecnocarnes.com:587
from = agustin@tecnocarnes.com

I think that the port number (:143) ist the problem.
According to a quick nmap scan, the server smtpmed.une.net.co listens on ports 25 and 465.

$ nmap smtpmed.une.net.co
Starting Nmap 7.80 ( https://nmap.org ) at 2021-12-05 07:19 CET
[...]
PORT    STATE SERVICE
25/tcp  open  smtp
465/tcp open  smtps

Your mailserver “smtpmed.une.net.co” accepts TLS on port 25.
You can do the following checks from your tryton server machine:

$ openssl s_client -connect smtpmed.une.net.co:25 -starttls smtp

When you can connect this way, then tryton should also be able to connect with
uri = [...]:25

Your second server “mail.tecnocarnes.com” should work on port 587 as expected.

If not, there may be some firewall-filtering between your tryton server and the mailservers.

Try to use smts and this format on conf file

[email]
uri = smtps://USER:PW@SMTP.SERVER:PORT
from = "My NAME :D" <user@email.com>

Change this one :stuck_out_tongue:

I hope it helps you :slight_smile:

1 Like

Me funciono con, Gracias por su apoyo

[email]
uri = smtps://cuenta@dominio.com:miclave@mail.dominio.com:465
from = Notificaciones Tryton <cuenta@dominio.com>
username=cuenta@dominio.com
password = miclave
1 Like

The username and password keys are not read from the server, you can remove them.
They should be included as part of the uri

I tried to set up my tryton in this structure, but could not make in work.

I found this test - but do not understand how it works:

When I just paste the command above into an activated pip-venv, I get no reaction - so I guess I should do anything else.

It seems it does nothing if I do not specify a database.

So for me for example the following is sending an e-mail to my e-mail address:

trytond-admin -c trytond.conf -d test --test-email my_email_address@domain.com

Thank you very much indeed. That makes it work - well, sort of…

In my trytond.conf now is:

[email]
uri = smtp+tls://my-email-username:my-email-password@my-smtp-server:25
from = "my-company" <my-email-address>

My working smtp config in my email client is:

"STARTTLS after connect"
authentification: plain text
port 25

Using the command trytond-admin -c trytond.conf -d my-database --test-email target-name@domain.de creates the error message:

File "/home/wd/tryton-60-prod2/bin/trytond-admin", line 23, in <module>
    admin.run(options)
  File "/home/wd/tryton-60-prod2/lib/python3.8/site-packages/trytond/admin.py", line 119, in run
    send_test_email(options.test_email)
  File "/home/wd/tryton-60-prod2/lib/python3.8/site-packages/trytond/sendmail.py", line 57, in send_test_email
    sendmail(
  File "/home/wd/tryton-60-prod2/lib/python3.8/site-packages/trytond/sendmail.py", line 30, in sendmail
    server = get_smtp_server(strict=strict)
  File "/home/wd/tryton-60-prod2/lib/python3.8/site-packages/trytond/sendmail.py", line 64, in get_smtp_server
    uri = parse_uri(uri)
  File "/home/wd/tryton-60-prod2/lib/python3.8/site-packages/trytond/config.py", line 45, in parse_uri
    return urllib.parse.urlparse(uri)
  File "/usr/lib/python3.8/urllib/parse.py", line 373, in urlparse
    splitresult = urlsplit(url, scheme, allow_fragments)
  File "/usr/lib/python3.8/urllib/parse.py", line 464, in urlsplit
    raise ValueError("Invalid IPv6 URL")
ValueError: Invalid IPv6 URL

Could somebody kindly decipher that for me?

Maybe you have some delimiter characters in your password that need to be url encoded?

Bingo!

I used https://meyerweb.com/eric/tools/dencoder/ to encode the password, that did the trick. (Off records: Of course you NEVER EVER put your crucial mail password into a online converter. NEVER EVER.)

Great man, thank you so much!

To get the compendium of errors completed… I tried another email account without special characters in the password and ran into:

File "/usr/lib/python3.8/ssl.py", line 1040, in _create
    self.do_handshake()
  File "/usr/lib/python3.8/ssl.py", line 1309, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLError: [SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1131)

What could that one be?

Cheers,
Wolf

A post was split to a new topic: Email from party

A post was split to a new topic: Hash email password

For the record:
Tryton already uses urllib, so you should not need to install anything.
I used the following for url encoding:

import urllib.parse
urllib.parse.quote('your  pasword string')