master
ifiguero 2022-01-21 21:02:36 -03:00
parent 58be0599bf
commit c2ec57b09a
1 changed files with 3 additions and 6 deletions

View File

@ -47,9 +47,8 @@ async def enviarCorreosDominio(dominioid):
try:
conectado = False
try:
smtp = aiosmtplib.SMTP(hostname=str(dbdireccion.ipaddr), source_address=banner_hostname, port=25, start_tls=True, use_tls=False, validate_certs=False, client_cert=certfile, client_key=keyfile, cert_bundle=cacerts, timeout=10)
smtp = aiosmtplib.SMTP(hostname=str(dbdireccion.ipaddr), source_address=banner_hostname, port=25, start_tls=True, use_tls=False, validate_certs=False, 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:
@ -60,7 +59,6 @@ async def enviarCorreosDominio(dominioid):
try:
smtp = aiosmtplib.SMTP(hostname=str(dbdireccion.ipaddr), source_address=banner_hostname, port=465, use_tls=True, validate_certs=False, client_cert=certfile, client_key=keyfile, cert_bundle=cacerts, timeout=10)
await smtp.connect()
await smtp.starttls()
conectado = True
await log.debug('Conectado a USE_TLS 456: {}'.format(dbdireccion.ipaddr))
except Exception as e:
@ -69,11 +67,10 @@ async def enviarCorreosDominio(dominioid):
if conectado == False:
try:
smtp = aiosmtplib.SMTP(hostname=str(dbdireccion.ipaddr), source_address=banner_hostname, port=587, use_tls=True, validate_certs=False, client_cert=certfile, client_key=keyfile, cert_bundle=cacerts, timeout=10)
smtp = aiosmtplib.SMTP(hostname=str(dbdireccion.ipaddr), source_address=banner_hostname, port=587, start_tls=True, validate_certs=False, 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: {}'.format(dbdireccion.ipaddr))
await log.debug('Conectado a START_TLS 587: {}'.format(dbdireccion.ipaddr))
except Exception as e:
conectado = False
await log.debug('Error al conectar al servidor start_tls 587: {}'.format(e))