TLS port 25

master
ifiguero 2022-01-21 20:36:16 -03:00
parent 8a9f963e99
commit 77e9e0ab00
1 changed files with 27 additions and 4 deletions

View File

@ -47,13 +47,35 @@ async def enviarCorreosDominio(dominioid):
try:
conectado = False
try:
smtp = aiosmtplib.SMTP(hostname=str(dbdireccion.ipaddr), source_address=banner_hostname, port=465, use_tls=True, validate_certs=True, client_cert=certfile, client_key=keyfile, cert_bundle=cacerts, timeout=10)
smtp = aiosmtplib.SMTP(hostname=str(dbdireccion.ipaddr), source_address=banner_hostname, port=25, use_tls=True, start_tls=False, validate_certs=True, client_cert=certfile, client_key=keyfile, cert_bundle=cacerts, timeout=10)
await smtp.connect()
conectado = True
await log.debug('Conectado a USE_TLS: {}'.format(dbdireccion.ipaddr))
await log.debug('Conectado a USE_TLS: 25 {}'.format(dbdireccion.ipaddr))
except Exception as e:
conectado = False
await log.debug('Error al conectar al servidor use_tls: {}'.format(e))
await log.debug('Error al conectar al servidor use_tls 25: {}'.format(e))
if conectado == False:
try:
smtp = aiosmtplib.SMTP(hostname=str(dbdireccion.ipaddr), source_address=banner_hostname, port=25, start_tls=True, use_tls=False, validate_certs=True, client_cert=certfile, client_key=keyfile, cert_bundle=cacerts, timeout=10)
await smtp.connect()
await smtp.starttls()
conectado = True
await log.debug('Conectado a START_TLS: 25 {}'.format(dbdireccion.ipaddr))
except Exception as e:
conectado = False
await log.debug('Error al conectar al servidor start_tls 25: {}'.format(e))
if conectado == False:
try:
smtp = aiosmtplib.SMTP(hostname=str(dbdireccion.ipaddr), source_address=banner_hostname, port=465, use_tls=True, validate_certs=True, client_cert=certfile, client_key=keyfile, cert_bundle=cacerts, timeout=10)
await smtp.connect()
await smtp.starttls()
conectado = True
await log.debug('Conectado a START_TLS 456: {}'.format(dbdireccion.ipaddr))
except Exception as e:
conectado = False
await log.debug('Error al conectar al servidor start_tls 465: {}'.format(e))
if conectado == False:
try:
@ -64,7 +86,8 @@ async def enviarCorreosDominio(dominioid):
await log.debug('Conectado a START_TLS: {}'.format(dbdireccion.ipaddr))
except Exception as e:
conectado = False
await log.debug('Error al conectar al servidor start_tls: {}'.format(e))
await log.debug('Error al conectar al servidor start_tls 587: {}'.format(e))
if conectado == False:
try:
smtp = aiosmtplib.SMTP(hostname=str(dbdireccion.ipaddr), timeout=10)