*) A record of mail.mydomain.com AND mydomain.com must point to your server IP address.
*) MX record of "mydomain.com" must point to hostname "mail.mydomain.com" (or "mydomain.com" since you have a A record for "mydomain.com" too), not an IP address.
*) For 'www.mydomain.com', you must point 'www' to server IP address.
If you show us your real hostname/domain name and server IP address, we can help verify it with DNS lookup tool like "dig" command . I don't think these info is sensitive.