The issue
Today, I migrated Flarum from one VPS to another. After the migration, I am unable to send emails normally. I can confirm that there is no issue with the email server and my local ports are fine as well. However, I'm currently unsure of the cause of this issue.
I can connect the smtp server correctly.
# telnet smtp.qiye.aliyun.com 465
Trying 47.246.64.75...
Connected to smtp.qiye.aliyun.com.
Escape character is '^]'.
The error log.
[2024-01-15 14:08:44] flarum.ERROR: Swift_TransportException: Connection could not be established with host smtp.qiye.aliyun.com :stream_socket_client(): SSL operation failed with code 1. OpenSSL Error messages:
error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed in /home/wwwroot/lnmp01/domain/www.nodeloc.com/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/StreamBuffer.php:261
Stack trace:
#0 [internal function]: Swift_Transport_StreamBuffer->{closure}(2, 'stream_socket_c...', '/home/wwwroot/l...', 264)
#1 /home/wwwroot/lnmp01/domain/www.nodeloc.com/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/StreamBuffer.php(264): stream_socket_client('ssl://smtp.qiye...', 0, '', 30, 4, Resource id #1293)
#2 /home/wwwroot/lnmp01/domain/www.nodeloc.com/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/StreamBuffer.php(58): Swift_Transport_StreamBuffer->establishSocketConnection()
#3 /home/wwwroot/lnmp01/domain/www.nodeloc.com/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/AbstractSmtpTransport.php(143): Swift_Transport_StreamBuffer->initialize(Array)
#4 /home/wwwroot/lnmp01/domain/www.nodeloc.com/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mailer.php(65): Swift_Transport_AbstractSmtpTransport->start()
#5 /home/wwwroot/lnmp01/domain/www.nodeloc.com/vendor/illuminate/mail/Mailer.php(521): Swift_Mailer->send(Object(Swift_Message), Array)
#6 /home/wwwroot/lnmp01/domain/www.nodeloc.com/vendor/illuminate/mail/Mailer.php(288): Illuminate\Mail\Mailer->sendSwiftMessage(Object(Swift_Message))
#7 /home/wwwroot/lnmp01/domain/www.nodeloc.com/vendor/illuminate/mail/Mailer.php(200): Illuminate\Mail\Mailer->send(Object(Illuminate\Support\HtmlString), Array, Object(Closure))
#8 /home/wwwroot/lnmp01/domain/www.nodeloc.com/vendor/fof/pretty-mail/src/Overrides/NotificationMailer.php(111): Illuminate\Mail\Mailer->html('<html>\n <hea...', Object(Closure))
#9 /home/wwwroot/lnmp01/domain/www.nodeloc.com/vendor/flarum/core/src/Notification/Job/SendEmailNotificationJob.php(37): FoF\PrettyMail\Overrides\NotificationMailer->send(Object(FoF\Byobu\Notifications\DiscussionCreatedBlueprint), Object(Flarum\User\User))
#10 /home/wwwroot/lnmp01/domain/www.nodeloc.com/vendor/illuminate/container/BoundMethod.php(36): Flarum\Notification\Job\SendEmailNotificationJob->handle(Object(FoF\PrettyMail\Overrides\NotificationMailer))
#11 /home/wwwroot/lnmp01/domain/www.nodeloc.com/vendor/illuminate/container/Util.php(40): Illuminate\Container\BoundMethod::Illuminate\Container{closure}()
#12 /home/wwwroot/lnmp01/domain/www.nodeloc.com/vendor/illuminate/container/BoundMethod.php(93): Illuminate\Container\Util::unwrapIfClosure(Object(Closure))
#13 /home/wwwroot/lnmp01/domain/www.nodeloc.com/vendor/illuminate/container/BoundMethod.php(35): Illuminate\Container\BoundMethod::callBoundMethod(Object(Illuminate\Container\Container), Array, Object(Closure))
#14 /home/wwwroot/lnmp01/domain/www.nodeloc.com/vendor/illuminate/container/Container.php(653): Illuminate\Container\BoundMethod::call(Object(Illuminate\Container\Container), Array, Array, NULL)
#15 /home/wwwroot/lnmp01/domain/www.nodeloc.com/vendor/illuminate/bus/Dispatcher.php(128): Illuminate\Container\Container->call(Array)
#16 /home/wwwroot/lnmp01/domain/www.nodeloc.com/vendor/illuminate/pipeline/Pipeline.php(128): Illuminate\Bus\Dispatcher->Illuminate\Bus{closure}(Object(Flarum\Notification\Job\SendEmailNotificationJob))
#17 /home/wwwroot/lnmp01/domain/www.nodeloc.com/vendor/illuminate/pipeline/Pipeline.php(103): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Flarum\Notification\Job\SendEmailNotificationJob))
#18 /home/wwwroot/lnmp01/domain/www.nodeloc.com/vendor/illuminate/bus/Dispatcher.php(132): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#19 /home/wwwroot/lnmp01/domain/www.nodeloc.com/vendor/illuminate/queue/CallQueuedHandler.php(119): Illuminate\Bus\Dispatcher->dispatchNow(Object(Flarum\Notification\Job\SendEmailNotificationJob), false)
#20 /home/wwwroot/lnmp01/domain/www.nodeloc.com/vendor/illuminate/pipeline/Pipeline.php(128): Illuminate\Queue\CallQueuedHandler->Illuminate\Queue{closure}(Object(Flarum\Notification\Job\SendEmailNotificationJob))
#21 /home/wwwroot/lnmp01/domain/www.nodeloc.com/vendor/illuminate/pipeline/Pipeline.php(103): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Flarum\Notification\Job\SendEmailNotificationJob))
#22 /home/wwwroot/lnmp01/domain/www.nodeloc.com/vendor/illuminate/queue/CallQueuedHandler.php(118): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#23 /home/wwwroot/lnmp01/domain/www.nodeloc.com/vendor/illuminate/queue/CallQueuedHandler.php(70): Illuminate\Queue\CallQueuedHandler->dispatchThroughMiddleware(Object(Illuminate\Queue\Jobs\RedisJob), Object(Flarum\Notification\Job\SendEmailNotificationJob))
#24 /home/wwwroot/lnmp01/domain/www.nodeloc.com/vendor/illuminate/queue/Jobs/Job.php(98): Illuminate\Queue\CallQueuedHandler->call(Object(Illuminate\Queue\Jobs\RedisJob), Array)
#25 /home/wwwroot/lnmp01/domain/www.nodeloc.com/vendor/illuminate/queue/Worker.php(428): Illuminate\Queue\Jobs\Job->fire()
#26 /home/wwwroot/lnmp01/domain/www.nodeloc.com/vendor/illuminate/queue/Worker.php(378): Illuminate\Queue\Worker->process(NULL, Object(Illuminate\Queue\Jobs\RedisJob), Object(Illuminate\Queue\WorkerOptions))
#27 /home/wwwroot/lnmp01/domain/www.nodeloc.com/vendor/illuminate/queue/Worker.php(172): Illuminate\Queue\Worker->runJob(Object(Illuminate\Queue\Jobs\RedisJob), NULL, Object(Illuminate\Queue\WorkerOptions))
#28 /home/wwwroot/lnmp01/domain/www.nodeloc.com/vendor/illuminate/queue/Console/WorkCommand.php(116): Illuminate\Queue\Worker->daemon(NULL, 'default', Object(Illuminate\Queue\WorkerOptions))
#29 /home/wwwroot/lnmp01/domain/www.nodeloc.com/vendor/illuminate/queue/Console/WorkCommand.php(100): Illuminate\Queue\Console\WorkCommand->runWorker(NULL, 'default')
#30 /home/wwwroot/lnmp01/domain/www.nodeloc.com/vendor/illuminate/container/BoundMethod.php(36): Illuminate\Queue\Console\WorkCommand->handle()
#31 /home/wwwroot/lnmp01/domain/www.nodeloc.com/vendor/illuminate/container/Util.php(40): Illuminate\Container\BoundMethod::Illuminate\Container{closure}()
#32 /home/wwwroot/lnmp01/domain/www.nodeloc.com/vendor/illuminate/container/BoundMethod.php(93): Illuminate\Container\Util::unwrapIfClosure(Object(Closure))
#33 /home/wwwroot/lnmp01/domain/www.nodeloc.com/vendor/illuminate/container/BoundMethod.php(35): Illuminate\Container\BoundMethod::callBoundMethod(Object(Illuminate\Container\Container), Array, Object(Closure))
#34 /home/wwwroot/lnmp01/domain/www.nodeloc.com/vendor/illuminate/container/Container.php(653): Illuminate\Container\BoundMethod::call(Object(Illuminate\Container\Container), Array, Array, NULL)
#35 /home/wwwroot/lnmp01/domain/www.nodeloc.com/vendor/illuminate/console/Command.php(136): Illuminate\Container\Container->call(Array)
#36 /home/wwwroot/lnmp01/domain/www.nodeloc.com/vendor/symfony/console/Command/Command.php(298): Illuminate\Console\Command->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Illuminate\Console\OutputStyle))
#37 /home/wwwroot/lnmp01/domain/www.nodeloc.com/vendor/illuminate/console/Command.php(120): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Illuminate\Console\OutputStyle))
#38 /home/wwwroot/lnmp01/domain/www.nodeloc.com/vendor/symfony/console/Application.php(1058): Illuminate\Console\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#39 /home/wwwroot/lnmp01/domain/www.nodeloc.com/vendor/symfony/console/Application.php(301): Symfony\Component\Console\Application->doRunCommand(Object(Flarum\Queue\Console\WorkCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#40 /home/wwwroot/lnmp01/domain/www.nodeloc.com/vendor/symfony/console/Application.php(171): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#41 /home/wwwroot/lnmp01/domain/www.nodeloc.com/vendor/flarum/core/src/Console/Server.php(42): Symfony\Component\Console\Application->run()
#42 /home/wwwroot/lnmp01/domain/www.nodeloc.com/flarum(24): Flarum\Console\Server->listen()
#43 {main}
Flarum information
Flarum core: 1.8.5
PHP version: 8.3.0
MySQL version: 5.7.38-log
Loaded extensions: Core, date, libxml, openssl, pcre, sqlite3, zlib, ctype, curl, dom, filter, ftp, gd, hash, iconv, json, mbstring, SPL, session, standard, mysqlnd, PDO, pdo_mysql, pdo_sqlite, Phar, posix, random, Reflection, mysqli, SimpleXML, tokenizer, xml, xmlreader, xmlwriter, zip, fileinfo, exif, Zend OPcache
+----------------------------------------+---------+--------+
| Flarum Extensions | | |
+----------------------------------------+---------+--------+
| ID | Version | Commit |
+----------------------------------------+---------+--------+
| flarum-flags | v1.8.0 | |
| flarum-tags | v1.8.0 | |
| flarum-approval | v1.8.1 | |
| askvortsov-auto-moderator | v0.1.3 | |
| flarum-likes | v1.8.0 | |
| flarum-mentions | v1.8.3 | |
| flarum-subscriptions | v1.8.0 | |
| flarum-suspend | v1.8.1 | |
| antoinefr-money | v1.3.1 | |
| fof-follow-tags | 1.2.2 | |
| fof-pages | 1.0.8 | |
| fof-oauth | 1.6.6 | |
| fof-byobu | 1.3.5 | |
| ziiven-money-leaderboard | v0.1.7 | |
| ziiven-daily-check-in | v0.3.7 | |
| xypp-pay-to-read | v1.2.0 | |
| v17development-user-badges | v1.1.0 | |
| v17development-seo | v1.8.0 | |
| the-turk-flamoji | 1.0.4 | |
| sycho-profile-cover | v1.3.5 | |
| swaggymacro-only-starter | 0.6.6 | |
| pipecraft-id-slug | v1.1.0 | |
| noriods-auto-more | v1.0.0 | |
| nodeloc-dislikes | 1.0.1 | |
| nearata-cakeday | v2.2.0 | |
| justoverclock-username-blacklist | 0.1.0 | |
| imeepo-more-bbcode | v1.0.3 | |
| ianm-follow-users | 1.4.3 | |
| glowingblue-redis-setup | 1.2.1 | |
| foskym-custom-levels | v1.0.3 | |
| fof-user-bio | 1.3.1 | |
| fof-spamblock | 1.1.2 | |
| fof-socialprofile | 1.1.6 | |
| fof-sitemap | 2.2.1 | |
| fof-recaptcha | 1.3.2 | |
| fof-profile-image-crop | 1.1.6 | |
| fof-prevent-necrobumping | 1.1.2 | |
| fof-pretty-mail | 1.1.2 | |
| fof-polls | 2.1.2 | |
| fof-nightmode | 1.5.3 | |
| fof-moderator-notes | 1.2.2 | |
| fof-merge-discussions | 1.4.1 | |
| fof-masquerade | 2.1.4 | |
| fof-links | 1.2.1 | |
| fof-ignore-users | 1.2.1 | |
| fof-github-autolink | 1.1.4 | |
| fof-formatting | 1.0.3 | |
| fof-doorman | 1.1.4 | |
| fof-default-user-preferences | 1.2.1 | |
| fof-default-group | 1.1.2 | |
| fof-best-answer | 1.4.1 | |
| fof-bbcode-details | 1.1.2 | |
| flarumite-simple-discussion-views | 1.2.2 | |
| flarum-sticky | v1.8.0 | |
| flarum-statistics | v1.8.0 | |
| flarum-pusher | v1.8.0 | |
| flarum-nicknames | v1.8.0 | |
| flarum-markdown | v1.8.0 | |
| flarum-lock | v1.8.0 | |
| flarum-lang-chinese-simplified | v1.3.0 | |
| flarum-extension-manager | v1.0.1 | |
| flarum-emoji | v1.8.0 | |
| flarum-bbcode | v1.8.0 | |
| ffans-clipboardjs | v1.0.0 | |
| ecnu-im-sticky-sidenav | v1.1.0 | |
| davwheat-ads | 1.2.0 | |
| datlechin-chatgpt | v0.4.0 | |
| darkle-fancybox | 1.1.2 | |
| club-1-cross-references | v1.1.1 | |
| clarkwinkelmann-scout | 0.3.5 | |
| clarkwinkelmann-roll-die | 1.0.0 | |
| clarkwinkelmann-prominent-post-numbers | 1.0.0 | |
| clarkwinkelmann-money-rewards | 1.0.0 | |
| clarkwinkelmann-group-list | 1.0.0 | |
| clarkwinkelmann-discussion-bookmarks | 2.0.1 | |
| clarkwinkelmann-circle-groups | 1.0.1 | |
| askvortsov-moderator-warnings | v0.6.3 | |
+----------------------------------------+---------+--------+
Base URL: https://www.nodeloc.com
Installation path: /home/wwwroot/lnmp01/domain/www.nodeloc.com
Queue driver: redis
Session driver: redis (Code override. Configured to file)
Scheduler status: Inactive
Mail driver: smtp
Debug mode: off