First i just want to say that im a total noob when it comes to mail servers, and it might be something obvious wrong that just make me look stupid posting this.
I have been trying to setup a mail server on my azure ubuntu server for the first time and have been struggling now for alot of hours. Im running Apache2, php7, mysql, phpmyadmin for my webserver and that is working.
Over the last day I've installed: Postfix, Dovecot, SpamAssassin, ClamAV, Sieve and Roundcube. And then followed numberous of guides to get it all configured. Everything is up and running.
I've now gotten to the point where im logged in to Roundcube to test everything. But, i cant send or receive any mail. I can't even send a mail to the same mail address im logged in to. The only error message in the log files are
SMTP Error (553): Failed to add recipient "mail@rajohan.no" (5.7.1 : Sender address rejected: not logged in)
So my guess is that there is a problem with the firewall. Either in UFW or the one on the azure portal. Maybe bought. They should have the same ports opened. Ive included some outputs underneath that show which ports that are open. Or maybe theres a problem with my DNS records.
Do i have to open more ports then 25 to get the email server to work? And do i have to set it open in tcp and udp? And if i do have to open more ports, which should i open?
The mailserver is also set up with a SSL sertificate that's paid for. Some outputs are added below that might help.
Ufw Status
Apache Full ALLOW Anywhere
Postfix ALLOW Anywhere
22/tcp ALLOW Anywhere
25/tcp ALLOW Anywhere
3389/tcp ALLOW Anywhere
Apache Full (v6) ALLOW Anywhere (v6)
Postfix (v6) ALLOW Anywhere (v6)
22/tcp (v6) ALLOW Anywhere (v6)
25/tcp (v6) ALLOW Anywhere (v6)
3389/tcp (v6) ALLOW Anywhere (v6)
Net Stat
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 127.0.0.1:5910 0.0.0.0:* LISTEN 2782/Xvnc
tcp 0 0 127.0.0.1:3350 0.0.0.0:* LISTEN 1823/xrdp-sesman
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1537/sshd
tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTEN 2155/master
tcp 0 0 0.0.0.0:3389 0.0.0.0:* LISTEN 1814/xrdp
tcp 0 0 0.0.0.0:4190 0.0.0.0:* LISTEN 1439/dovecot
tcp 0 0 0.0.0.0:993 0.0.0.0:* LISTEN 1439/dovecot
tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN 1562/mysqld
tcp 0 0 0.0.0.0:587 0.0.0.0:* LISTEN 2155/master
tcp 0 0 0.0.0.0:25324 0.0.0.0:* LISTEN 1978/ruby
tcp 0 0 0.0.0.0:143 0.0.0.0:* LISTEN 1439/dovecot
tcp6 0 0 :::22 :::* LISTEN 1537/sshd
tcp6 0 0 :::25 :::* LISTEN 2155/master
tcp6 0 0 :::443 :::* LISTEN 2196/apache2
tcp6 0 0 :::4190 :::* LISTEN 1439/dovecot
tcp6 0 0 :::993 :::* LISTEN 1439/dovecot
tcp6 0 0 :::587 :::* LISTEN 2155/master
tcp6 0 0 :::143 :::* LISTEN 1439/dovecot
tcp6 0 0 :::80 :::* LISTEN 2196/apache2
DNS records
Hostname TTL RR-Type Parameters Data
rajohan.no 1hour A - 52.232.21.85
rajohan.no 24hours MX 10 mail.rajohan.no
rajohan.no 24 hours TXT - "v=spf1 mx a ?all"
mail.rajohan.no 24 hours A - 52.232.21.85
mail._domainkey.rajohan.no 24 hours TXT - "v=DKIM1; h=sha256; k=rsa; s=email; " "p=M......"
Telnet localhost 25
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
220 mail.rajohan.no ESMTP