andrei@versabanq.com: wvdbusd: handle *all* messages addressed to o.f.D.
[wvapps.git] / retchmail / wvpopclient.h
blobdeb1d2ef3a8d5badc834718cd781286c6e5be0f7
1 /*
2 * Worldvisions Weaver Software:
3 * Copyright (C) 1997-2003 Net Integration Technologies, Inc.
5 * Avery's insanely fast alternative to Fetchmail -- Pop3 Client
7 * This code is LGPL - see the file COPYING.LIB for a full copy of the
8 * license.
9 */
10 #include <vector>
12 #include "wvsendmail.h"
13 #include "wvstreamclone.h"
14 #include "wvstring.h"
15 #include "wvhashtable.h"
16 #include "wvlog.h"
18 #ifndef WVPOPCLIENT_H
19 #define WVPOPCLIENT_H 1
21 DeclareWvDict(WvSendmailProc, int, count);
23 class WvPopClient : public WvStreamClone
25 public:
26 WvSendmailProcDict sendprocs;
27 WvString username, password, deliverto, mda;
28 WvLog log;
29 long res1, res2;
30 int next_req, next_ack, sendmails;
31 bool flushing, apop_enable, apop_enable_fallback, explode;
32 WvStringList trace;
34 bool safemode;
35 int max_requests;
36 WvStringList safe_deletes;
38 bool ignorerp;
40 struct MsgInfo
42 int num; // message number
43 long len; // message length (bytes)
44 bool sent, // message _fully_ transferred to sendmail
45 deleted; // server acknowledged DELE command
46 WvString err; // error message
47 int deletes_after_this; // number of DELE messages following this RETR
49 MsgInfo()
50 : num(0), len(0), sent(false), deleted(false),
51 deletes_after_this(0)
55 std::vector<MsgInfo> mess;
57 // note: we take possession of 'conn' and may delete it at any time!
58 WvPopClient(WvStream *conn,
59 WvStringParm acct, WvStringParm _password,
60 WvStringParm _deliverto, WvStringParm _mda,
61 bool _flushing, bool _apop_enable,
62 bool _apop_enable_fallback, bool _explode,
63 bool _safemode, bool _ignorerp);
64 virtual ~WvPopClient();
66 bool never_select;
67 virtual void pre_select(SelectInfo &si);
68 virtual bool post_select(SelectInfo &si);
69 virtual void execute();
71 void cmd(WvStringParm s);
72 void cmd(WVSTRING_FORMAT_DECL)
73 { return cmd(WvString(WVSTRING_FORMAT_CALL)); }
74 bool response();
76 void send_done(int count, bool success);
78 private:
79 WvString acctparse(WvStringParm acct);
80 bool not_found;
83 #endif // WVPOPCLIENT_H