IMAP not updating when Mac is locked

I recently upgraded to a new Mac, and am running the newest version of Mojave. I was running Mojave of my former setup as well. I am using version 2.9.35 of Spamsieve. I have several email accounts all using IMAP.

On the new Mac Spamsieve seems to be working fine, but does not update back to the IMAP server until my Mac wakes up. In other words, I get lots of spam on my iPhone, unless I wake up my Mac and give it a minute to sync the email/spam updates. This was not the case with my prior setup.
Any ideas how I can get my email to update even when my Mac is sleeping or locked?
Thanks

Apple Mail won’t check for new mail when the Mac is asleep, unless your Mac meets the criteria for Power Nap (and even then it can be iffy how many messages it will download). Regarding checking for mail when the Mac is locked, please see this page.