Problems setting up email server
Posted: 2020/12/28 17:48:53
I am setting up an email server on my home box with postfix and dovecot
My server is modem router and has as such an internal and external network interface
From my laptop (LAN)
From Thunderbird I get the message: Could not connect to server localhost. The connection was refused.
Testing with telnet from CLI I get
(1) telnet home smtp
Trying 10.5.2.1...
telnet: connect to address 10.5.2.1: Connection refused
(2) telnet home imap
Trying 10.5.2.1...
Connected to home.
Escape character is '^]'.
* OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE IDLE STARTTLS AUTH=PLAIN AUTH=LOGIN] Dovecot ready.
Testing form server works fine.
telnet localhost imap
* OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE IDLE STARTTLS AUTH=PLAIN AUTH=LOGIN] Dovecot ready.
telnet localhost smtp
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
220 home.wo-lar.com ESMTP
The server is listening on port 25 and 465
lsof -i :25
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
master 3777 root 13u IPv4 738295 0t0 TCP localhost:smtp (LISTEN)
lsof -i :465
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
master 3777 root 20u IPv4 740353 0t0 TCP localhost:urd (LISTEN)
I can send mails to my gmail account. But when responding to this mail I get nothing back, not even an error message in gmail (might come later?
I opened the firewall ports too:
Extract from my firewall.
### Allow all Internal traffic to Server
iptables -A INPUT -i $INT_DEV -s $INT_NET -d $INT_NET -j ACCEPT
iptables -A OUTPUT -o $INT_DEV -s $INT_NET -d $INT_NET -j ACCEPT
# New Connection: SMTP and SMTPS (over TLS/SSL)
iptables -A INPUT -i $EXT_DEV -m state --state NEW -m tcp -p tcp --syn --dport 25 -j ACCEPT
iptables -A INPUT -i $EXT_DEV -m state --state NEW -m tcp -p tcp --syn --dport 465 -j ACCEPT
# New Connection: IMAP Email Clients (over SSL and non-encrypted)
iptables -A INPUT -i $EXT_DEV -m state --state NEW -m tcp -p tcp --dport 993 -j ACCEPT
iptables -A INPUT -i $EXT_DEV -m state --state NEW -m tcp -p tcp --syn --dport 143 -j ACCEPT
# Submission
iptables -A INPUT -i $EXT_DEV -m state --state NEW -m tcp -p tcp --dport 587 -j ACCEPT
Any help to solve this issue is welcome.
Thank you
Wolfgang
My server is modem router and has as such an internal and external network interface
From my laptop (LAN)
From Thunderbird I get the message: Could not connect to server localhost. The connection was refused.
Testing with telnet from CLI I get
(1) telnet home smtp
Trying 10.5.2.1...
telnet: connect to address 10.5.2.1: Connection refused
(2) telnet home imap
Trying 10.5.2.1...
Connected to home.
Escape character is '^]'.
* OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE IDLE STARTTLS AUTH=PLAIN AUTH=LOGIN] Dovecot ready.
Testing form server works fine.
telnet localhost imap
* OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE IDLE STARTTLS AUTH=PLAIN AUTH=LOGIN] Dovecot ready.
telnet localhost smtp
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
220 home.wo-lar.com ESMTP
The server is listening on port 25 and 465
lsof -i :25
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
master 3777 root 13u IPv4 738295 0t0 TCP localhost:smtp (LISTEN)
lsof -i :465
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
master 3777 root 20u IPv4 740353 0t0 TCP localhost:urd (LISTEN)
I can send mails to my gmail account. But when responding to this mail I get nothing back, not even an error message in gmail (might come later?
I opened the firewall ports too:
Extract from my firewall.
### Allow all Internal traffic to Server
iptables -A INPUT -i $INT_DEV -s $INT_NET -d $INT_NET -j ACCEPT
iptables -A OUTPUT -o $INT_DEV -s $INT_NET -d $INT_NET -j ACCEPT
# New Connection: SMTP and SMTPS (over TLS/SSL)
iptables -A INPUT -i $EXT_DEV -m state --state NEW -m tcp -p tcp --syn --dport 25 -j ACCEPT
iptables -A INPUT -i $EXT_DEV -m state --state NEW -m tcp -p tcp --syn --dport 465 -j ACCEPT
# New Connection: IMAP Email Clients (over SSL and non-encrypted)
iptables -A INPUT -i $EXT_DEV -m state --state NEW -m tcp -p tcp --dport 993 -j ACCEPT
iptables -A INPUT -i $EXT_DEV -m state --state NEW -m tcp -p tcp --syn --dport 143 -j ACCEPT
# Submission
iptables -A INPUT -i $EXT_DEV -m state --state NEW -m tcp -p tcp --dport 587 -j ACCEPT
Any help to solve this issue is welcome.
Thank you
Wolfgang