From f11e55c343f9175e39e5c6d25b2509918912904e Mon Sep 17 00:00:00 2001 From: Clement Boirie Date: Mon, 26 Jan 2026 10:00:26 +0100 Subject: [PATCH] fix: update usage of `PHPMailerBMH` class --- inc/libs/php-bounce/class.phpmailer-bmh.php | 2 +- inc/utils/class.bounce.email.php | 20 ++++++++------------ 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/inc/libs/php-bounce/class.phpmailer-bmh.php b/inc/libs/php-bounce/class.phpmailer-bmh.php index 7eb065b..ac97b34 100644 --- a/inc/libs/php-bounce/class.phpmailer-bmh.php +++ b/inc/libs/php-bounce/class.phpmailer-bmh.php @@ -52,7 +52,7 @@ if (version_compare(PHP_VERSION, '8.0.0', '<=') ) { exit("Sorry, this version of Bounce Mail Handler will only run on PHP version 8.0.0 or greater!\n"); } -require_once(BEA_SENDER_DIR . '/inc/libs/php-bounce/' . 'phpmailer-bmh_rules.php'); +require_once(BEA_SENDER_DIR . '/inc/libs/php-bounce/phpmailer-bmh_rules.php'); class PHPMailerBMH { /* CONSTANTS */ diff --git a/inc/utils/class.bounce.email.php b/inc/utils/class.bounce.email.php index 9472e49..85e0cc7 100644 --- a/inc/utils/class.bounce.email.php +++ b/inc/utils/class.bounce.email.php @@ -1,5 +1,7 @@ bmh = new BounceMailHandler(); + $this->bmh = new PHPMailerBMH(); $this->log = new Bea_Log( WP_CONTENT_DIR.'/bea-sender-bounce-cron' ); } @@ -64,15 +66,15 @@ public function bounce_init() { // BHM setup $this->bmh->mailhost = $host['mailhost']; // your mail server - $this->bmh->mailbox_username = $host['mailbox_username']; + $this->bmh->mailboxUserName = $host['mailbox_username']; // your mailbox username - $this->bmh->mailbox_password = $host['mailbox_password']; + $this->bmh->mailboxPassword = $host['mailbox_password']; // your mailbox password $this->bmh->port = $host['port']; // the port to access your mailbox, default is 143 $this->bmh->service = $host['service']; // the service to use (imap or pop3), default is 'imap' - $this->bmh->service_option = $host['service_option']; + $this->bmh->serviceOption = $host['service_option']; // the service options (none, tls, notls, ssl, etc.), default is 'notls' $this->bmh->boxname = $host['boxname']; // the mailbox to access, default is 'INBOX' @@ -90,8 +92,8 @@ public function bounce_init() { // Log $this->log->log_this( 'Open the mailbox' ); - $this->bmh->openMailbox(); - $this->bmh->action_function = array( + $this->bmh->MailboxOpen(); + $this->bmh->actionFunction = array( $this, 'callback_action' ); @@ -99,12 +101,6 @@ public function bounce_init() { $this->log->log_this( 'Process mailbox' ); $this->bmh->processMailbox(); - - $this->log->log_this( 'Delete mailbox' ); - // Delete flag and do global deletes if true - $this->bmh->globalDelete(); - - $this->log->log_this( 'Process end' ); // Unlock the file self::unlock();