What is the configuration to send email

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')