popmail-conduit.h
00001
#ifndef _KPILOT_POPMAIL_CONDUIT_H
00002
#define _KPILOT_POPMAIL_CONDUIT_H
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
#include <stdio.h>
00038
00039
#include "plugin.h"
00040
00041
class KSocket;
00042
00043
class PilotRecord;
00044
class PilotDatabase;
00045
00046
class PopMailConduit :
public ConduitAction
00047 {
00048
public:
00049 PopMailConduit(KPilotDeviceLink *d,
00050
const char *n=0L,
00051
const QStringList &l=QStringList());
00052
virtual ~PopMailConduit();
00053
00054
enum RetrievalMode {
00055 RECV_NONE=0,
00056 RECV_POP=1,
00057 RECV_UNIX=2 } ;
00058
enum SendMode {
00059 SEND_NONE=0,
00060 SEND_SENDMAIL=7,
00061 SEND_KMAIL=8,
00062 SEND_SMTP=12
00063 } ;
00064
00065
protected:
00066
virtual bool exec();
00067
00068
static PilotRecord *readMessage(FILE *mailbox,
00069
char *buffer,
int bufferSize);
00070
00071
protected:
00072
void doSync();
00073
void doTest();
00074
00075
00076
00077
00078
int sendPendingMail(
int mode );
00079
int sendViaSendmail();
00080
int sendViaKMail();
00081
int sendViaSMTP();
00082
void writeMessageToFile(FILE* sendf,
struct Mail& theMail);
00083 QString getKMailOutbox() const;
00084
00085
00086
00087
00088
00089
int retrieveIncoming(
int mode);
00090
int doPopQuery();
00091
int doUnixStyle();
00092
00093
00094
00095
int getpopchar(
int socket);
00096
int getpopstring(
int socket,
char * buf);
00097
int getpopresult(
int socket,
char * buf);
00098
00099
00100
00101
00102 typedef enum { POP_DELE=16 } retrieveFlags ;
00103
void retrievePOPMessages(KSocket *,
00104
int const msgcount,
00105
int const flags,
00106
char *buffer,
int const buffer_size);
00107
00108
static char* skipspace(
char * c);
00109
static void header(
struct Mail * m,
char * t);
00110
00119
static int skipBlanks(FILE *,
char *buf,
int size);
00120
00135
static int readHeaders(FILE *,
char *buf,
int size,
00136
struct Mail *,
int expectFrom);
00137
static int readBody(FILE *,
char *buf,
int size);
00138
00139
private:
00140
PilotDatabase *fDatabase;
00141 };
00142
00143
#endif
This file is part of the documentation for kpilot Library Version 3.2.2.