LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-12-2010, 10:21 AM   #1
amanacare
LQ Newbie
 
Registered: Mar 2010
Posts: 24

Rep: Reputation: 0
Sorry, I wasn't able to establish an SMTP connection. (cannot deliver mail)


hello

first thanks to all of you because you have solved my first problem.
however i have two main problems on my server, the first one was solved thanks to you, but the second is the most annoying one

when sending a message some recipients get it while others don't and i receive this mail every time an e-mail has failed to be received by others:
Code:
From:   	MAILER-DAEMON@XXX-XX-XXX-XX.local
Subject:   	 failure notice

Hi. This is the qmail-send program at XXX-XX-XXX-XX.local.
I'm afraid I wasn't able to deliver your message to the following addresses.
This is a permanent error; I've given up. Sorry it didn't work out.

<XXXXX@XXXXXXX.com>:
Sorry, I wasn't able to establish an SMTP connection. (#4.4.1)
I'm not going to try again; this message has been in the queue too long.

--- Below this line is a copy of the message.
Information about my server: Plesk 9.3.0 | PHP Version 5.1.6 | CentOS release 5.4 | Linux 2.6.28.7 | GenuineIntel, Intel(R) Atom(TM) CPU 330

http://i39.tinypic.com/2f05579.jpg


note that i use horde webmail installed through Plesk, and i access it through webmail.domain and not mail.domain
thank you
 
Old 03-12-2010, 10:36 AM   #2
rweaver
Senior Member
 
Registered: Dec 2008
Location: Louisville, OH
Distribution: Debian, CentOS, Slackware, RHEL, Gentoo
Posts: 1,833

Rep: Reputation: 164Reputation: 164
Go through your logs and see why the remote host is rejecting your connection.
 
Old 03-12-2010, 11:01 AM   #3
amanacare
LQ Newbie
 
Registered: Mar 2010
Posts: 24

Original Poster
Rep: Reputation: 0
Code:
[root@XXX-XX-XXX-XX log]# less maillog























maillog (END)
Code:
[root@root@XXX-XX-XXX-XX log]# more maillog
[root@root@XXX-XX-XXX-XX log]#

the first one was empty while the second provided me nothing.. I'm using putty

Last edited by amanacare; 03-12-2010 at 11:03 AM.
 
Old 03-12-2010, 11:12 AM   #4
spampig
Member
 
Registered: Feb 2010
Location: /Earth/UK/England/Hampshire
Distribution: Debian, Ubuntu, CentOS, Slackware
Posts: 262
Blog Entries: 2

Rep: Reputation: 56
less /var/log/maillog ???
{or has it been chrooted so your view of /var/log/maillog != real /var/log/maillog?}
 
Old 03-12-2010, 11:24 AM   #5
amanacare
LQ Newbie
 
Registered: Mar 2010
Posts: 24

Original Poster
Rep: Reputation: 0
I'm a newbie man, i did not understood what you just said
i guess i should have not used "less".
what command should i use?
 
Old 03-12-2010, 11:31 AM   #6
spampig
Member
 
Registered: Feb 2010
Location: /Earth/UK/England/Hampshire
Distribution: Debian, Ubuntu, CentOS, Slackware
Posts: 262
Blog Entries: 2

Rep: Reputation: 56
No, less is fine - try it as shown
Quote:
less /var/log/maillog
There's nothing wrong with being a newbie, I'm sorry I did not know. Forget the CHROOT for a moment and see if that LESS gives you any output. Also, run it as root by logging in with 'su -' if you can.
 
Old 03-12-2010, 11:39 AM   #7
amanacare
LQ Newbie
 
Registered: Mar 2010
Posts: 24

Original Poster
Rep: Reputation: 0
Code:
[root@XXX-XX-XXX-XX ~]# less /var/log/maillog























/var/log/maillog (END)
it's ok man, i really appreciate what your doing, thanks^
same result, empty log.
i logged in as root because trying to login as su - is giving me Access Denied even though I'm a full admin of my server, if there's a way to login then please show me to it.
regarding the log as you can see it's empty like before
 
Old 03-12-2010, 11:48 AM   #8
spampig
Member
 
Registered: Feb 2010
Location: /Earth/UK/England/Hampshire
Distribution: Debian, Ubuntu, CentOS, Slackware
Posts: 262
Blog Entries: 2

Rep: Reputation: 56
I'm a little suspicious about that. Try this:

Quote:
ls -alh /
I just want to see if you have a full set of directories there like this:
bin
boot
dev
etc
home
lib
lost+found
media
misc
mnt
net
opt
proc
root
sbin
selinux
srv
sys
tmp
usr
var

OR if you only have a few that may suggest CHROOTing.

Also do:
Quote:
ls -alh /var/log/
It would also be worth doing a simple telnet test and seeing if that springs up in the logs:

Quote:
YOU TYPE:> telnet 127.0.0.1 25 [ENTER]
IT OUTPUTS:> Escape character is '^]'. + other stuff
YOU TYPE:> hold down the [CTRL] key and touch the ']' key
IT OUTPUTS:> telnet>
YOU TYPE: quit
Once done, check your maillog again with that less command, if it's still empty it's not logging where we thing it should be.
 
Old 03-12-2010, 12:11 PM   #9
amanacare
LQ Newbie
 
Registered: Mar 2010
Posts: 24

Original Poster
Rep: Reputation: 0
Quote:
drwxr-xr-x 2 root root 4.0K Dec 17 2008 mail
-rw------- 1 root root 0 Mar 7 04:09 maillog
-rw------- 1 root root 0 Feb 28 04:10 maillog.1
-rw------- 1 root root 0 Feb 21 04:08 maillog.2
-rw------- 1 root root 0 Feb 14 04:08 maillog.3
-rw------- 1 root root 0 Feb 7 04:04 maillog.4
drwxrwsr-x 2 root mailman 4.0K Mar 7 04:09 mailman
for ls -alh / i got the same list that you did

indeed i did what you said about telnet, when done i ran less /var/log/maillog but the same result as above i got an empty log
 
Old 03-12-2010, 01:04 PM   #10
spampig
Member
 
Registered: Feb 2010
Location: /Earth/UK/England/Hampshire
Distribution: Debian, Ubuntu, CentOS, Slackware
Posts: 262
Blog Entries: 2

Rep: Reputation: 56
You should have other logs in /var/log which leads me to think there is some kind of sandboxing or chrooting going on. We don't need to be concerned with what all that is - but we need to know why all those mail logs are empty because like that they are as much use as a chocolate teapot.

Without the aid of good log information troubleshooting is crippled :-( Let's focus on what you can do, telnet is going to be your friend here. Let's test to see if you can connect to one of the gmail servers (this will test two things - the servers ability to resolve names to IP addresses (DNS resolution) AND smtp connectivity to a remote server. This test (which is a little naughty as I'm spoofing here) will test that and warn if other things are wrong:

Quote:
YOU TYPE:> telnet gmail-smtp-in.l.google.com 25
IT OUTPUTS:> Trying 209.85.229.27...
IT OUTPUTS:> Connected to gmail-smtp-in.l.google.com (209.85.229.27).
IT OUTPUTS:> Escape character is '^]'.
IT OUTPUTS:> 220 mx.google.com ESMTP 5si2991603bkn.65
YOU TYPE:> helo microsoft.com
IT OUTPUTS:> 250 mx.google.com at your service
YOU TYPE:> mail from: <bill.gates@microsoft.com>
IT OUTPUTS:> 250 2.1.0 OK 5si2991603bkn.65
YOU TYPE:> rcpt to: <postmaster@gmail.com>
IT OUTPUTS:> 250 2.1.5 OK 5si2991603bkn.65
YOU TYPE:> data
IT OUTPUTS:> 354 Go ahead 5si2991603bkn.65
YOU TYPE:> Subject: This is a test - please delete it
YOU TYPE:>
YOU TYPE:> delete me
YOU TYPE:> .
IT OUTPUTS:> 250 2.0.0 OK 1268416662 5si2991603bkn.65
YOU TYPE:> quit
IT OUTPUTS:> 221 2.0.0 closing connection 5si2991603bkn.65
See how far you get with this and we can probably establish what is wrong and where. Bear in mind you have to be fairly swift with your typing here as there is a timeout period. I picked gmail as it is quite high and they are a bit tardy at closing connections themselves. Don't miss the period after the 'delete me' line and end each line with [enter]. Also I'm assuming you are doing this from a command prompt on the server in question (or are remotely connected to it with something like Putty)

Last edited by spampig; 03-12-2010 at 01:05 PM.
 
Old 03-12-2010, 01:15 PM   #11
amanacare
LQ Newbie
 
Registered: Mar 2010
Posts: 24

Original Poster
Rep: Reputation: 0
Quote:
[root@XXX-XX-XXX-XX ~]# telnet gmail-smtp-in.l.google.com 25
Trying 209.85.129.114...
Connected to gmail-smtp-in.l.google.com (209.85.129.114).
Escape character is '^]'.
220 mx.google.com ESMTP 19si3144177fkr.46
helo microsoft.com
250 mx.google.com at your service
mail from: <bill.gates@microsoft.com>
250 2.1.0 OK 19si3144177fkr.46
rcpt to: <postermaster@gmail.com>
250 2.1.5 OK 19si3144177fkr.46
data
354 Go ahead 19si3144177fkr.46
Subject This is a test - please delete it

delete me
.
250 2.0.0 OK 1268417517 19si3144177fkr.46
quit
221 2.0.0 closing connection 19si3144177fkr.46
Connection closed by foreign host.
here it is, same as yours
 
Old 03-12-2010, 01:41 PM   #12
spampig
Member
 
Registered: Feb 2010
Location: /Earth/UK/England/Hampshire
Distribution: Debian, Ubuntu, CentOS, Slackware
Posts: 262
Blog Entries: 2

Rep: Reputation: 56
Then you have no issues with networking, smtp or dns on that server so it's specific either to your QMAIL (in which case I'm outa here...) or the server you were trying to send to.

What I would now do is use the telnet example above using the same to and from that the generated the bounce message you have. You'll need three changes for this and I'll deal with them in reverse.

3: rcpt to: <the_address_that_bounced_you>
2: mail from: <the_address_you_said_you_were_sending_from>
1: You'll need the MX (mail exchanger record) for the domain you were trying to send to. You can get it from the command line by using the nslookup or dig commands, here are some examples:

DIG (not all systems have it installed)
Quote:
TYPE: dig +short mx linuxquestions.org
RESPONSE: 20 alt1.aspmx.l.google.com.
RESPONSE: 20 alt2.aspmx.l.google.com.
RESPONSE: 10 aspmx.l.google.com.
If you don't have DIG use NSLOOKUP
Quote:
nslookup -querytype=MX linuxquestions.org
Server: 192.168.1.50
Address: 192.168.1.50#53

Non-authoritative answer:
linuxquestions.org mail exchanger = 20 alt2.aspmx.l.google.com.
linuxquestions.org mail exchanger = 10 aspmx.l.google.com.
linuxquestions.org mail exchanger = 20 alt1.aspmx.l.google.com.

Authoritative answers can be found from:
linuxquestions.org nameserver = ns1.mydyndns.org.
linuxquestions.org nameserver = ns2.mydyndns.org.
linuxquestions.org nameserver = ns3.mydyndns.org.
linuxquestions.org nameserver = ns4.mydyndns.org.
linuxquestions.org nameserver = ns5.mydyndns.org.
ns2.mydyndns.org internet address = 204.13.249.76
ns3.mydyndns.org internet address = 208.78.69.76
ns4.mydyndns.org internet address = 91.198.22.76
ns5.mydyndns.org internet address = 203.62.195.76

Eitherway you will see there are three MX records, two sharing a low priority (20 is lower than 10). We would drop the number and use 'telnet aspmx.l.google.com 25' if we were trying to telnet test smtp to linuxquestions.org.

Naturally you are not trying to send to linuxquestions.org, so you'll need to get the highest priority MX for the domain you are trying to send to - or use the neat IP address from the bounce you had if you have it (telnet xxx.xxx.xxx.xxx 25).

At some point the session will fail and you will have an error to work with. If it succeeds then you'll need to look at QMAIL and someone else with knowledge of it will be needed as I'm pants with it! I'm about to go out for the evening so if I don't respond one of the other regulars will probably help.

Last edited by spampig; 03-12-2010 at 01:42 PM.
 
Old 03-12-2010, 02:04 PM   #13
amanacare
LQ Newbie
 
Registered: Mar 2010
Posts: 24

Original Poster
Rep: Reputation: 0
thanks for that info, but I'm facing problems with different hosts, ex: comcast, hotmail, gmail, aol....
so my guess is QMAIL i would be glad if someone help me in this as this is the linux support and i don't know where else to go
thanks for everything spampig
 
Old 03-12-2010, 02:32 PM   #14
rweaver
Senior Member
 
Registered: Dec 2008
Location: Louisville, OH
Distribution: Debian, CentOS, Slackware, RHEL, Gentoo
Posts: 1,833

Rep: Reputation: 164Reputation: 164
You might wish to review this site and see if you can find where your qmail is storing your logs, without it's going to be very difficult to diagnose your problem.

http://qmail.jms1.net/logfiles.shtml
 
Old 03-12-2010, 03:13 PM   #15
amanacare
LQ Newbie
 
Registered: Mar 2010
Posts: 24

Original Poster
Rep: Reputation: 0
I don't know if this log might help but here it is (log of atmail):
Quote:
less /var/log/atmail/error_log
[Sun Feb 14 04:08:27 2010] [warn] RSA server certificate CommonName (CN) `plesk' does NOT match server name!?
[Mon Feb 15 06:09:55 2010] [warn] RSA server certificate CommonName (CN) `plesk' does NOT match server name!?
[Mon Feb 15 11:03:33 2010] [warn] RSA server certificate CommonName (CN) `plesk' does NOT match server name!?
[Mon Feb 15 11:03:34 2010] [warn] RSA server certificate CommonName (CN) `plesk' does NOT match server name!?
[Mon Feb 15 13:42:35 2010] [warn] RSA server certificate CommonName (CN) `plesk' does NOT match server name!?
[Mon Feb 15 13:42:36 2010] [warn] RSA server certificate CommonName (CN) `plesk' does NOT match server name!?
[Mon Feb 15 15:31:50 2010] [warn] RSA server certificate CommonName (CN) `plesk' does NOT match server name!?
[Mon Feb 15 15:31:51 2010] [warn] RSA server certificate CommonName (CN) `plesk' does NOT match server name!?
[Mon Feb 15 15:41:11 2010] [warn] RSA server certificate CommonName (CN) `plesk' does NOT match server name!?
[Mon Feb 15 15:41:12 2010] [warn] RSA server certificate CommonName (CN) `plesk' does NOT match server name!?
[Mon Feb 15 15:54:17 2010] [warn] RSA server certificate CommonName (CN) `plesk' does NOT match server name!?
[Mon Feb 15 15:54:18 2010] [warn] RSA server certificate CommonName (CN) `plesk' does NOT match server name!?
[Mon Feb 15 16:16:49 2010] [warn] RSA server certificate CommonName (CN) `plesk' does NOT match server name!?
[Mon Feb 15 16:16:50 2010] [warn] RSA server certificate CommonName (CN) `plesk' does NOT match server name!?
[Tue Feb 16 11:28:22 2010] [warn] RSA server certificate CommonName (CN) `plesk' does NOT match server name!?
[Tue Feb 16 11:28:24 2010] [warn] RSA server certificate CommonName (CN) `plesk' does NOT match server name!?
[Tue Feb 16 12:13:24 2010] [warn] RSA server certificate CommonName (CN) `plesk' does NOT match server name!?
[Tue Feb 16 12:13:25 2010] [warn] RSA server certificate CommonName (CN) `plesk' does NOT match server name!?
[Tue Feb 16 13:51:15 2010] [warn] RSA server certificate CommonName (CN) `plesk' does NOT match server name!?
[Tue Feb 16 13:51:15 2010] [warn] RSA server certificate CommonName (CN) `plesk' does NOT match server name!?
[Tue Feb 16 14:05:42 2010] [warn] RSA server certificate CommonName (CN) `plesk' does NOT match server name!?
[Tue Feb 16 14:05:42 2010] [warn] RSA server certificate CommonName (CN) `plesk' does NOT match server name!?
[Tue Feb 16 14:43:50 2010] [warn] RSA server certificate CommonName (CN) `plesk' does NOT match server name!?
[Tue Feb 16 14:43:51 2010] [warn] RSA server certificate CommonName (CN) `plesk' does NOT match server name!?
[Tue Feb 16 14:44:49 2010] [warn] RSA server certificate CommonName (CN) `plesk' does NOT match server name!?
[Tue Feb 16 14:44:49 2010] [warn] RSA server certificate CommonName (CN) `plesk' does NOT match server name!?
[Tue Feb 16 15:13:48 2010] [warn] RSA server certificate CommonName (CN) `plesk' does NOT match server name!?
[Tue Feb 16 15:13:48 2010] [warn] RSA server certificate CommonName (CN) `plesk' does NOT match server name!?
[Tue Feb 16 17:08:34 2010] [warn] RSA server certificate CommonName (CN) `plesk' does NOT match server name!?
[Tue Feb 16 17:08:35 2010] [warn] RSA server certificate CommonName (CN) `plesk' does NOT match server name!?
[Tue Feb 16 23:54:28 2010] [warn] RSA server certificate CommonName (CN) `plesk' does NOT match server name!?
[Tue Feb 16 23:54:29 2010] [warn] RSA server certificate CommonName (CN) `plesk' does NOT match server name!?
[Sun Feb 21 04:08:55 2010] [warn] RSA server certificate CommonName (CN) `plesk' does NOT match server name!?
[Tue Feb 23 15:00:44 2010] [warn] RSA server certificate CommonName (CN) `plesk' does NOT match server name!?
[Tue Feb 23 15:11:55 2010] [warn] RSA server certificate CommonName (CN) `plesk' does NOT match server name!?
[Wed Feb 24 12:28:48 2010] [warn] RSA server certificate CommonName (CN) `plesk' does NOT match server name!?
[Wed Feb 24 12:31:26 2010] [warn] RSA server certificate CommonName (CN) `plesk' does NOT match server name!?
[Thu Feb 25 00:52:56 2010] [warn] RSA server certificate CommonName (CN) `plesk' does NOT match server name!?
[Thu Feb 25 00:57:29 2010] [warn] RSA server certificate CommonName (CN) `plesk' does NOT match server name!?
[Thu Feb 25 01:13:10 2010] [warn] RSA server certificate CommonName (CN) `plesk' does NOT match server name!?
[Thu Feb 25 01:14:14 2010] [warn] RSA server certificate CommonName (CN) `plesk' does NOT match server name!?
[Thu Feb 25 01:16:20 2010] [warn] RSA server certificate CommonName (CN) `plesk' does NOT match server name!?
[Thu Feb 25 01:26:46 2010] [warn] RSA server certificate CommonName (CN) `plesk' does NOT match server name!?
[Thu Feb 25 17:09:19 2010] [warn] RSA server certificate CommonName (CN) `plesk' does NOT match server name!?
[Thu Feb 25 17:24:49 2010] [warn] RSA server certificate CommonName (CN) `plesk' does NOT match server name!?
[Sun Feb 28 04:10:34 2010] [warn] RSA server certificate CommonName (CN) `plesk' does NOT match server name!?
[Thu Mar 04 17:56:46 2010] [warn] RSA server certificate CommonName (CN) `plesk' does NOT match server name!?
[Thu Mar 04 17:59:59 2010] [warn] RSA server certificate CommonName (CN) `plesk' does NOT match server name!?
[Fri Mar 05 07:57:06 2010] [warn] RSA server certificate CommonName (CN) `plesk' does NOT match server name!?
[Fri Mar 05 12:27:10 2010] [warn] RSA server certificate CommonName (CN) `plesk' does NOT match server name!?
[Fri Mar 05 12:32:25 2010] [warn] RSA server certificate CommonName (CN) `plesk' does NOT match server name!?
[Sun Mar 07 04:09:40 2010] [warn] RSA server certificate CommonName (CN) `plesk' does NOT match server name!?
[Mon Mar 08 17:18:14 2010] [warn] RSA server certificate CommonName (CN) `plesk' does NOT match server name!?
[Mon Mar 08 17:19:25 2010] [warn] RSA server certificate CommonName (CN) `plesk' does NOT match server name!?
[Mon Mar 08 17:56:58 2010] [warn] RSA server certificate CommonName (CN) `plesk' does NOT match server name!?
[Mon Mar 08 18:05:31 2010] [warn] RSA server certificate CommonName (CN) `plesk' does NOT match server name!?
[Wed Mar 10 03:29:26 2010] [warn] RSA server certificate CommonName (CN) `plesk' does NOT match server name!?
[Wed Mar 10 03:38:56 2010] [warn] RSA server certificate CommonName (CN) `plesk' does NOT match server name!?
[Thu Mar 11 20:34:06 2010] [warn] RSA server certificate CommonName (CN) `plesk' does NOT match server name!?
 
  


Reply


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
Postfix Mail Server: cant deliver mail in Users Inbox madfed Linux - Server 1 06-14-2009 06:08 AM
SMTP--direct deliver for most and SMART_HOST when sending to certain domains andrewstr Linux - Server 2 11-22-2006 05:58 PM
Postfix Mail Connection to SMTP Server zeraia77 Linux - Networking 4 03-05-2006 02:50 AM
POSTFIX holding mail in qeue, won't deliver, connection refused bentman78 Linux - Software 2 10-27-2004 08:11 AM


All times are GMT -5. The time now is 10:30 PM.

Main Menu
Advertisement
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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration