CFIMAP Timing out - coldfusion

I am trying to connect to Gmail through CFIMAP and I am getting a connection timed out error. This code works on my dev environment but not on production. I have also opened a ticket with my ISP just in case.
This is the error
An exception occurred when setting up mail server parameters.
This exception was caused by: javax.mail.MessagingException: Connection timed out: connect; nested exception is: java.net.ConnectException: Connection timed out: connect.
And this is my code:
<cfimap
server = "imap.gmail.com"
username = "surveysemail#signatureforum.com"
action="open"
password = "test"
connection = "mail.test.com"
timeout = 120>
I had the secure parameter in before and also the port but I removed them while testing different options. Also, I just added the timeout parameter but did not work either.

GMail is particular as to the types of connection it receives. Generally this chalks up to a security issue because the server you're trying to log into Gmail from (at your ISP) is in a different location and has never logged in from the browser on that machine.
There's a couple of things you can do here:
First, If you have RDP access to the server at your ISP, you can log in to Gmail from the server, then try again.
If that doesn't work, review the "Device activity and notifications" page on the Gmail account to see if Google is blocking access from the server. (https://myaccount.google.com/security?hl=en&pli=1#activity)
Give that a shot... most likely Gmail is seeing the activity coming from your server as erroneous and is blocking it from that front.

Related

Sending mail via amazon aws

I trying to send an email though amazon AWS
I have confirmed that I am able to send a email through postie like this:
postie.exe -host:email-smtp.eu-west-1.amazonaws.com -port:587 -ssl -tls -esmtp -to:barn.fleischer#gmail.com -from:barn.fleischer#gmail.com -s:"testmail" -msg:"This is a test" -user:XXXX -pass:YYYY
But when I try to send via System.Net.Mail
<mailSettings>
<smtp from="barn.fleischer#gmail.com">
<network host="email-smtp.eu-west-1.amazonaws.com"
port="587"
userName="XXXX"
password="YYYY"
enableSsl="true"/>
</smtp>
</mailSettings>
Unhandled Exception: System.Net.Mail.SmtpException: Failure sending mail.
---> System.Net.WebException: Unable to connect to the remote server
---> System.Net.Sockets.SocketException:
No connection could be made because the target machine actively refused it
Any suggestions?
Erik
Have you checked outgoing Windows firewall settings on that server? Make sure you have opened all standard ports eg 25 465 587 etc.

WSO2 API Manager - Sample PizzaShackAPI is not working

I am new to WSO2 API Manager. I followed the Quick Start Guide to learn by deploying sample PizzaShackAPI.
https://docs.wso2.com/display/AM210/Quick+Start+Guide
As I click "Try It Out!", I am not getting the correct response as mentioned in the guide.
I am getting the below response and there is no log in the console initially.
Response Code
0
Response Headers
{
"error": "no response from server"
}
After I added Self Signed Certificate in Firefox as Add Exception, I am getting the below error in the console,
[2017-03-01 15:06:51,309] ERROR - SourceHandler I/O error: An established connection was aborted by the software in your
host machine
java.io.IOException: An established connection was aborted by the software in your host machine
at sun.nio.ch.SocketDispatcher.read0(Native Method)
at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:43)
at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:223)
at sun.nio.ch.IOUtil.read(IOUtil.java:197)
at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:380)
at org.apache.http.nio.reactor.ssl.SSLIOSession.receiveEncryptedData(SSLIOSession.java:371)
I guess it may be a certificate configuration issue. Please help me to resolve this issue.
I tried with creating my own API. Facing the same issue.
Error message "error": "no response from server" on API console is mostly due to CORS error. Could you please check your browser console and see the error there, Most likely you will see error related to cors.
Note: these changes are not advised for production environment, for production environment you want to provide all relevant information instead of allow all (*)
To allow all headers and origin edit repository/conf/api-manager.xml and change values for following:
<Access-Control-Allow-Headers>*</Access-Control-Allow-Headers>
<Access-Control-Allow-Origin>*</Access-Control-Allow-Origin>
Second change to allow all host name and avoid any certificate host name validation.
Edit /repository/conf/axis2/axis2.xml and un comment HostnameVerifier and change value to AllowAll.
<parameter name="HostnameVerifier">AllowAll</parameter>
Restart API Manager and test again.

ColdFusion 10 Administrator - Secure DNS

We have a webserver connected to an old database. The old database server is end of life. When we set that up we did not need a secure connection. Now we have a new database on a new database server. Our IT department is requiring this to be a secure connection (even though it's an intranet).
Using ColdFusion Administrator I tried simply editing the URL of the server, but I get this error:
Connection verification failed for data source: xxxxxxxx
java.sql.SQLNonTransientConnectionException: [Macromedia][SQLServer
JDBC Driver]The SQL Server login requires an SSL connection. The root
cause was that: java.sql.SQLNonTransientConnectionException:
[Macromedia][SQLServer JDBC Driver]The SQL Server login requires an
SSL connection.
That's when I heard from my IT people that it needs to be a secure connection.
I have no idea how to do that, and Google didn't offer me any help, probably because I don't know what to search for.
Could one of you wonderful people please offer a suggestion on how to create a secure connection from ColdFusion Administrator 10 to MS SQL 2008?
Thank you

Can I restrict cfmail to only send mail from a given domain using cf admin

We have had issues with our server being used to send spam via cfmail to our remote SMTP server. I cannot see where it is occurring, but the emails are sent from a domain that is not one on our server.
Is there a way using ColdFusion administrator to specify that only emails showing as from someone#mydomain.com are sent to the SMTP host via the spool?
Thanks in advance,
Paul
It sounds to me like the <cfmail> side of things here is a red herring and you have got an open relay on your mail server. You seriously need to disable that immediately! If your SMTP server has to relay email for your CFML app then make sure it's not configured to relay everything, instead just for the IP address of the CF server, or for the credentials the CF server uses to connect to it.
If you don't know how to configure the relaying settings for your SMTP server, raise another question on serverfault.com asking how. Provide the exact details of your SMTP server, as well as the requirement to still allow relaying for the CF server.

SMTP client returning "unable to connect to remote server" - Amazon SES server

I am trying to connect to an amazon server for sending emails by editing by web.config
<system.net>
<mailSettings>
<smtp deliveryMethod="Network">
<network enableSsl="true" port="587" host="email-smtp.us-east-1.amazonaws.com" password="actual password" userName="actual username"/>
</smtp>
</mailSettings>
</system.net>
These settings are being set as evidenced below:
All I am doing in code is
SmtpClient client = new SmtpClient();
client.SendCompleted += SendCompletedCallback;
string userState = _id.ToString();
client.SendAsync(msg, userState);
but the error I get back is always
A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 184.73.222.29:587
Before I was using an internal mail server, but since this will be getting pushed to the amazon cloud, I will not have access to the local server. In the case of the local server, all i had to do was specify the ip address for host and it ran just fine.
There were three issues at hand:
1: The email address it was being sent from was not verified with Amazon, and neither was the recipient (verification of recipient only needed in sandbox mode)
2: The out port I was using, 587, is blocked by my company, which seems to be common practice
3: Using async can only be done when you specify the page uses async in the aspx "header"