LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
Search this Thread
Old 06-03-2009, 03:28 AM   #1
nims
LQ Newbie
 
Registered: Jun 2009
Posts: 3

Rep: Reputation: 0
Sendmail is nog longer able to forward/alias to external servers. connection timeout


Hello,

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 localhost.localdomain.com and they are moved to the /home/virtual/***/var/spool/mqueue.site 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/domain.name sendmail -q -v -OQueueDirectory=/var/spool/mqueue.site

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

I am able to connect to the localhost smpt service:
# telnet localhost.localdomain.com 25
Trying 127.0.0.1...
Connected to localhost.localdomain.com (127.0.0.1).
Escape character is '^]'.
220 rm-302-02.serve.com ESMTP Sendmail 8.13.8/8.13.8; Wed, 3 Jun 2009 00:53:48 +0200
helo smtp.google.com
250 rm-302-02.serve.com Hello localhost.localdomain.com [127.0.0.1], pleased to meet you

Also localhost.localdomain.com 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.
 
Old 06-03-2009, 08:32 PM   #2
Matir
Moderator
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Ubuntu
Posts: 8,507

Rep: Reputation: 118Reputation: 118
If you are using it in a chroot, the hosts file entry for localhost.localdomain.com would need to be in each chroot's /etc/hosts.
 
Old 06-04-2009, 03:02 AM   #3
nims
LQ Newbie
 
Registered: Jun 2009
Posts: 3

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by Matir View Post
If you are using it in a chroot, the hosts file entry for localhost.localdomain.com would need to be in each chroot's /etc/hosts.
Thanks for the reply.

Indeed they are chrooted but the localhost.localdomain.com 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.
127.0.0.1 localhost localhost.localdomain.com
65.23.157.20 rm-302-02.server.com rm-302-02
::1 localhost6.localdomain6 localhost6
65.23.157.20 server.com 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/sendmail.mc and added define(`SMART_HOST', `dedicated4.nims.nl')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/mqueue.site;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.
 
Old 06-04-2009, 03:11 AM   #4
chitambira
Member
 
Registered: Oct 2008
Location: Fife
Distribution: RHEL, Centos
Posts: 373
Blog Entries: 1

Rep: Reputation: 49
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.
 
Old 06-04-2009, 04:30 PM   #5
nims
LQ Newbie
 
Registered: Jun 2009
Posts: 3

Original Poster
Rep: Reputation: 0
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 127.0.0.1 and the internet IP adress. But I am clueless of what this is. Because telnet to 127.0.0.1 port 25, works without any hassle.
 
Old 06-04-2009, 06:51 PM   #6
Matir
Moderator
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Ubuntu
Posts: 8,507

Rep: Reputation: 118Reputation: 118
I mainly run postfix and qmail, so I could be wrong, but I suspect that if sendmail sees an email bound for 127.0.0.1, 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).
 
Old 06-05-2009, 06:37 AM   #7
chitambira
Member
 
Registered: Oct 2008
Location: Fife
Distribution: RHEL, Centos
Posts: 373
Blog Entries: 1

Rep: Reputation: 49
thats what I was saying. If you server is a public smtp server, then it surely can forward external mail, however, forwarding to localhost (127.0.0.1) 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
 
  


Reply

Tags
connection, sendmail


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sendmail error 421 4.4.1 collect: read timeout on connection from tertius Linux - Server 11 09-12-2010 08:37 PM
sendmail: collect: read timeout on connection from XXX.com chtuser Linux - Server 1 04-19-2008 03:42 AM
sendmail - deferred: localhost connection timeout yukinK Linux - Newbie 2 05-18-2007 12:56 PM
sendmail connection timeout pauloco Linux - Networking 2 04-21-2006 09:20 PM
configuring sendmail to use external mail servers tt826 Linux - Networking 42 12-05-2003 11:13 AM


All times are GMT -5. The time now is 07:51 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration