To add an email account for the first time, open the Mail app on your device, then select “Other Mail Account…” and “Continue“:

Then select “Mail > Settings…“:

To add an email account, click the “+” button at the bottom of the page:

On the next page, fill in the fields as follows:
Name: Your name/company name
E-mail address: The email address to add
Password: The password for this email account

Account Type: IMAP
Incoming Mail Server: mail.yourdomain.com (replace βyourdomain.comβ with your domain name)
Outgoing Mail Server: mail.yourdomain.com (replace βyourdomain.comβ with your domain name)
Once the fields are filled in, click the “Sign In” button:

You can ignore the message “Unable to verify account name or password“.
On the next page, select the “Mail” field and click the “Done” button:

If you have already added an email account to the Mac Mail program and want to change the settings, open the “Mail” program, then select “Mail > Settings…“:

On the next page, open “Accounts“, then select the email account whose settings you want to change from the left menu and open the “Server Settings” tab:

Uncheck the “Automatically manage connection settings” options in the “Incoming Mail Server (IMAP)” and “Outgoing Mail Server (SMTP)” sections.