Using mailcow as mail server

I am trying to use a local installation of mailcow:dockerized as the mailserver for gitea’s mailer. No matter which config I use, it won’t work. Sometimes gitea throws a Gateway Time-out error, some other times it connects to the mail server, then immediately timeouts/gets disconnected (as per the postfix/dovecot logs). Is there some special procedure to use a local mailserver for gitea?

UPDATE: problem seems to exist only with the docker version. Downloaded the binary and it works fine.