HaHaWTH / AuthMeReReloaded

A fork of AuthMe with various bug fixes and new exciting features
https://modrinth.com/plugin/authmerereloaded
GNU Affero General Public License v3.0
82 stars 9 forks source link

Mail Sending Failure - EmailException: Sending the email to smtp.qq.com:465 #211

Closed EnTIv closed 1 week ago

EnTIv commented 1 week ago

What behaviour is observed?

The email function of the plugin fails to send emails. The issue occurs intermittently, and the following error message is logged:

[16:34:56] [Craft Scheduler Thread - 2703 - AuthMe/WARN]: [AuthMe] Failed to send a mail to [1522935501@qq.com]: [EmailException]: Sending the email to the following server failed : smtp.qq.com:465

Expected behaviour

The plugin should successfully send emails using the configured SMTP server (smtp.qq.com:465) without throwing an error.

To Reproduce

  1. Go to the AuthMe plugin's configuration.
  2. Set up the SMTP server to use smtp.qq.com:465.
  3. Attempt to send a confirmation email (e.g., for user registration).
  4. The error will appear intermittently, and emails will fail to send.

Plugin list

[21:52:46 INFO]: Paper Plugins: (1):
[21:52:46 INFO]:  - MarriageMaster
[21:52:46 INFO]: Bukkit Plugins: (93):
[21:52:46 INFO]:  - *7yPay, ajQueue, *AntiExplosion, AntiNetherRoof, AntiPopup, AuthMe, BanIt, BetterRTP, BlueMap, BlueSlimeCore
[21:52:46 INFO]:  BottledExp, BreweryX, ChatControlRed, ChunkSpawnerLimiter, Chunky, CMILib, CombatLogX, CoreProtect, CrazyCrates, CustomDeathMessages
[21:52:46 INFO]:  CustomJoin, CustomJoinMessages, CustomNameplates, CustomSprays, DeathTotem, DropSpawner, dynmap, Dynmap-Towny, EMCRecipies, Essentials
[21:52:46 INFO]:  EssentialsSpawn, GleamDraw, GrimAC, GSit, HeadDatabase, HeadsPlus, HibiscusCommons, HMCCosmetics, HMCWraps, HolographicDisplays
[21:52:46 INFO]:  InsekiCodeKey, InsekiEconomy, InsekiToolKit, InteractiveChat, InventoryRollbackPlus, Invero, InvSeePlusPlus, IronElevators, ItemEdit, ItemsAdder
[21:52:46 INFO]:  LiteBans, LiteCaptcha, LiteSignIn, LoneLibs, LuckPerms, mcMMO, MCPets, MechanicsCore, MiniMOTD, MobsManager
[21:52:46 INFO]:  ModelEngine, MonthlyPerks, Multiverse-Core, MythicMobs, NBTAPI, OpenInv, PlaceholderAPI, PlayerKits2, PlugManX, ProtocolLib
[21:52:46 INFO]:  QuickShop-Hikari, RoseLoot, SiegeWar, SkinsRestorer, spark, Spectator, SudoForce, TAB, TagBackpack, TheNewEconomy
[21:52:46 INFO]:  Towny, TownyChat, TownyMenu, TradeSystem, Vault, VillagerOverhaul, VipSystem, WorldBorder, WorldEdit, YukiNoaAPI
[21:52:46 INFO]:  zaphkiel, zAuctionHouseV3, ZMusi

Server Implementation

Standalone(Spigot)

Database Implementation

SQLite

AuthMe Version

AuthMeReloaded v5.7.0-FORK (build: 53)

Error log (if applicable)

[16:34:56] [Craft Scheduler Thread - 2703 - AuthMe/WARN]: [AuthMe] Failed to send a mail to [1522935501@qq.com]: [EmailException]: Sending the email to the following server failed : smtp.qq.com:465

Configuration

https://paste.gg/p/anonymous/d3caa8e533674a3b84a7539932403882

HaHaWTH commented 1 week ago

Full error log can be found in AuthMe/authme.log, need more information :D

EnTIv commented 1 week ago

Thanks for your response! I checked the full log in AuthMe/authme.log, and it seems the issue is related to my server's network configuration.

I’ll be looking into the network settings on my server to resolve this. I appreciate your help!

[09-13 17:31:09]: [WARN] Failed to send a mail to [3281582990@qq.com]: [EmailException]: Sending the email to the following server failed : smtp.qq.com:465
[09-13 17:31:09]: fr.xephi.authme.libs.org.apache.commons.mail.EmailException: Sending the email to the following server failed : smtp.qq.com:465
    at AuthMe-5.7.0-FORK-Universal.jar//fr.xephi.authme.libs.org.apache.commons.mail.Email.sendMimeMessage(Email.java:1469)
    at AuthMe-5.7.0-FORK-Universal.jar//fr.xephi.authme.libs.org.apache.commons.mail.Email.send(Email.java:1496)
    at AuthMe-5.7.0-FORK-Universal.jar//fr.xephi.authme.mail.SendMailSsl.sendEmail(SendMailSsl.java:106)
    at AuthMe-5.7.0-FORK-Universal.jar//fr.xephi.authme.mail.EmailService.sendNewPasswordMail(EmailService.java:64)
    at AuthMe-5.7.0-FORK-Universal.jar//fr.xephi.authme.process.register.executors.EmailRegisterExecutor.executePostPersistAction(EmailRegisterExecutor.java:72)
    at AuthMe-5.7.0-FORK-Universal.jar//fr.xephi.authme.process.register.executors.EmailRegisterExecutor.executePostPersistAction(EmailRegisterExecutor.java:28)
    at AuthMe-5.7.0-FORK-Universal.jar//fr.xephi.authme.process.register.AsyncRegister.executeRegistration(AsyncRegister.java:103)
    at AuthMe-5.7.0-FORK-Universal.jar//fr.xephi.authme.process.register.AsyncRegister.register(AsyncRegister.java:57)
    at AuthMe-5.7.0-FORK-Universal.jar//fr.xephi.authme.process.Management.lambda$performRegister$4(Management.java:69)
    at org.bukkit.craftbukkit.v1_19_R3.scheduler.CraftTask.run(CraftTask.java:101)
    at org.bukkit.craftbukkit.v1_19_R3.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:57)
    at com.destroystokyo.paper.ServerSchedulerReportingWrapper.run(ServerSchedulerReportingWrapper.java:22)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
    at java.base/java.lang.Thread.run(Thread.java:840)
Caused by: javax.mail.MessagingException: Could not connect to SMTP host: smtp.qq.com, port: 465;
  nested exception is:
    javax.net.ssl.SSLHandshakeException: Remote host terminated the handshake
    at AuthMe-5.7.0-FORK-Universal.jar//com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:2211)
    at AuthMe-5.7.0-FORK-Universal.jar//com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:740)
    at AuthMe-5.7.0-FORK-Universal.jar//javax.mail.Service.connect(Service.java:388)
    at AuthMe-5.7.0-FORK-Universal.jar//javax.mail.Service.connect(Service.java:246)
    at AuthMe-5.7.0-FORK-Universal.jar//javax.mail.Service.connect(Service.java:195)
    at AuthMe-5.7.0-FORK-Universal.jar//javax.mail.Transport.send0(Transport.java:254)
    at AuthMe-5.7.0-FORK-Universal.jar//javax.mail.Transport.send(Transport.java:124)
    at AuthMe-5.7.0-FORK-Universal.jar//fr.xephi.authme.libs.org.apache.commons.mail.Email.sendMimeMessage(Email.java:1459)
    ... 14 more
Caused by: javax.net.ssl.SSLHandshakeException: Remote host terminated the handshake
    at java.base/sun.security.ssl.SSLSocketImpl.handleEOF(SSLSocketImpl.java:1719)
    at java.base/sun.security.ssl.SSLSocketImpl.decode(SSLSocketImpl.java:1518)
    at java.base/sun.security.ssl.SSLSocketImpl.readHandshakeRecord(SSLSocketImpl.java:1425)
    at java.base/sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:455)
    at java.base/sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:426)
    at AuthMe-5.7.0-FORK-Universal.jar//com.sun.mail.util.SocketFetcher.configureSSLSocket(SocketFetcher.java:626)
    at AuthMe-5.7.0-FORK-Universal.jar//com.sun.mail.util.SocketFetcher.createSocket(SocketFetcher.java:400)
    at AuthMe-5.7.0-FORK-Universal.jar//com.sun.mail.util.SocketFetcher.getSocket(SocketFetcher.java:217)
    at AuthMe-5.7.0-FORK-Universal.jar//com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:2175)
    ... 21 more
Caused by: java.io.EOFException: SSL peer shut down incorrectly
    at java.base/sun.security.ssl.SSLSocketInputRecord.read(SSLSocketInputRecord.java:489)
    at java.base/sun.security.ssl.SSLSocketInputRecord.readHeader(SSLSocketInputRecord.java:478)
    at java.base/sun.security.ssl.SSLSocketInputRecord.decode(SSLSocketInputRecord.java:160)
    at java.base/sun.security.ssl.SSLTransport.decode(SSLTransport.java:111)
    at java.base/sun.security.ssl.SSLSocketImpl.decode(SSLSocketImpl.java:1510)
    ... 28 more