mailfilter  0.8.3
pop3.hh
Go to the documentation of this file.
1 // pop3.hh - source file for the mailfilter program
2 // Copyright (c) 2003 - 2009 Andreas Bauer <baueran@gmail.com>
3 //
4 // This program is free software; you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published by
6 // the Free Software Foundation; either version 2 of the License, or
7 // (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
13 //
14 // You should have received a copy of the GNU General Public License
15 // along with this program; if not, write to the Free Software
16 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
17 // USA.
18 
19 #ifndef POP3_HH
20 #define POP3_HH
21 
22 #include "header.hh"
23 #include "protocol.hh"
24 
25 using namespace std;
26 
27 // True, if the server replied and its status message was anything,
28 // but an error.
29 #define REPLY_OK ((conn->c_read () > 0 && conn->c_reply ()) ? \
30  (((conn->c_reply ()->c_str ())[0] == '+') ? true : false) \
31  : false)
32 
33 // This macro is similar to REPLY_OK, except it sets a flag for c_read
34 // in order to tell the function that an entire message header is
35 // about to be received. Further comments inside socket.cc:c_read().
36 #define HEADER_OK ((conn->c_read (true) > 0 && conn->c_reply ())? \
37  (((conn->c_reply ()->c_str ())[0] == '+') ? true : false) \
38  : false)
39 
40 class POP3 : public Protocol
41 {
42 private:
43  int invoke_msg_parser (const string*,
44  const Header*) const;
45 public:
46  bool login (const char*,
47  const char*,
48  const unsigned int) const;
49  bool logout (void) const;
50  int remove_msg (const unsigned int) const;
51  int status (void) const;
52  int scan (void) const;
53 };
54 
55 #endif
Definition: protocol.hh:32
Definition: pop3.hh:40