Hi everyone.
I have a dovecot/postfix mail server setup in a jail. Everything works as it should. I can connect, send and receive both from the LAN and WAN. I can also telnet to both ports 25 and 465(for TLS) on both LAN and WAN.
The problem I am having is when sendmail sends mail to a local account. If postfix delivers it, it's fine but if say I have a system message sent to root I get connection refused. I noticed this problem when trying to set up spamd (spamassassin). After the message is passed to spamd to process it, it uses sendmail to deliver the message to the final destination.
See below a couple of system messages.
I spent a long time trying to figure this out and now that I think about it, I think it is a routing issue. I do not run a DNS server so my.domain.com should be the local machine which is 192.168.1.90 but my guess is that it is trying to connect to port 25 on my gateway/router. I have my.domain.com in the /etc/hosts file as the jail's IP address and as I said before, I can telnet through that domain locally it's only sendmail that has the problem.
my.domain.com is not my real domain obviously
Does anyone know what I can do to troubleshoot this further? It is driving me mad.
Edit:
OK now I'm certain that is the problem. Turns out I can't telnet to port 25 from WAN so I guess it is trying to connect through my router instead of just delivering locally. I'm still at a loss to how I make sendmail deliver to the machine it's on instead of going the long way around...
I have a dovecot/postfix mail server setup in a jail. Everything works as it should. I can connect, send and receive both from the LAN and WAN. I can also telnet to both ports 25 and 465(for TLS) on both LAN and WAN.
The problem I am having is when sendmail sends mail to a local account. If postfix delivers it, it's fine but if say I have a system message sent to root I get connection refused. I noticed this problem when trying to set up spamd (spamassassin). After the message is passed to spamd to process it, it uses sendmail to deliver the message to the final destination.
See below a couple of system messages.
Code:
root@sarah-jane /root > mailq
/var/spool/mqueue (2 requests)
-----Q-ID----- --Size-- -----Q-Time----- ------------Sender/Recipient-----------
oBCGWYbY094773 1115 Mon Dec 13 03:02 root
(Deferred: Connection refused by my.domain.com.)
admin@my.domain.com\011
oBCGWYKd094763 2205 Mon Dec 13 03:02 root
(Deferred: Connection refused by my.domain.com.)
admin@my.domain.com\011
Total requests: 2
I spent a long time trying to figure this out and now that I think about it, I think it is a routing issue. I do not run a DNS server so my.domain.com should be the local machine which is 192.168.1.90 but my guess is that it is trying to connect to port 25 on my gateway/router. I have my.domain.com in the /etc/hosts file as the jail's IP address and as I said before, I can telnet through that domain locally it's only sendmail that has the problem.
my.domain.com is not my real domain obviously

Does anyone know what I can do to troubleshoot this further? It is driving me mad.
Edit:
OK now I'm certain that is the problem. Turns out I can't telnet to port 25 from WAN so I guess it is trying to connect through my router instead of just delivering locally. I'm still at a loss to how I make sendmail deliver to the machine it's on instead of going the long way around...