Duane, May I suggest you use the \r\n all the time? Try it with the other servers and I bet they will work, too! If it does, then you can remove the exception handling for IMail and be platform independent!
Some servers may allow the use of either, but everything I've read in RFCs about SMTP, POP3, IMAP, FTP and other similar protocols tells me to send <CRLF> (or \r\n) as the terminating sequence of a command line. You just found out that some servers are just more strict about this requirement than others. I remember another programmer who thought he knew better and assured me, more than once, he was sending <CRLF> and when he sent me his code (which used \0xx form, instead) I did the conversion and guess what? He was sending <LFCR> instead. This is _not_ the same!! Once he reversed the characters, his code worked, too! I learned this long ago in my RS232 communication days (yea, I wrote code to communicate with hardware and collect measurement data) and it is not a lesson I've forgotten even though many years have passed. Somehow, I don't think you will forget now, either, welcome to the club... Dan Donnelly -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Duane Hill Sent: Friday, March 18, 2005 4:18 PM To: [email protected] Subject: Re: [IMail Forum] IMAP Connection Using Perl [Revisited] Replying to my own message. Oh, well. First off, you have to believe me. I ABSOLUTELY tried what was suggested in the previous message thread by Dan Donnelly of substituting '\r\n' for '\n' and it failed. Upon installing IMAP::Simple and successfully connecting, I pulled the Perl module apart and discovered it was using the '\r\n' sequence as well. I then desided, oh well, I'm ready to try it again. LOW and behold! It worked. So, I guess my script will have to look for the IMAIL greeting in the connection response and use '\r\n' while ALL of the other servers I've connected to use just '\n'. Most of what I do is developed with a cross-platform mind set. I have thus removed the test account that could be found in the attached packet trace file. Thanks to Eric Shanbrom for making me rack my brain and Dan Donnelly for the suggestion in the previous thread. Dan, I absolutely don't know why it didn't work before and now it is. Hmm... Oh, well. On Friday, March 18, 2005 at 7:06:27 PM, [EMAIL PROTECTED] confabulated: > On Friday, March 18, 2005 at 5:43:28 PM, [EMAIL PROTECTED] confabulated: >> I would have to look at this line: >> print $REM_IMAP "x LOGIN [EMAIL PROTECTED] password\n"; >> What are you populating the "x" variable with. > This is not a variable. You have to prefix ALL IMAP commands issued with something. That > something is then used to determine when the server has completed the IMAP command. The > server, upon completion, will respond with: > OK - login completed, now in authenticated state > NO - login failure: user name or password rejected > BAD - command unknown or arguments invalid > This is the example RFC3501 gives ('C' is client and 'S' is server and notice the LOGIN > command is prefixed with 'a001'): > C: a001 LOGIN SMITH SESAME > S: a001 OK LOGIN completed >> This needs to be a positive integer..Is that happening? > According to the examples in RFC3501, this would not be the case (I'm at least assuming by the > examples). >> I would like to see the trace from ethereal.... > I'm going to be trusting. Attached to this message is the capture of the communication between > two servers over IMAP that fails the LOGIN. The account used to login is a test account that I > set up. >> I am going to be out of the >> office and out of touch until at least tomorrow but will try to look at it >> sometime this weekend...You can send the traces to me directly if need be but >> I'm sure someone else here can look at them as well >> Eric S To Unsubscribe: http://www.ipswitch.com/support/mailing-lists.html List Archive: http://www.mail-archive.com/imail_forum%40list.ipswitch.com/ Knowledge Base/FAQ: http://www.ipswitch.com/support/IMail/
