Skip to content

Commit

Permalink
Dovecot: changed mysql connector in quarantine.py
Browse files Browse the repository at this point in the history
  • Loading branch information
DerLinkman committed Dec 15, 2023
1 parent fbc07aa commit 5266424
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions data/Dockerfiles/dovecot/quarantine_notify.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import smtplib
import os
import sys
import mysql.connector
import MySQLdb
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from email.utils import COMMASPACE, formatdate
Expand Down Expand Up @@ -50,7 +50,7 @@
def query_mysql(query, headers = True, update = False):
while True:
try:
cnx = mysql.connector.connect(unix_socket = '/var/run/mysqld/mysqld.sock', user=os.environ.get('DBUSER'), passwd=os.environ.get('DBPASS'), database=os.environ.get('DBNAME'), charset="utf8mb4", collation="utf8mb4_general_ci")
cnx = MySQLdb.connect(user=os.environ.get('DBUSER'), password=os.environ.get('DBPASS'), database=os.environ.get('DBNAME'), charset="utf8mb4", collation="utf8mb4_general_ci")
except Exception as ex:
print('%s - trying again...' % (ex))
time.sleep(3)
Expand Down

0 comments on commit 5266424

Please sign in to comment.