In Mail’s Preferences window, click on the Accounts tab, then your account, then the Server Settings tab, and uncheck Automatically manage connection settings. (This option is not available for all account types. In previous versions of Mail, this option was called Automatically detect and maintain account settings and was in the Advanced tab.)
If Mail is launching slowly and you are using macOS 10.14 or later:
This should work around a Mail bug where it pauses before loading a plug-in that has been installed for a long time.
Change the AppleMailPlugInSetIsJunk option in SpamSieve’s esoteric preferences to not mark messages as junk.
If training is slow, see the Faster Apple Mail Training section.
If you are using the Apple Mail - Remote Training, Apple Mail - SaneBox, or Apple Mail - Server Junk Mailbox script, try unchecking the Mail rule that runs the script and see if that helps. You can also run the script in Script Editor to see if it is taking a long time to complete.
If none of these suggestions helped, please see the Sending in a “Sample” Report section.