MS Exchange IMAP login returns "BAD Command recieved in Invalid state" - email

I have an IMAP client (Perl, Mail::IMAPClient) connecting to a MS Exchange server which, upon login, receives the error "1 BAD Command received in Invalid state." This same IMAP client works in a number of other environments with no errors, and certainly not errors immediately at login!
I've had trouble determining the source of the error and at this point I'm inclined to think the customer's Exchange server is misconfigured or there's some firewall or packet manipulation shenanigans afoot.
I was able to take a packet capture that really looks normal other than the error. After the TCP handshake this is the whole IMAP conversation, followed by the TCP hangup.
No. Time Source Destination
4 0.010228000 (server) (client)
Internet Message Access Protocol
Line: * OK The Microsoft Exchange IMAP4 service is ready.\r\n
No. Time Source Destination
5 0.012680000 (client) (server)
Internet Message Access Protocol
Line: 1 LOGIN (username) (password)\r\n
Request Tag: 1
Request Command: LOGIN
Request: LOGIN (username) (password)
No. Time Source Destination
6 0.017559000 (server) (client)
Internet Message Access Protocol
Line: 1 BAD Command received in Invalid state.\r\n
Response Tag: 1
Response Status: BAD
Response: BAD Command received in Invalid state.
Am I right in assuming the problem is on the IMAP server's end?

You need to send a CAPABILITY command first, so that you can check if the server has LOGINDISABLED (which it probably does, hence your error).

Related

Socket - java proxy Packets separated once send to client

I have a client Server configuration with one connection, the server cannot process the requests received in parallel, it processes them in series, to overcome this problem, we developed a proxy server (installed between client and server) to receive request open connection with the server ==> send request server ==> send response to the client ==> close connection.
The problem we have is this, the response is sent divided on 2 part, we did a TCPDUMP on the port, we see that the request is sent devised on two part one with a length 1 and the second with à length 33
We don't know if it's a configuration on the server or on the network
Can some one help us ?

SMTP errors from web server

I am having issues with SMTP from one of my web servers. I've verified firewall connectivity over port25 to the SMTP relay and the exchange servers is good to go. I can hit the SMTP relays and exchange server from my web server via telnet. Whenever I drop a mail in Pickup it sits in the queue.
In Event Viewer I get:
Message delivery to the host 'IPADDDRESS' failed while delivering to the remote domain 'MYDOMAIN' for the following reason: The connection was dropped by the remote host.
I checked SMTPDiag and it comes back:
Error: Expecting "220". Server is not accepting connections.
Failed to submit mail to "server.domain.com"
I checked and my connection control is set to allow and the domains are listed in SMTP.. I am losing my mind trying to figure out why mail is failing at this point..
Are you hitting a rate limit or is your outbound ip on a blacklist? Try the blacklist search here: https://mxtoolbox.com/supertoolmobile.aspx

TortoiseSVN A request to send or receive data was disallowed because the socket is not connected

Who can show me the reason error TortoiseSVN, when I connect SVN-Repo to update resource
The error detail:
I has already checked the
SVN server is running
Ping to IP server ok
I attached message error:
Error: Unable to connect to a repository at URL 'https://........'
Error running context: A request to send or receive data was
disallowed because the socket is not connected and (when sending on a
datagram socket using a sendto call) no address was supplied.
Hope Everyone help me show the way to fix it.
I have already found the problem, my server svn disabled svn-ports
Error running context: A request to send or receive data was
disallowed because the socket is not connected and (when sending on a
datagram socket using a sendto call) no address was supplied.

Disconnects in FIX connections in local network

I have a FIX server and FIX client implementing FIX4.4 running on the same network. I use QuickFIX C++ engine. Altough they are on the same network, sometimes they disconnect. In the FIX server's event logs:
20140612-01:21:30.000 : Sent test request TEST
20140612-04:11:56.000 : Sent test request TEST
20140612-07:05:26.029 : Sent test request TEST
20140612-07:05:26.029 : Socket Error: An established connection was aborted by the software in your host machine.
Means HEARTBIT messages are failed to send/recv.
What can be wrong? I have a regular setup and nothing special..
Thanks
while the client connection was accepted by the server, it doesn't look like you then achieved "logon". First you connect, then you logon. You need to make a logon request after you connect. Look at the initial FIX messages sent between client and server.

PHP - IRC "QUIT" not working properly

CHANGE:
I have determined the problem has nothing to do with the coding. However the problem stays still, as this appears to be caused by IRC, I'm still in search of the reason.
The server I'm connecting uses two kinds of PING requests:
One is asked upon connecting to server, and it's in format of alpha-numeric values of 8 characters.
Example: PING :EA0E9275.
And another one is after the server sends out MOTD, joins channels, completes "End of /NAMES list". Then after "n delay" server sends me a ping request with current connected host as it's value.
Example: PING :irc.ams.nl.euirc.net
If I send the command "QUIT :Quit Message" before I reply the host PING request, server ignores the QUIT message, and instead, it quits with a server-filled status message similiar to "Client Exited" message.
Example: ERROR :Closing Link: Nick[IP.ADD.RE.SS] (Life is too short...)
However if I send the same command after responding to host PING request, my QUIT gets processed as it should.
Example: ERROR :Closing Link: Nick[IP.ADD.RE.SS] (Quit: Quit Message)
I've checked in the RFC, and found this on QUIT section:
If, for some other reason, a client connection is closed without the client issuing a QUIT command (e.g. client dies and EOF occurs on socket), the server is required to fill in the quit message with some sort of message reflecting the nature of the event which caused it to happen.
Also, if still in need to see the partial code I'm using to accomplish this, you can check it here. However, this is a common issue with mIRC the IRC client.
Basic scheme
Connecting to server...
Connected!
Server waiting NICK/USER info...
Server received NICK/USER info, waiting for alphanumeric PING reply...
Server received alphanumeric PING reply, sending MOTD.
End of MOTD, sending JOIN to join channels...
Joined to channels, NAMES list for channels have been requested.
End of NAMES list.
Receiving active channel(s)/server data.
If sent QUIT command, server will ignore the usual QUIT, and will send "Closing Link" by server default as status quit(Life is too short...).
Server is doing an alive-check, received host PING(irc.ams.nl.euirc.net), server is waiting reply...
Sent server the reply.
If sent QUIT command, server will process QUIT command as user-level, the usual way, and will send "Closing Link" by user-specified message or empty.((QUIT: User Message) or (QUIT: ))
Let's review your code for a bit:
When I made my IRC bot, I explode()ed the string from the server into words (splitting by space), you can then refer to words:
if ($words[0] == "PING") { reply("PONG :" . $words[1]); }
Always PONG immediately after PING, and reply with the same message as the server.
If the second is fulfilled, you should never have that problem of the server waiting a PING, because you'll immediately answer. A client is expected to honor the PING PONG commands from the server, otherwise the server would think of it as offline (yes, even if you send anything else, the server expects PONG).