-   Linux - Server (
-   -   Sendmail is nog longer able to forward/alias to external servers. connection timeout (

nims 06-03-2009 03:28 AM

Sendmail is nog longer able to forward/alias to external servers. connection timeout

Since a couple of days I have an issue in which sendmail is no longer able to send e-mails to external adresses when they needed to be forwarded (.forward) or aliassed.

What happens in detail is the following:

E-mails that need to be delivered to local mailboxes are delivered as it should. The moment that they need to be sent to an external box (.forward or alias) they get stuck with the connection timeout error to and they are moved to the /home/virtual/***/var/spool/ folder.

I am running on parallels control panel pro (formaly known as ensim) so I have virtual sites.

I can try to resending it by running
#chroot /home/virtual/ sendmail -q -v -OQueueDirectory=/var/spool/

But I then get the same problem:
Running /var/spool/ (sequence 1 of 159)
xx@yy.zz... Connecting to via relay...
xx@yy.zz... Deferred: Connection timed out with

I am able to connect to the localhost smpt service:
# telnet 25
Connected to (
Escape character is '^]'.
220 ESMTP Sendmail 8.13.8/8.13.8; Wed, 3 Jun 2009 00:53:48 +0200
250 Hello [], pleased to meet you

Also is in my hosts file, and I am able to ping it as it should.

Now I am really out of ideas and suggestions so I was hoping one of you have any ideas.

Matir 06-03-2009 08:32 PM

If you are using it in a chroot, the hosts file entry for would need to be in each chroot's /etc/hosts.

nims 06-04-2009 03:02 AM


Originally Posted by Matir (Post 3562354)
If you are using it in a chroot, the hosts file entry for would need to be in each chroot's /etc/hosts.

Thanks for the reply.

Indeed they are chrooted but the is present in each host.

[root@rm-302-02 etc]# more hosts
# Do not remove the following line, or various programs
# that require network functionality will fail. localhost rm-302-02
::1 localhost6.localdomain6 localhost6 server

In the meanwhile I have created a workaround which seems to work. But I am not sure if this is a good solution.

I did the following:

Changed /home/virtual/FILESYSTEMTEMPLATE/siteinfo/etc/mail/ and added define(`SMART_HOST', `')dnl
Changed all the sites:
for i in `sitelookup -a domain`;do EditVirtDomain $i;done;

Then restarted sendmail and processed the queues:
for i in `sitelookup -a domain`;do chroot /home/virtual/$i sendmail -q -v -OQueueDirectory=/var/spool/;done;

All the old e-mails where being sent. And now new messages are being correctly forwarded again.

I am not sure if this is the solution, but it kept me going.

chitambira 06-04-2009 03:11 AM

Thats the correct solution. Your problem was really with 'mail routing'. Whilist local mails were delivered fine, for forwarded mails, sendmail didnt know where to forward them, It tried to forward them to itselst (which is wrong), so you did good by adding the correct SMART_HOST, which is in actual fact, the 'default gateway' for external mail.

nims 06-04-2009 04:30 PM

Well I think this is not the right solution because the smarthost I've added is in fact the LOCAL server only by it's dedicated domain name known from outside.

The only thing I can think of at the moment is that there is some slight difference between and the internet IP adress. But I am clueless of what this is. Because telnet to port 25, works without any hassle.

Matir 06-04-2009 06:51 PM

I mainly run postfix and qmail, so I could be wrong, but I suspect that if sendmail sees an email bound for, it just handles it internally, assuming the email would come into the same server (which it normally would without chroots or other multiple-server situations).

chitambira 06-05-2009 06:37 AM

thats what I was saying. If you server is a public smtp server, then it surely can forward external mail, however, forwarding to localhost ( is TOTALLY DIFFERENT. You need to understand the meaning of localhost (which is very different to local server as you assumed)
Simply put, localhost -->loopback

All times are GMT -5. The time now is 01:30 AM.