I have two ruby on rails application on different servers. Both are working fine, but one (server 2) can't send any mails.
I got always the 554 5.7.1 : Relay access denied error.
On server 2 I tested the mail communication with the help of telnet and it works, but it doesn't works with the ruby on rails application.
Other application can send mails, too.
The only difference between both systems are the os (Debian 6 (server 1) and RHEL 6 (server 2)) and the ip ranges (10 network (server 2) and 53 network (server 1)).
I think the best way is to use a simple mail application, but I don't know, how to write something like that.
Thanks for any help.
The IP address of your second server is not in the whitelist for that email server, but the first one is.
Unless you're using authenticated SMTP, you will have to add the IP addresses of all your application servers to the whitelist configuration.
Using telnet will only tell you if the port is accepting connections, not if you can actually send email. For that you'll have to perform an actual SMTP transaction.
There are services like Postmark, SendGrid or even my start-up PostageApp which will act as a mail server for you.