Can I setup a mail server in CyberPanel while the domain is on different server

Hello guys, I want to setup mail.domain.xyz as the default SMTP email server for domain.xyz. However domain.xyz website will be hosted on server A and the mail.domain.xyz will be hosted on server B (which is CyberPanel). Is this possible? What would be the configuration? Both servers will use Cloudflare DNS.