Koozali.org: home of the SME Server

Problems sending mail

Offline smeerbartje

  • *
  • 71
  • +0/-0
Problems sending mail
« on: August 05, 2008, 11:34:42 AM »
I have a problem sending emails through my provider's smtp server. I have set the smtp server (smtp.ru.nl) into the admin pages: Address of Internet provider's mail server and no authentication, since this server does not require authentication.

When I try to send an email with, for example, a PHP script, the mail stays in the queue. The logfiles show the following errors:

Code: [Select]
1217878171.130205500 qp 7427: to=remote.rogier@bladiebla.com, uid=102, ddelay=90000.904626, xdelay=0.020269, stat=Deferred (Connected_to_131.174.66.167_but_greeting_failed./Remote_host_said:_421_4.7.0_smtp.ru.nl_Error:_too_many_connections_from_my_ip_address/)
1217878171.130215500 qp 7430: to=remote.rogier@bladiebla.com, uid=102, ddelay=90000.471096, xdelay=0.025255, stat=Deferred (Connected_to_131.174.66.167_but_greeting_failed./Remote_host_said:_421_4.7.0_smtp.ru.nl_Error:_too_many_connections_from_my_ip_address/)
1217878171.130251500 qp 7433: to=remote.rogier@bladiebla.com, uid=102, ddelay=90000.200754, xdelay=0.034582, stat=Deferred (Connected_to_131.174.66.167_but_greeting_failed./Remote_host_said:_421_4.7.0_smtp.ru.nl_Error:_too_many_connections_from_my_ip_address/)
1217878171.160778500 qp 7436: to=remote.rogier@bladiebla.com, uid=102, ddelay=89999.479803, xdelay=0.030583, stat=Deferred (Connected_to_131.174.66.167_but_greeting_failed./Remote_host_said:_421_4.7.0_smtp.ru.nl_Error:_too_many_connections_from_my_ip_address/)

I don't get it, because I can send emails from my desktop computer by using the same email server. What am I doing wrong?

Offline arne

  • ****
  • 1,116
  • +0/-4
Re: Problems sending mail
« Reply #1 on: August 05, 2008, 12:29:58 PM »
It could be a dns problem if your other PC's use the isp dns server while the sme server use the internet root servers.

When I do "ping smtp.ru.nl" I got "can not be resolved".

Try that ping from Workstations and from the sme server. (I guess that the sme server is running as server only ?)

Post result from the two pings here.

If it should apear to be a dns problem it should work by replacing the smtp.ru.nl with the proper ip, I guess.
« Last Edit: August 05, 2008, 12:31:31 PM by arne »
......

Offline smeerbartje

  • *
  • 71
  • +0/-0
Re: Problems sending mail
« Reply #2 on: August 05, 2008, 01:33:10 PM »
It could be a dns problem if your other PC's use the isp dns server while the sme server use the internet root servers.

When I do "ping smtp.ru.nl" I got "can not be resolved".

Try that ping from Workstations and from the sme server. (I guess that the sme server is running as server only ?)

Post result from the two pings here.

If it should apear to be a dns problem it should work by replacing the smtp.ru.nl with the proper ip, I guess.
Hi, here are the results of the ping to the server:
Code: [Select]
login as: root
root@195.169.214.146's password:
Last login: Tue Aug 5 11:49:10 2008 fm 62.140.137.125
[root@vhe-490181 ~]# ping smtp.ru.nl
PING smtp.ru.nl (131.174.66.167) 56(84bytes of data.
64 bytes from smtp.ru.nl (131.174.66.1): icmp_seq=0 ttl=253 time=0.436 ms
64 bytes from smtp.ru.nl (131.174.66.1): icmp_seq=1 ttl=253 time=0.453 ms
64 bytes from smtp.ru.nl (131.174.66.1): icmp_seq=2 ttl=253 time=0.447 ms
64 bytes from smtp.ru.nl (131.174.66.1): icmp_seq=3 ttl=253 time=0.456 ms
64 bytes from smtp.ru.nl (131.174.66.167): icmp_seq=4 ttl=253 time=0.546 ms
64 bytes from smtp.ru.nl (131.174.66.167): icmp_seq=5 ttl=253 time=0.434 ms
64 bytes from smtp.ru.nl (131.174.66.167): icmp_seq=6 ttl=253 time=0.431 ms
64 bytes from smtp.ru.nl (131.174.66.167): icmp_seq=7 ttl=253 time=0.443 ms
This is from the server. On my desktop computer, I got the same answers (but cannot post it now). So both computers can reach the server. What an I doing wrong?

Online mmccarn

  • *
  • 2,629
  • +10/-0
Re: Problems sending mail
« Reply #3 on: August 05, 2008, 03:29:21 PM »
From your original post:
(Connected_to_131.174.66.167_but_greeting_failed./Remote_host_said:_421_4.7.0_smtp.ru.nl_Error:_too_many_connections_from_my_ip_address/

The remote mail server at 131.174.66.167 thinks there are too many open connections from your system (or from your IP address as perceived by smtp.ru.nl, which may be completely different).

If I try telnet 131.174.66.167 smtp I *should* get an SMTP greeting.  Instead I get a TCP timeout.

There seems to be a problem with 131.174.66.167 (smtp.ru.nl).

Offline smeerbartje

  • *
  • 71
  • +0/-0
Re: Problems sending mail
« Reply #4 on: August 05, 2008, 03:43:11 PM »
From your original post:
(Connected_to_131.174.66.167_but_greeting_failed./Remote_host_said:_421_4.7.0_smtp.ru.nl_Error:_too_many_connections_from_my_ip_address/

The remote mail server at 131.174.66.167 thinks there are too many open connections from your system (or from your IP address as perceived by smtp.ru.nl, which may be completely different).

If I try telnet 131.174.66.167 smtp I *should* get an SMTP greeting.  Instead I get a TCP timeout.

There seems to be a problem with 131.174.66.167 (smtp.ru.nl).
No, there is no problem with 131.174.66.167. The server is only usable for people in the same IP range. Both my server (which is a gateway) and the clients are in the range. Therefore they can ping and "use" the smtp server. When I do a telnet at the server, the following is the output:

Code: [Select]
login as: root
root@123.123.123.123's password:
Last login: Tue Aug 5 12:36:05 2008 fm 62.140.137.125
[root@vhe-490181 ~]# telnet smtp.ru.nl5
Trying 131.174.66.167...
Connected to smtp.ru.nl.
Escape character is '^]'.
220 smtp.ru.nl ESMTP Postfix
HELO smtp.ru.nl
250 smtp.ru.nl
mail from: my@email.com
250 2.1.0 Ok
rcpt to: my@email.com
250 2.1.5 Ok
data
354 End data with <CR><LF>.<CR><LF>
Subject: test, sent under telnet
this is a very nice test.
.
250 2.0.0 Ok: queued as 5272E8DC2D
Problem is that the mail is NOT delivered by the smtp server to the address. Strange isn't it? I will try to do THE SAME telnet session from my desktop computer tonight. (I'm on my work right now)

What is wrong?

Online mmccarn

  • *
  • 2,629
  • +10/-0
Re: Problems sending mail
« Reply #5 on: August 05, 2008, 04:10:47 PM »
Quote from: smeerbartje
The server is only usable for people in the same IP range.
Doh!

You'll need to repeat your telnet session from the SME server itself to figure out why the SME can't relay.

If your work system is behind the SME, your results will be affected by the setting of Security::Proxy settings::SMTP proxy status.  If the SMTP proxy is enabled, then the SME will intercept all attempted outbound connections on port 25 and re-direct them to itself.

It is still the case that 131.174.66.167 is complaining about "too many connections from my ip address".  Can you contact the admin for 131.174.66.167 to find out what the limits are?  I have had an ISP that would refuse all email relay after a certain daily limit was reached - is this the case here?  (In my case the limit was 50 emails per day - not even enough for a single home user! - but as soon as I called they increased the limit for me...)

Offline smeerbartje

  • *
  • 71
  • +0/-0
Re: Problems sending mail
« Reply #6 on: August 05, 2008, 04:14:12 PM »
I don't think we are at the same level here :). I did a telnet session from a SSH session on the server. So the mail has been sent by a telnet session on the server itself. In my last post, I told you guys the mail did not reach te recipient. But after 30 minutes the mail arrived correctly.

So, the problem must be somewhere in the SME server and not the SMTP server. When I do a telnet session, the server can send mails, but a process like PHP cannot send mails. In the server manager the smtp address is named correctly.

Offline arne

  • ****
  • 1,116
  • +0/-4
Re: Problems sending mail
« Reply #7 on: August 05, 2008, 06:22:40 PM »
Seems like it is not the dns thing I was thinking about.

There is a small utility called " iptraf " that can be installed via yum.

Via iptraf you can nonitor a picture of how packets is streaming out and in from your server.

So using iptraf, you can monitor if your server is trying to send mail, like you want it to, if the receiving server ansver like expected, how many connections that is open etc.
« Last Edit: August 05, 2008, 06:24:29 PM by arne »
......

Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
Re: Problems sending mail
« Reply #8 on: August 05, 2008, 06:45:17 PM »
I have a problem sending emails through my provider's smtp server. I have set the smtp server (smtp.ru.nl) into the admin pages: Address of Internet provider's mail server and no authentication, since this server does not require authentication.

When I try to send an email with, for example, a PHP script, the mail stays in the queue.

You should not be trying to send mail from a PHP script via your provider's SMTP server. Your PHP should send via localhost, and your SME server will queue the mail, and then send via your provider's SMTP server.

Your message is off-topic for this forum, because it concerns a PHP script which is not part of the SME Server 7.x CDROM install.

Offline smeerbartje

  • *
  • 71
  • +0/-0
Re: Problems sending mail
« Reply #9 on: August 06, 2008, 05:16:03 PM »
You should not be trying to send mail from a PHP script via your provider's SMTP server. Your PHP should send via localhost, and your SME server will queue the mail, and then send via your provider's SMTP server.

Your message is off-topic for this forum, because it concerns a PHP script which is not part of the SME Server 7.x CDROM install.

I don't think this message is off-topic, because my server is NOT able to send emails. It is not only PHP (running on the server) wich cannot send it. The problem is more abstract and is a server issue; therefore on-topic.

Is there a way to check if the server is able te send mails? For example, is it possible to send an email from the server console? And how?

Offline mercyh

  • *
  • 824
  • +0/-0
    • http://mercyh.org
Re: Problems sending mail
« Reply #10 on: August 06, 2008, 05:54:46 PM »
Quote
Is there a way to check if the server is able te send mails? For example, is it possible to send an email from the server console? And how?

go to http://your.server.IP.address/webmail

log in as a user on the machine and send an e-mail. If this does not send you have a server problem.

Offline Stefano

  • *
  • 10,839
  • +2/-0
Re: Problems sending mail
« Reply #11 on: August 06, 2008, 06:02:00 PM »
I don't think this message is off-topic, because my server is NOT able to send emails. It is not only PHP (running on the server) wich cannot send it. The problem is more abstract and is a server issue; therefore on-topic.

Is there a way to check if the server is able te send mails? For example, is it possible to send an email from the server console? And how?

if you can't send mail via webmail or console with
Code: [Select]
echo "test test" > /tmp/testmsg
mail -s "my subject" emailaddress < /tmp/testmsg

then raise a bug in bugzilla

Thank you
Stefano

BTW, try to send a message directly, bypassing isp's smtp server and look in log files

Offline arne

  • ****
  • 1,116
  • +0/-4
Re: Problems sending mail
« Reply #12 on: August 06, 2008, 07:05:41 PM »
"Is there a way to check if the server is able te send mails?"

The iptraf utility can be used to see if your own server is trying to send mail and if the remote server gives the proper answer.

To build in the buildt in web mail function is a good idea. I allways use that for testing the mail function. (Because this eleminationg pop problems etc.)
 
......

Offline smeerbartje

  • *
  • 71
  • +0/-0
Re: Problems sending mail
« Reply #13 on: August 06, 2008, 07:12:41 PM »
I installed the "E-Mail queue management"-RPM which creates the ability to manage the mailing queue in the server manager. When I use the "Try to send the queued messages now"-function, it says "Cannot send mails, qmail is not running". I did not shut down qmail or something... how can I start qmail?

And another thing: I cannot log on to webmail. When I go to server-address/webmail, the Horde application is showed, but no user can login. (Message: Login failed). I'm sure I use the correct user/pass combination. What is wrong with my system?

Offline mercyh

  • *
  • 824
  • +0/-0
    • http://mercyh.org
Re: Problems sending mail
« Reply #14 on: August 06, 2008, 07:15:37 PM »
You are not trying to use the e-mail address as the user name by chance?

You should for sure be able to login as admin on that screen with your admin/root password.

Can you login to the server-manager panel and see for sure what your valid user names are?