swift mailer shows fatal error, connection refused - mandrill

i am trying to use swift mailer to send emails with mandrill API. I was working on a server and it worked great. Then when i changed to another server and it shows this: Fatal error: Uncaught exception 'Swift_TransportException' with message 'Connection could not be established with host smtp.mandrillapp.com [Connection refused #111]'
can anyone help?

This is typically a result of your hosting provider blocking the port being used or blocking external SMTP connections. You'll likely want to get in touch with the host for the new server you're working with since many shared hosting providers limit or prohibit the use of certain ports or external services.

In my case, I had not mentioned port number 587. mandrillapp changed from default 25 to 587 now.

Related

“The connection has timed out.” in iis

I Create a New Website in Windows IIS , It has been working for several months
but i get this error today.
“The connection has timed out.”
the server 192.168.1.7 at is taking too long to respond
i set binding
and get this error
you can also be set in the web.config (example is for 2 minutes, 120 seconds):
<limits connectionTimeout="00:02:00" />
Try to clear the host name, and then use localhost to access your website in server.If you do not access your website locally, you need to use the IP address to access. If you have registered a domain name and completed the binding, you can also use the domain name to access.

Working around a port 25 block for SMTP

I have a Delphi 7 application that I wrote that I have distributed to a partner living in a faraway place. The app uses the IndyDirect IdSMTP component to send mail to a mail server which I own. The mail server itself has no issues. The app worked fine until my friend moved. My friend ended up in a part of the world where his ISP blocks port 25. This prevents my Delphi app from sending email to my mail server.
The ISP said that they do permit port 587 as an alternative to port 25. My question is, is this a simple matter of changing the PORT property for the IdSMTP component from 25 to 587 and then recompiling the source code and giving my friend an updated .exe? Does anyone know if the mail server needs to be reconfigured in any way?
Thanks.
Yes, the mail server needs to be reconfigured. Right now it's listening on port 25; you need to configure it to listen on 587. This should be fairly simple with most off-the-shelf mail servers.
As an aside, I'd suggest putting the SMTP port into a configuration file that you read from in your Delphi code; then if the port changes again, all you have to do is update the config file rather than recompiling it and resending it to your friend. You could even get your friend to do it -- "Just open smtp.config and change '587' to 'xyz', then restart the program."

Connection to SQS refused

I am developing a service which reads messages from SQS, does some processing and posts the result to a different service.
When I initially developed this, the service was working perfectly fine, however after some days (about 5 days) I got this exception:
com.amazonaws.http.AmazonHttpClient: Unable to execute HTTP request: Connection to https://sqs.us-east-1.amazonaws.com refused { org.apache.http.conn.HttpHostConnectException: Connection to https://sqs.us-east-1.amazonaws.com refused
at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:158)
at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:149)
at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:121)
at org.apache.http.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:561)
at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:415)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:820)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:754)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:732)
at com.amazonaws.http.AmazonHttpClient.executeHelper(AmazonHttpClient.java:280)
at com.amazonaws.http.AmazonHttpClient.execute(AmazonHttpClient.java:165)
at com.amazonaws.services.sqs.AmazonSQSClient.invoke(AmazonSQSClient.java:869)
at com.amazonaws.services.sqs.AmazonSQSClient.getQueueAttributes(AmazonSQSClient.java:453)
I reactivated the service and it started working again. My question is has someone faced this issue? If so what is the best way to handle such exception?
Other interesting fact is the same exception happened on all the hosts of the service at nearly the same time. Can this be because of an SQS outage or are such transient connection failures expected?

Connection refused while web scraping using HTMLUnit

I am trying to build a java application to scrape a website using HTMLUnit. After extracting some data the application encounters following exception -
java.lang.RuntimeException: org.apache.http.conn.HttpHostConnectException: Connection to siteURL refused.
If I run application again, it is able to extract some data again before failing with the same exception. Probably the server see lot of requests from same client IP and refuses connection for a request.
Also, when application encounters this problem, I am able to connect to the site using a browser.
How can I overcome this problem? In web scraping applications how are such problems approached and resolved?
This is how I debug such issues :
Download Fiddler
By default, fiddler listens on port 8888, all you have to do, is configure webClient to use fiddler as proxy & then all requests being sent can be seen (analyzed, modified & re-sent too) in fiddler.
client.getOptions().setProxyConfig(new ProxyConfig("127.0.0.1", 8888));
From what I can say from my previous experience is that the target site blocks after some-time, you can try adding a pause or rotating proxies & user-agents. You can also try clearing cookies.

ActionController::UnknownHttpMethod: CONNECT

I get the above error message in my log file sometimes, originates from actionpack-x.y.z/action_controller/request.rb.
What should I do in order to prevent a route on anything other than HTTP methods like get, put, delete ?
HTTP CONNECT requests are generally coming from proxy server or crawlers.
We can tackle the above issue by adding a filter in web server, so that those requests are denied. So it is more about tuning the web server than doing in the ruby application.
Example: http://www.webhostingtalk.com/showthread.php?t=461915

Resources