Email fails to send most time

Your software
My Mautic version is: 4.4.7
My PHP version is: 7.4.3-4ubuntu2.18
My Database type and version is:

Your problem
My problem is:
Hi,

I have an issue with my Mautic as it fails to send emails most times. Previously, I had sent emails in the past which were successfully sent. Some other segments sent emails (it reads success), but don’t deliver to the recipient.

How can I resolve this?

These errors are showing in the log:

You mention errors in the log. Please share the errors from the log.

Here are the logs

[2023-08-08 01:28:06] mautic.CRITICAL: Uncaught PHP Exception Doctrine\DBAL\Exception\DriverException: “An exception occurred while executing ‘INSERT INTO maleads (is_published, date_added, created_by, created_by_user, date_modified, modified_by, modified_by_user, checked_out, checked_out_by, checked_out_by_user, points, last_active, internal, social_cache, date_identified, preferred_profile_image, title, firstname, lastname, company, position, email, phone, mobile, address1, address2, city, state, zipcode, timezone, country, owner_id, stage_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)’ with params [1, “2023-08-08 01:28:06”, null, null, null, null, null, null, null, null, 0, null, “a:0:{}”, “a:0:{}”, null, “gravatar”, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null]: Failed to read auto-increment value from storage engine” at /var/www/mautic/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php line 128 {“exception”:“[object] (Doctrine\DBAL\Exception\DriverException(code: 0): An exception occurred while executing ‘INSERT INTO maleads (is_published, date_added, created_by, created_by_user, date_modified, modified_by, modified_by_user, checked_out, checked_out_by, checked_out_by_user, points, last_active, internal, social_cache, date_identified, preferred_profile_image, title, firstname, lastname, company, position, email, phone, mobile, address1, address2, city, state, zipcode, timezone, country, owner_id, stage_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)’ with params [1, "2023-08-08 01:28:06", null, null, null, null, null, null, null, null, 0, null, "a:0:{}", "a:0:{}", null, "gravatar", null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null]:\n\nFailed to read auto-increment value from storage engine at /var/www/mautic/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php:128, Doctrine\DBAL\Driver\Mysqli\Exception\StatementError(code: 0): Failed to read auto-increment value from storage engine at /var/www/mautic/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/Mysqli/Exception/StatementError.php:21)”} {“hostname”:“mautic”,“pid”:158517}
[2023-08-08 01:38:09] mautic.NOTICE: PHP Notice - SessionHandler::gc(): ps_files_cleanup_dir: opendir(/var/lib/php/sessions) failed: Permission denied (13) - in file /var/www/mautic/vendor/symfony/http-foundation/Session/Storage/Handler/StrictSessionHandler.php - at line 106 {“maxlifetime”:1440} {“hostname”:“mautic”,“pid”:158516}
[2023-08-08 02:22:24] mautic.NOTICE: PHP Notice - SessionHandler::gc(): ps_files_cleanup_dir: opendir(/var/lib/php/sessions) failed: Permission denied (13) - in file /var/www/mautic/vendor/symfony/http-foundation/Session/Storage/Handler/StrictSessionHandler.php - at line 106 {“maxlifetime”:1440} {“hostname”:“mautic”,“pid”:158518}
[2023-08-08 02:35:28] mautic.NOTICE: PHP Notice - SessionHandler::gc(): ps_files_cleanup_dir: opendir(/var/lib/php/sessions) failed: Permission denied (13) - in file /var/www/mautic/vendor/symfony/http-foundation/Session/Storage/Handler/StrictSessionHandler.php - at line 106 {“maxlifetime”:1440} {“hostname”:“mautic”,“pid”:158517}
[2023-08-08 04:27:05] mautic.NOTICE: PHP Notice - SessionHandler::gc(): ps_files_cleanup_dir: opendir(/var/lib/php/sessions) failed: Permission denied (13) - in file /var/www/mautic/vendor/symfony/http-foundation/Session/Storage/Handler/StrictSessionHandler.php - at line 106 {“maxlifetime”:1440} {“hostname”:“mautic”,“pid”:158518}
[2023-08-08 04:28:05] mautic.NOTICE: PHP Notice - SessionHandler::gc(): ps_files_cleanup_dir: opendir(/var/lib/php/sessions) failed: Permission denied (13) - in file /var/www/mautic/vendor/symfony/http-foundation/Session/Storage/Handler/StrictSessionHandler.php - at line 106 {“maxlifetime”:1440} {“hostname”:“mautic”,“pid”:158515}
[2023-08-08 05:22:23] mautic.NOTICE: PHP Notice - SessionHandler::gc(): ps_files_cleanup_dir: opendir(/var/lib/php/sessions) failed: Permission denied (13) - in file /var/www/mautic/vendor/symfony/http-foundation/Session/Storage/Handler/StrictSessionHandler.php - at line 106 {“maxlifetime”:1440} {“hostname”:“mautic”,“pid”:158518}
[2023-08-08 14:14:42] mautic.ERROR: [MAIL ERROR] Expected response code 250 but got code “530”, with message "530 From/Sender name is not valid " Log data: ++ Starting Swift_Transport_EsmtpTransport << 220 postal.lusquan6.com ESMTP Postal/SARCUL >> EHLO mautic.lusquan23.com << 250-My capabilities are 250 AUTH CRAM-MD5 PLAIN LOGIN >> AUTH LOGIN << 334 VXNlcm5hbWU6 >> SWJla3dlRA== << 334 UGFzc3dvcmQ6 >> MTlmV0Q1WFNobGl4ZXc0SkZEbElEbzZR << 235 Granted for lusquan-b-v/postal-lusquan6-com ++ Swift_Transport_EsmtpTransport started >> MAIL FROM: << 250 OK >> RCPT TO: << 250 OK >> DATA << 354 Go ahead >> . << 530 From/Sender name is not valid !! Expected response code 250 but got code “530”, with message "530 From/Sender name is not valid " (code: 530) Log data: ++ Starting Swift_Transport_EsmtpTransport << 220 postal.lusquan6.com ESMTP Postal/SARCUL >> EHLO mautic.lusquan23.com << 250-My capabilities are 250 AUTH CRAM-MD5 PLAIN LOGIN >> AUTH LOGIN << 334 VXNlcm5hbWU6 >> SWJla3dlRA== << 334 UGFzc3dvcmQ6 >> MTlmV0Q1WFNobGl4ZXc0SkZEbElEbzZR << 235 Granted for lusquan-b-v/postal-lusquan6-com ++ Swift_Transport_EsmtpTransport started >> MAIL FROM: << 250 OK >> RCPT TO: << 250 OK >> DATA << 354 Go ahead >> . << 530 From/Sender name is not valid !! Expected response code 250 but got code “530”, with message "530 From/Sender name is not valid " (code: 530) !! Expected response code 250 but got code “530”, with message “530 From/Sender name is not valid " Log data: ++ Starting Swift_Transport_EsmtpTransport << 220 postal.lusquan6.com ESMTP Postal/SARCUL >> EHLO mautic.lusquan23.com << 250-My capabilities are 250 AUTH CRAM-MD5 PLAIN LOGIN >> AUTH LOGIN << 334 VXNlcm5hbWU6 >> SWJla3dlRA== << 334 UGFzc3dvcmQ6 >> MTlmV0Q1WFNobGl4ZXc0SkZEbElEbzZR << 235 Granted for lusquan-b-v/postal-lusquan6-com ++ Swift_Transport_EsmtpTransport started >> MAIL FROM: << 250 OK >> RCPT TO: << 250 OK >> DATA << 354 Go ahead >> . << 530 From/Sender name is not valid !! Expected response code 250 but got code “530”, with message “530 From/Sender name is not valid " (code: 530) (code: 530) (send); dokuwa@lusquan.com {“exception”:”[object] (Swift_TransportException(code: 530): Expected response code 250 but got code "530", with message "530 From/Sender name is not valid\r\n"\nLog data:\n++ Starting Swift_Transport_EsmtpTransport\n<< 220 postal.lusquan6.com ESMTP Postal/SARCUL\r\n\n>> EHLO mautic.lusquan23.com\r\n\n<< 250-My capabilities are\r\n250 AUTH CRAM-MD5 PLAIN LOGIN\r\n\n>> AUTH LOGIN\r\n\n<< 334 VXNlcm5hbWU6\r\n\n>> SWJla3dlRA==\r\n\n<< 334 UGFzc3dvcmQ6\r\n\n>> MTlmV0Q1WFNobGl4ZXc0SkZEbElEbzZR\r\n\n<< 235 Granted for lusquan-b-v/postal-lusquan6-com\r\n\n++ Swift_Transport_EsmtpTransport started\n>> MAIL FROM:\r\n\n<< 250 OK\r\n\n>> RCPT TO:\r\n\n<< 250 OK\r\n\n>> DATA\r\n\n<< 354 Go ahead\r\n\n>> \r\n.\r\n\n<< 530 From/Sender name is not valid\r\n\n!! Expected response code 250 but got code "530", with message "530 From/Sender name is not valid\r\n" (code: 530)\nLog data:\n++ Starting Swift_Transport_EsmtpTransport\n<< 220 postal.lusquan6.com ESMTP Postal/SARCUL\r\n\n>> EHLO mautic.lusquan23.com\r\n\n<< 250-My capabilities are\r\n250 AUTH CRAM-MD5 PLAIN LOGIN\r\n\n>> AUTH LOGIN\r\n\n<< 334 VXNlcm5hbWU6\r\n\n>> SWJla3dlRA==\r\n\n<< 334 UGFzc3dvcmQ6\r\n\n>> MTlmV0Q1WFNobGl4ZXc0SkZEbElEbzZR\r\n\n<< 235 Granted for lusquan-b-v/postal-lusquan6-com\r\n\n++ Swift_Transport_EsmtpTransport started\n>> MAIL FROM:\r\n\n<< 250 OK\r\n\n>> RCPT TO:\r\n\n<< 250 OK\r\n\n>> DATA\r\n\n<< 354 Go ahead\r\n\n>> \r\n.\r\n\n<< 530 From/Sender name is not valid\r\n\n!! Expected response code 250 but got code "530", with message "530 From/Sender name is not valid\r\n" (code: 530)\n!! Expected response code 250 but got code "530", with message "530 From/Sender name is not valid\r\n"\nLog data:\n++ Starting Swift_Transport_EsmtpTransport\n<< 220 postal.lusquan6.com ESMTP Postal/SARCUL\r\n\n>> EHLO mautic.lusquan23.com\r\n\n<< 250-My capabilities are\r\n250 AUTH CRAM-MD5 PLAIN LOGIN\r\n\n>> AUTH LOGIN\r\n\n<< 334 VXNlcm5hbWU6\r\n\n>> SWJla3dlRA==\r\n\n<< 334 UGFzc3dvcmQ6\r\n\n>> MTlmV0Q1WFNobGl4ZXc0SkZEbElEbzZR\r\n\n<< 235 Granted for lusquan-b-v/postal-lusquan6-com\r\n\n++ Swift_Transport_EsmtpTransport started\n>> MAIL FROM:\r\n\n<< 250 OK\r\n\n>> RCPT TO:\r\n\n<< 250 OK\r\n\n>> DATA\r\n\n<< 354 Go ahead\r\n\n>> \r\n.\r\n\n<< 530 From/Sender name is not valid\r\n\n!! Expected response code 250 but got code "530", with message "530 From/Sender name is not valid\r\n" (code: 530) (code: 530) at /var/www/mautic/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/LoggerPlugin.php:124)”} {“hostname”:“mautic”,“pid”:162877}
[2023-08-08 14:17:33] mautic.ERROR: [MAIL ERROR] Expected response code 250 but got code “530”, with message "530 From/Sender name is not valid " Log data: ++ Starting Swift_Transport_EsmtpTransport << 220 postal.lusquan6.com ESMTP Postal/XS7UIP >> EHLO mautic.lusquan23.com << 250-My capabilities are 250 AUTH CRAM-MD5 PLAIN LOGIN >> AUTH LOGIN << 334 VXNlcm5hbWU6 >> SWJla3dlRA== << 334 UGFzc3dvcmQ6 >> MTlmV0Q1WFNobGl4ZXc0SkZEbElEbzZR << 235 Granted for lusquan-b-v/postal-lusquan6-com ++ Swift_Transport_EsmtpTransport started >> MAIL FROM: << 250 OK >> RCPT TO: << 250 OK >> DATA << 354 Go ahead >> . << 530 From/Sender name is not valid !! Expected response code 250 but got code “530”, with message "530 From/Sender name is not valid " (code: 530) Log data: ++ Starting Swift_Transport_EsmtpTransport << 220 postal.lusquan6.com ESMTP Postal/XS7UIP >> EHLO mautic.lusquan23.com << 250-My capabilities are 250 AUTH CRAM-MD5 PLAIN LOGIN >> AUTH LOGIN << 334 VXNlcm5hbWU6 >> SWJla3dlRA== << 334 UGFzc3dvcmQ6 >> MTlmV0Q1WFNobGl4ZXc0SkZEbElEbzZR << 235 Granted for lusquan-b-v/postal-lusquan6-com ++ Swift_Transport_EsmtpTransport started >> MAIL FROM: << 250 OK >> RCPT TO: << 250 OK >> DATA << 354 Go ahead >> . << 530 From/Sender name is not valid !! Expected response code 250 but got code “530”, with message "530 From/Sender name is not valid " (code: 530) !! Expected response code 250 but got code “530”, with message “530 From/Sender name is not valid " Log data: ++ Starting Swift_Transport_EsmtpTransport << 220 postal.lusquan6.com ESMTP Postal/XS7UIP >> EHLO mautic.lusquan23.com << 250-My capabilities are 250 AUTH CRAM-MD5 PLAIN LOGIN >> AUTH LOGIN << 334 VXNlcm5hbWU6 >> SWJla3dlRA== << 334 UGFzc3dvcmQ6 >> MTlmV0Q1WFNobGl4ZXc0SkZEbElEbzZR << 235 Granted for lusquan-b-v/postal-lusquan6-com ++ Swift_Transport_EsmtpTransport started >> MAIL FROM: << 250 OK >> RCPT TO: << 250 OK >> DATA << 354 Go ahead >> . << 530 From/Sender name is not valid !! Expected response code 250 but got code “530”, with message “530 From/Sender name is not valid " (code: 530) (code: 530) (send); david.c@lusquan.com {“exception”:”[object] (Swift_TransportException(code: 530): Expected response code 250 but got code "530", with message "530 From/Sender name is not valid\r\n"\nLog data:\n++ Starting Swift_Transport_EsmtpTransport\n<< 220 postal.lusquan6.com ESMTP Postal/XS7UIP\r\n\n>> EHLO mautic.lusquan23.com\r\n\n<< 250-My capabilities are\r\n250 AUTH CRAM-MD5 PLAIN LOGIN\r\n\n>> AUTH LOGIN\r\n\n<< 334 VXNlcm5hbWU6\r\n\n>> SWJla3dlRA==\r\n\n<< 334 UGFzc3dvcmQ6\r\n\n>> MTlmV0Q1WFNobGl4ZXc0SkZEbElEbzZR\r\n\n<< 235 Granted for lusquan-b-v/postal-lusquan6-com\r\n\n++ Swift_Transport_EsmtpTransport started\n>> MAIL FROM:\r\n\n<< 250 OK\r\n\n>> RCPT TO:\r\n\n<< 250 OK\r\n\n>> DATA\r\n\n<< 354 Go ahead\r\n\n>> \r\n.\r\n\n<< 530 From/Sender name is not valid\r\n\n!! Expected response code 250 but got code "530", with message "530 From/Sender name is not valid\r\n" (code: 530)\nLog data:\n++ Starting Swift_Transport_EsmtpTransport\n<< 220 postal.lusquan6.com ESMTP Postal/XS7UIP\r\n\n>> EHLO mautic.lusquan23.com\r\n\n<< 250-My capabilities are\r\n250 AUTH CRAM-MD5 PLAIN LOGIN\r\n\n>> AUTH LOGIN\r\n\n<< 334 VXNlcm5hbWU6\r\n\n>> SWJla3dlRA==\r\n\n<< 334 UGFzc3dvcmQ6\r\n\n>> MTlmV0Q1WFNobGl4ZXc0SkZEbElEbzZR\r\n\n<< 235 Granted for lusquan-b-v/postal-lusquan6-com\r\n\n++ Swift_Transport_EsmtpTransport started\n>> MAIL FROM:\r\n\n<< 250 OK\r\n\n>> RCPT TO:\r\n\n<< 250 OK\r\n\n>> DATA\r\n\n<< 354 Go ahead\r\n\n>> \r\n.\r\n\n<< 530 From/Sender name is not valid\r\n\n!! Expected response code 250 but got code "530", with message "530 From/Sender name is not valid\r\n" (code: 530)\n!! Expected response code 250 but got code "530", with message "530 From/Sender name is not valid\r\n"\nLog data:\n++ Starting Swift_Transport_EsmtpTransport\n<< 220 postal.lusquan6.com ESMTP Postal/XS7UIP\r\n\n>> EHLO mautic.lusquan23.com\r\n\n<< 250-My capabilities are\r\n250 AUTH CRAM-MD5 PLAIN LOGIN\r\n\n>> AUTH LOGIN\r\n\n<< 334 VXNlcm5hbWU6\r\n\n>> SWJla3dlRA==\r\n\n<< 334 UGFzc3dvcmQ6\r\n\n>> MTlmV0Q1WFNobGl4ZXc0SkZEbElEbzZR\r\n\n<< 235 Granted for lusquan-b-v/postal-lusquan6-com\r\n\n++ Swift_Transport_EsmtpTransport started\n>> MAIL FROM:\r\n\n<< 250 OK\r\n\n>> RCPT TO:\r\n\n<< 250 OK\r\n\n>> DATA\r\n\n<< 354 Go ahead\r\n\n>> \r\n.\r\n\n<< 530 From/Sender name is not valid\r\n\n!! Expected response code 250 but got code "530", with message "530 From/Sender name is not valid\r\n" (code: 530) (code: 530) at /var/www/mautic/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/LoggerPlugin.php:124)”} {“hostname”:“mautic”,“pid”:158516}
[2023-08-08 14:17:33] mautic.ERROR: [MAIL ERROR] Expected response code 250 but got code “530”, with message "530 From/Sender name is not valid " Log data: >> MAIL FROM: << 250 OK >> RCPT TO: << 250 OK >> DATA << 354 Go ahead >> . << 530 From/Sender name is not valid !! Expected response code 250 but got code “530”, with message "530 From/Sender name is not valid " (code: 530) Log data: >> MAIL FROM: << 250 OK >> RCPT TO: << 250 OK >> DATA << 354 Go ahead >> . << 530 From/Sender name is not valid !! Expected response code 250 but got code “530”, with message "530 From/Sender name is not valid " (code: 530) !! Expected response code 250 but got code “530”, with message “530 From/Sender name is not valid " Log data: >> MAIL FROM: << 250 OK >> RCPT TO: << 250 OK >> DATA << 354 Go ahead >> . << 530 From/Sender name is not valid !! Expected response code 250 but got code “530”, with message “530 From/Sender name is not valid " (code: 530) (code: 530) (send); dokuwa@lusquan.com {“exception”:”[object] (Swift_TransportException(code: 530): Expected response code 250 but got code "530", with message "530 From/Sender name is not valid\r\n"\nLog data:\n>> MAIL FROM:\r\n\n<< 250 OK\r\n\n>> RCPT TO:\r\n\n<< 250 OK\r\n\n>> DATA\r\n\n<< 354 Go ahead\r\n\n>> \r\n.\r\n\n<< 530 From/Sender name is not valid\r\n\n!! Expected response code 250 but got code "530", with message "530 From/Sender name is not valid\r\n" (code: 530)\nLog data:\n>> MAIL FROM:\r\n\n<< 250 OK\r\n\n>> RCPT TO:\r\n\n<< 250 OK\r\n\n>> DATA\r\n\n<< 354 Go ahead\r\n\n>> \r\n.\r\n\n<< 530 From/Sender name is not valid\r\n\n!! Expected response code 250 but got code "530", with message "530 From/Sender name is not valid\r\n" (code: 530)\n!! Expected response code 250 but got code "530", with message "530 From/Sender name is not valid\r\n"\nLog data:\n>> MAIL FROM:\r\n\n<< 250 OK\r\n\n>> RCPT TO:\r\n\n<< 250 OK\r\n\n>> DATA\r\n\n<< 354 Go ahead\r\n\n>> \r\n.\r\n\n<< 530 From/Sender name is not valid\r\n\n!! Expected response code 250 but got code "530", with message "530 From/Sender name is not valid\r\n" (code: 530) (code: 530) at /var/www/mautic/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/LoggerPlugin.php:124)”} {“hostname”:“mautic”,“pid”:158516}

Do you have special characters (@, ;, &, ?) etc in the sender name?

No, there are no special characters. The mail used to deliver at some point then stopped (though not to all segments)

I will crosscheck the contacts in the segment

“From/Sender name is not valid.” This error is coming from the email server you’re using (postal.lusquan6.com) so the issue may not lie with mautic.

Okay. I will probably check the server config settings