Can you configure the port to use for IMAP in Mail.app? The outgoing mail server has a field for a custom port number, but I don't see one for the incoming mail server (IMAP). Is there a way to set it?

I'm testing an email server. I know this is not something one does normally.

Mail 11.4, macOS 10.13.5.
Uncheck "Automatically manage connection settings" below the "Host Name" field. The port number field should appear.