I've updated CF9 mail server settings but my application is still trying to use the old mail server - coldfusion

We changed our exchange mail server so I've update the mail server in CF9 admin settings. I've verified that it can connect to the new server and it can. But when I test sending an email it keeps failing because it is trying to connect to the old mail server. When I look in the mail.log it clearly lists the old server as the SMTP host it is trying to connect to and it fails.
Where else could CF9 be pulling the old mail server from?
Are there other places where my predecessor could have coded in the old mail server?
I've looked in various .cfm files for any reference to the old exchange server but have found none.
Thanks,
Dan
Ok so what I ended up doing was to actually hard code the new server into the one location we are actually using a cfmail tag. That fixed it. Not much of a chance this app will ever do anything other than this so should be fine.
Dan

Related

Connecting localhost to a remote dev server (CORS, same-site, secure and other headaches)

I'm currently working on a React project. The development server (Bottle/Python) for the project is hosted remotely, and my React dev-server is localhost. Part of the authentication process for the application involves setting a cookie on login, but because of same-site and secure rules that cookie is not being set, meaning that my dev frontend can't access any of the data that it needs.
Myself and the server engineer have added SameSite=None to the cookie as well as secure, but because my localhost is not https the cookie is still not being stored properly (I get the error message "this Set-Cookie" was blocked because it had the "Secure" attribute but was not received over a secure connection").
There are no issues when the app is deployed because everything is on the same domain, but for now we're stuck - we've been trying to solve the issue for several hours but can't seem to get it.
My question is - what is the best development practice if you need to access a non-local development server, but can't actually just have your own version of the server running on your local machine?
Do I:
Need to make my localhost https somehow?
Need to make the dev-server domain https?
Need to install the server locally because there's just no way to do this?
Apologies if this is a noob question, it would be great to have some advice.
Many thanks.
The short answer is:
No
Yes
No
You can run your app on http://localhost:port. Assuming response from your dev server has in response headers Set-Cookie of the cookie which has Secure flag, your dev server URL has to be https in order to have the cookie accepted by the browser.
I have this setup and it works just well.
Regarding CORS (as mentioned in the title of the question): you have to have you server configured to accept credentials and to have allowed origins configured. The client app when doing XHR request has to have withCredentials:true. Check the points 2 and 3 in my post for details.
Also note, that if you are using Chrome you can bypass for development purposes the requirement to have SameSite=None and Secure by disabling the flag "Cookies without SameSite must be secure", also detailed here

Why after deploying django docker container, emails getting sending failed?

I was working on django and everthing was working fine on my local machine as well as on heroku.
But than i deodorize my django project and it was working fine locally till now. now i have depolyed this container on my dedicated server and than i came to know that my emails was failing after deployment.
Can anybody have idea why my dedicated server is not sending mails?
I am sending mails using smtp protocol.
Any help or suggestion will be highly appreciated.
Thanks.
I'm assuming you're connecting to your local SMTP server to send out those emails.
The problem is that your Django is trying to use localhost:25 to send out the emails and in your docker there's no SMTP server. Docker has it's own network, and you can see what are the interfaces available by executing
ifconfig
To solve your issue, you should tell django to use your host SMTP server (and not localhost). Moreover you should tell your local SMTP server to accept emails coming from the docker network.

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.

Coldfusion 9 cfexchangecalendar exchange server outlook 2007

CF9
Exchange server 2007 (hosted)
I am trying to add a calendar event for a user on our hosted exchange server. I'm getting the error ;
Unable to connect to the Exchange server using HTTP/HTTPS protocol.
HTTP response code : 400
The code is;
<cfexchangeCalendar action="Create"
username="EXCH016\ron_domain"
password="password"
mailboxname="ron"
server="https://owa016.msoutlookonline.net/owa"
Protocol="https"
formbasedauthentication=true
formbasedauthenticationURL="https://owa016.msoutlookonline.net/owa/auth/owaauth.dll"
Event="#sEvent#"
result="theUID">
#theUID#<br>
I know I can contact the server using the following;
<cfhttp URL='https://owa016.msoutlookonline.net/owa' result='res' >
<cfdump var="#res#">
<cfoutput>#res.filecontent#</cfoutput>
I get the form that requests email address and password.
I've been working on this problem for some time now. I can go to the owa page via browser and log in. At this point I'm at a loss on how to debug the problem.
I have had the same type of problem in the past, when one of my customers went from Privately Hosted and Run vs Hosted Solutions.
Although, I never used the formbasedauthentication method when authenticating, maybe this bypasses some of my issues.
The big thing we had issues with is that most Providers don't all WebDav access on their servers.
Since you are getting a 400, bad request, this is what I would look for first.
http://livedocs.adobe.com/coldfusion/8/htmldocs/help.html?content=cfexchange_3.html talks about what CF needs to connect to Exchange, maybe see if the support staff can confirm the setup.
Since you are using HTTPS, have you added the Cert into the JRE cert Store?
Sorry this probably isn't much help, but I hope it helps.

Axis2 Client: avoid to maintain sessions

I have a big problem in Axis2 client implementation.
I've generated the source code of my client (Java) through the Intellij Idea IDE from a wsdl file.
I use the client to connect in https with a webserver using a smartcard, in which is stored the certificate for the authentication.
Using the first smartcard, everything works fine: I receive data from the webservice in the right way. Using the second smartcard, I receive data related to first smartcard owner.
Analyzing the logs of my application, I've noticed that, at the end of the first communication, a session has been saved. So, in the second connection, the authentication is not needed and data is related to first smartcard owner.
Googling around, I've found that, to avoid to maintain sessions in Axis2 clients, it is needed to set the following:
currentStub._getServiceClient().getOptions().setManageSession(false);
But it does not work properly.
Anyone has suggestions?
I know, this question is quite old.
You could just create a new Stub. This should not have any reference to the old connections/sessions.