The developers of K9 and other Mail apps have been struggling to work around/with the more aggressive battery optimisation for a while now. It's apparently difficult to keep their apps alive to poll (POP3) or refresh the connection (IMAP). I've had a lot of success with Disable Doze but it's not foolproof. Google's stock answer apparently was that such apps should use the official messaging service but that means sending yet more data via their servers. Funny that. Even funnier that with each successive phone, despite no change in my usage, battery life gets worse.
I've thought for a while now that Android was trying to construct a wall around its garden. Sad if true.