diff --git a/src/add-ons/mail_daemon/inbound_protocols/pop3/pop3.cpp b/src/add-ons/mail_daemon/inbound_protocols/pop3/pop3.cpp index 408addcae5..5471035374 100644 --- a/src/add-ons/mail_daemon/inbound_protocols/pop3/pop3.cpp +++ b/src/add-ons/mail_daemon/inbound_protocols/pop3/pop3.cpp @@ -7,28 +7,22 @@ //! POP3Protocol - implementation of the POP3 protocol -#include -#include -#include -#include -#include -#include +#include "pop3.h" + #include -#include -#include +#include +#include +#include #include -#ifndef HAIKU_TARGET_PLATFORM_BEOS // These headers don't exist in BeOS R5. +#include +#include + +#ifndef HAIKU_TARGET_PLATFORM_BEOS + // These headers don't exist in BeOS R5. #include #include #endif -#include -#include -#include -#include - -#include - #if USESSL #include #include @@ -37,7 +31,16 @@ #include "md5.h" #endif -#include "pop3.h" +#include +#include +#include + +#include +#include +#include +#include + +#include #define POP3_RETRIEVAL_TIMEOUT 60000000 #define CRLF "\r\n" @@ -206,8 +209,12 @@ POP3Protocol::Open(const char *server, int port, int) } if (strncmp(line.String(), "+OK", 3) != 0) { - error_msg << MDR_DIALECT_CHOICE(". The server said:\n", - "サーバのメッセージです\n") << line.String(); + if (line.Length() > 0) { + error_msg << MDR_DIALECT_CHOICE(". The server said:\n", + "サーバのメッセージです\n") << line.String(); + } else + error_msg << ": No reply.\n"; + runner->ShowError(error_msg.String()); return B_ERROR; } @@ -623,14 +630,8 @@ POP3Protocol::ReceiveLine(BString &line) line += (char)c; } } - } else { - status_t error = errno; - fLog = "POP3 "; - fLog << strerror(error) << "."; - - runner->Stop(true); - return error; - } + } else + return errno; return len; } diff --git a/src/add-ons/mail_daemon/inbound_protocols/pop3/pop3.h b/src/add-ons/mail_daemon/inbound_protocols/pop3/pop3.h index 8dd472e037..c3f777450d 100644 --- a/src/add-ons/mail_daemon/inbound_protocols/pop3/pop3.h +++ b/src/add-ons/mail_daemon/inbound_protocols/pop3/pop3.h @@ -1,17 +1,23 @@ -#ifndef ZOIDBERG_POP3_H -#define ZOIDBERG_POP3_H -/* POP3Protocol - implementation of the POP3 protocol -** -** Copyright 2001-2002 Dr. Zoidberg Enterprises. All rights reserved. -*/ +/* + * Copyright 2001-2002 Dr. Zoidberg Enterprises. All rights reserved. + * Copyright 2007, Haiku Inc. All Rights Reserved. + * + * Distributed under the terms of the MIT License. + */ +#ifndef POP3_H +#define POP3_H + -#include #include +#include +#include + #include "SimpleMailProtocol.h" + class POP3Protocol : public SimpleMailProtocol { - public: +public: POP3Protocol(BMessage *settings, BMailChainRunner *status); ~POP3Protocol(); @@ -50,4 +56,4 @@ private: #endif }; -#endif /* ZOIDBERG_POP3_H */ +#endif /* POP3_H */