You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SQL_DOMAINS=$(mysql --socket=/var/run/mysqld/mysqld.sock -u ${DBUSER} -p${DBPASS}${DBNAME} -e "SELECT domain FROM domain WHERE backupmx=0 and active=1" -Bs)
234
+
SQL_DOMAINS=$(mariadb --skip-ssl --socket=/var/run/mysqld/mysqld.sock -u ${DBUSER} -p${DBPASS}${DBNAME} -e "SELECT domain FROM domain WHERE backupmx=0 and active=1" -Bs)
235
235
if [[ !$?-eq 0 ]];then
236
236
log_f "Failed to read SQL domains, retrying in 1 minute..."
Copy file name to clipboardExpand all lines: data/Dockerfiles/dovecot/clean_q_aged.sh
+2-2
Original file line number
Diff line number
Diff line change
@@ -15,6 +15,6 @@ if ! [[ ${MAX_AGE} =~ ${NUM_REGEXP} ]] ; then
15
15
exit 1
16
16
fi
17
17
18
-
TO_DELETE=$(mysql --socket=/var/run/mysqld/mysqld.sock -u ${DBUSER} -p${DBPASS}${DBNAME} -e "SELECT COUNT(id) FROM quarantine WHERE created < NOW() - INTERVAL ${MAX_AGE//[!0-9]/} DAY" -BN)
19
-
mysql --socket=/var/run/mysqld/mysqld.sock -u ${DBUSER} -p${DBPASS}${DBNAME} -e "DELETE FROM quarantine WHERE created < NOW() - INTERVAL ${MAX_AGE//[!0-9]/} DAY"
18
+
TO_DELETE=$(mariadb --skip-ssl --socket=/var/run/mysqld/mysqld.sock -u ${DBUSER} -p${DBPASS}${DBNAME} -e "SELECT COUNT(id) FROM quarantine WHERE created < NOW() - INTERVAL ${MAX_AGE//[!0-9]/} DAY" -BN)
19
+
mariadb --skip-ssl --socket=/var/run/mysqld/mysqld.sock -u ${DBUSER} -p${DBPASS}${DBNAME} -e "DELETE FROM quarantine WHERE created < NOW() - INTERVAL ${MAX_AGE//[!0-9]/} DAY"
20
20
echo"Deleted ${TO_DELETE} items from quarantine table (max age is ${MAX_AGE//[!0-9]/} days)"
-- app passwords are only available for imap, smtp, sieve and pop3 when using sasl
172
-
if req.service == "smtp" or req.service == "imap" or req.service == "sieve" or req.service == "pop3" then
173
-
local cur,errorString = con:execute(string.format([[SELECT app_passwd.id, %s_access AS has_prot_access, app_passwd.password FROM app_passwd
174
-
INNER JOIN mailbox ON mailbox.username = app_passwd.mailbox
175
-
WHERE mailbox = '%s'
176
-
AND app_passwd.active = '1'
177
-
AND mailbox.active = '1'
178
-
AND app_passwd.domain IN (SELECT domain FROM domain WHERE domain='%s' AND active='1')]], con:escape(req.service), con:escape(req.user), con:escape(req.domain)))
179
-
local row = cur:fetch ({}, "a")
180
-
while row do
181
-
if req.password_verify(req, row.password, pass) == 1 then
182
-
-- if password is valid and protocol access is 1 OR real_rip matches SOGo, proceed
183
-
if tostring(req.real_rip) == "__IPV4_SOGO__" then
184
-
cur:close()
185
-
con:close()
186
-
return dovecot.auth.PASSDB_RESULT_OK, ""
187
-
elseif row.has_prot_access == "1" then
188
-
con:execute(string.format([[REPLACE INTO sasl_log (service, app_password, username, real_rip)
0 commit comments