Duane, I'm not much for reading the code part, but I see a '\n' in a couple of places. Does that mean it is the end of line indicator <NewLine>? If it does, I'd suggest it be \r\n (<CRLF>). If this fixes it, don't feel too bad, your not the first programmer to make this mistake! Want to try something? Try reversing the order and see that makes it not work either. Order is important, per RFC!
Dan Donnelly -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Duane Hill Sent: Wednesday, March 16, 2005 12:32 PM To: [email protected] Subject: [IMail Forum] IMAP Connection Using Perl I'm attempting to move some e-mail from a non-IMail server to an IMail v8.15hf1 server via a Perl script. IMAP connections succeed when variables below are hardcoded to three different non-IMail servers. However, the IMail server IMAP connection is giving back an error of "Can't login to remote IMAP: x BAD LOGIN Invalid Syntax". Is there anyone here that may know the reasoning? I've checked the logs on the IMail server and they don't have much to say. Just a connection error. The two log sections are directly below. The first is the attempt from the Perl script which fails and the one below is from a manual login via a telnet session. ----- Perl Failure ----- 03:16 17:13 IMAP4 (000007F8) sending "* OK IMAP4 Server (IMail 8.15) 03:16 17:13 IMAP4 (000007F8) sending "x BAD LOGIN Invalid Syntax 03:16 17:13 IMAP4 (000007f8) connection aborted ----- Manual Success ----- 03:16 17:19 IMAP4 (000002B4) logon success for duane ispdial.com from 209.207.1.210 03:16 17:19 IMAP4 (000002B4) sending "x OK LOGIN completed 03:16 17:19 IMAP4 (000002B4) logoff for duane R:0, D:0, P:0 03:16 17:19 IMAP4 (000002B4) sending "* BYE IMAP4 Server logging out 03:16 17:19 IMAP4 (000002B4) sending "x OK LOGOUT completed ----- Perl Script Section ----- $REM_IMAP = new IO::Socket::INET( PeerAddr => $rom_conf->{ArchiveDomain}, PeerPort => $rom_conf->{IMAPPort} ) || die "Can't connect to remote server via IMAP\n"; $REM_IMAP->autoflush(1); $IMAPResponse = <$REM_IMAP>; print $REM_IMAP "x LOGIN $rom_conf->{ArchiveAccount} $rom_conf->{ArchivePassword}\n"; do { $IMAPResponse = <$REM_IMAP>; } until($IMAPResponse =~ /^x /); die "Can't login to remote IMAP: $IMAPResponse\n" unless($IMAPResponse =~ /^x OK/); ----- Duane Hill Sr E-Mail Administrator http://www.yournetplus.com 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/ 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/
