Webmin server, PHP imap_open() not working properly - imap

My client use webmin server for using the CRM which is developed by me, in mailbox module, if user choose a email which they want to open in a mail box every thing is perfectly sometimes, if emails are listed after viewing one email some time view of email return empty content, like this randomly giving request is successfully return a IMAP value, some requests return a empty value,
but in my local machine i have Develop my application mailbox module in windows OS based machine, using xamp server, here i get a exact result for each and every request,
now i find why it's happen, the reason is in my clients webmin server couldn't open a imap stream properly, in imap_open method all arguments are real, but it return random connection failed message from imap_errors method,
i don't understand why it is happening, and also i can't fix this
So please assist me, helping hearts really appreciateable,

Related

QuickBooks RDS client (or maybe server) is throwing Public key exchange error: Object already exists

I am working with intuit SDK tech support on this without much luck. I was hoping someone here might know what object this error might be referring to.
I am basically sending a request from one computer to QuickBooks on another machine via PowerShell and Remote Data Sharing (RDS) Client/Server provided in the QuickBooks SDK. The relative portion of the Powershell script looks something like this..
$myQBXMLRP = New-Object -com QBXMLRP2.RequestProcessor
$myQBXMLRP.OpenConnection2("qb4D","CCFolioPro",2)
The first line instantiates the COM object QBXMLRP2.RequestProcessor. The second line opens a connection with QuickBooks. RDS Client on the local machine receives the OpenConnection request and passes it on to the RDS Server on the machine where QB resides which in turn opens the connection with QB. The second line is throwing the following error...
Exception calling "OpenConnection2" with "3" argument(s): "Public key exchange error: Object already exists
Reading here in stackoverflow and elsewhere via google I see that this error occurs to other programmers not dealing in any way with QuickBooks, so I am hoping somone here might be able to help me figure out how to fix the problem.
I have QB/RDS working fine prior to this installation. So I know it should work as is. Something is hung up on this computer, the server computer, or ????
Thanks,
John
Your mileage may vary. I cleared the following file, reboot and reinstall RDS then things are back to normal. It was on a Windows Server 2012 but you get the idea. You need to change your view options so these folders are not hidden. Worths a shot, and I hope this helps.
Clear one of the key files created by RDS by prior runs or installations

A web app that connects to local server; is that safe?

I am writing a rails app that comes with a local program for the user to run. That program creates a nodeserver which connects to the user's browser through websockets. Upon certain actions by the user in the browser, a signal will be sent through the socket to the local node server which will execute a pre-defined command on the user's local machine. The command differs depending on the user's specific action in the browser, but there is no way for the user to send custom data to the local node server(ie different actions send pre-defined information to the local server). I was wondering if there are security implications to doing this, and what some possible exploits might be if so.
I had troubles working on a Chrome Extension communicating with a local environment with this:
Maybe you can have problems with HTTP access control (CORS) and gem CORS could fix if that happens http://rubygems.org/gems/cors
Another possible problem may be "406 not acceptable" because of CORS.

Running a PHP script on email arrival in an IMAP Server

I'm trying to implement a webmail in PHP. I would like to write a PHP CLI script which is run on every email arrival to store some parts of (not all of) incoming email into database for search purposes. Then when the user finished searching and chose an email to show, a connection is made to mail server to retrieve the complete email. In order to implement this scenario I need to make some sort of connection among emails within database and mail server.
Since my knowledge of working with mail servers is limited to Zend Framework's API, what I believe I need in order to retrieve an email from an IMAP server is a message number or a message unique id (this later one seems not to be supported by all mail servers).
To this point, I've managed to find .forward (and some other ways) to introduce my PHP CLI script to MTAs to be run on every email arrival. This way I can store emails to database. But this won't do since message unique id is created by MDA so MTA do not know of it and they can not provide it to me. This means I can not find emails later when I want to retrieve them from mail server.
At last, here's my question: Is there a way to introduce a PHP CLI script to a MDA for emails' arrival? If this is dependent on the mail server, which servers do support this and how? My personal choice would be Dovecot or Courier, but any other mail server would do as well.
This is tricky -- there are many ways on how to setup delivery. Some of them work with the underlying mail store directly, bypassing your IMAP server altogether, while others use e.g. Dovecot's facilities.
Have you considered building on top of the notify plugin which ships with Dovecot?
It seems like it's impossible to introduce such a PHP CLI script to IMAP server (at least I'm sure of Dovecot). Anyway, the work around I found for this problem is to use my own PHP script to insert the new mails into IMAP server and retrieve their id's and then store the id in database for future references. To be clear, email are given to my PHP CLI script by MTA, not MDA. As I said before this is done easily using .forward file.
[UPDATE]
Unfortunately it seems this solution can not be implemented as well. The way to insert a new email to IMAP server is APPEND command, and to have the UID of the recently added mail server must support UIDPLUS extension. Neither Dovecot nor Courier supports this extension at the moment! If they did it seems the server would return the UID with a APPENDUID response.
[UPDATE]
It is my bad since Courier does support UIDPLUS. So this solution is valid and the one I'm going to implement.

RFB reference implementation?

I'm writing an RFB server. I was wondering if anybody knows of an RFB reference client.
Currently, I run RealVNC and ask it to connect to my RFB server, and it works fine. However, RealVNC is intended to give a good end-user experience. It is not intended to test every possible valid combination of protocol features. So I know that the features which RealVNC uses are implemented correctly, but I have no idea whether the features that RealVNC doesn't use are working at all. But it would be really useful if I could check somehow.
Any suggestions?
(I could, of course, write my own RFB client as well. But that wouldn't really prove anything. If something doesn't work, I can't tell if it's the client or the server that's broken. And if everything does work, that still doesn't mean that both ends implement RFB correctly, just that each has the same bugs as the other.)
This may help you out a bit. I use to use TCP/IP builder to make various hexcode messages(pointer event, key event, cut text) store them in a text file. Now i Used to connect the tcp/ip builder with my rfb/vnc server.
The RFB server you wrote will now respond to this TCP/IP builder like any RFB Client and you can now verify each and every scenario ( incomplete payload, wrong message number, extra payload, message out of sequence etc)
Make sure you select "Parse Ascii" option if your server doesnt
respond with rfb version number info once you connect to your
server.
In order to make the the intial message you can record wireshark logs for a successful proper rfb session between your rfb server and real vnc and then use those messages to test your RFB server with TCP/IP builder.
The RFB version info can be send like this "RFB 003.008" , but
for the rest of the message you will have to use hex symbol like
it is seen network logs (pcap/wireshark)
example : this is how to send Framebuffer request message to your
server (non-incremental for 800 x 480)
0x030x000x000x000x000x000x030x200x010xe0

SOAP server couldn't work correctly behind some proxy/firewall

I have a SOAP server/client application written in Delphi XE working fine for some time until a user who runs it on Windows 7 x64 behind a corporate proxy/firewall. The application sends and receives TSOAPAttachment object in the request.
The Problem:
Once the first request from this user is received and processed, the server could not process any request (from any user) successfully coming after this.
The server still response to the request, but the SOAPAttachment of the request
seems corrupted after the first one from this user, that's why it couldn't process the request successfully.
After putting may debug logs to the server, I noticed the TSOAPAttachment.SourceStream in the request's parameter become inaccessible (or empty), and TSOAPAttachment.CacheFile also empty. Therefore whenever trying to use the SourceStream, it will return Access Violation error.
Further investigation found that the BorlandSoapAttachment(n) file generated in the temp folder by the first request still exist and locked (which should be deleted when a request is completed normally), and BorlandSoapAttachment(n+1) files of the following request are piling up.
The SOAP server will work again after restarting IIS or recycle the application pool.
It is quite certain that it is caused by the proxy or the user’s networks because when the same machine runs outside this networks, it will work fine.
To add more mystery to the problem, running the application on WinXP behind the same proxy have no problem AT ALL!
Any help or recommendation is very appreciated as we have stuck in this situation for some time.
Big thanks in advance.
If you are really sure that you debugged all your server logic that handles the attachments to attempt do discover any piece of code that could failed specifically on Windows 7, I would suggest:
1) Use some network sniffer Wireshark is good for this task, make two subsequent requests with the same data/parameters values, and compare the HTTP contents. This analyze should be done both in the client (to see if the data is always leaving the client machine with the same content) and also in the server, to analyze the incoming data;
2) I faced a similar situation in the past, and my attempts to really understand the problem was not well succeed. I did workaround the problem sending files as Base64 encoded strings parameters, and not using the SOAP attachments. The side affect of using Base64 its an increase of ~30% in the data size to be sent, and this could be significant if you are transferring large files.
Remember that SOAP attachments create temp files in the server, and Windows 7 has different file access rules than Windows XP. I don't know if this could explain the first call being processed ant the others not, but maybe there are something related with file access.
Maybe it is UAC (User Access Control) problem under Win 7. Try running the client in win 7 "As Administrator" and see if it is working properly.

Resources