-
Notifications
You must be signed in to change notification settings - Fork 0
/
POP3Utils.h
76 lines (68 loc) · 3.1 KB
/
POP3Utils.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
/*
* XMail by Davide Libenzi (Intranet and Internet mail server)
* Copyright (C) 1999,..,2010 Davide Libenzi
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Davide Libenzi <[email protected]>
*
*/
#ifndef _POP3UTILS_H
#define _POP3UTILS_H
#define INVALID_POP3_HANDLE ((POP3_HANDLE) 0)
#define POP3_USER_SPLITTERS "@:%"
typedef struct POP3_HANDLE_struct {
} *POP3_HANDLE;
struct MailSyncReport {
int iMsgSync;
int iMsgErr;
SYS_OFF_T llSizeSync;
SYS_OFF_T llSizeErr;
};
struct PopLastLoginInfo {
SYS_INET_ADDR Address;
time_t LTime;
};
int UPopGetMailboxSize(UserInfo *pUI, SYS_OFF_T &llMBSize, unsigned long &ulNumMessages);
int UPopCheckMailboxSize(UserInfo *pUI, SYS_OFF_T *pllAvailSpace = NULL);
int UPopAuthenticateAPOP(char const *pszDomain, char const *pszUsrName,
char const *pszTimeStamp, char const *pszDigest);
POP3_HANDLE UPopBuildSession(char const *pszDomain, char const *pszUsrName,
char const *pszUsrPass, SYS_INET_ADDR const *pPeerInfo);
void UPopReleaseSession(POP3_HANDLE hPOPSession, int iUpdate = 1);
char *UPopGetUserInfoVar(POP3_HANDLE hPOPSession, char const *pszName,
char const *pszDefault = NULL);
int UPopGetSessionMsgCurrent(POP3_HANDLE hPOPSession);
int UPopGetSessionMsgTotal(POP3_HANDLE hPOPSession);
SYS_OFF_T UPopGetSessionMBSize(POP3_HANDLE hPOPSession);
int UPopGetSessionLastAccessed(POP3_HANDLE hPOPSession);
int UPopGetMessageSize(POP3_HANDLE hPOPSession, int iMsgIndex, SYS_OFF_T &llMessageSize);
int UPopGetMessageUIDL(POP3_HANDLE hPOPSession, int iMsgIndex, char *pszMessageUIDL,
int iSize);
int UPopDeleteMessage(POP3_HANDLE hPOPSession, int iMsgIndex);
int UPopResetSession(POP3_HANDLE hPOPSession);
int UPopSendErrorResponse(BSOCK_HANDLE hBSock, int iErrorCode, int iTimeout);
int UPopSessionSendMsg(POP3_HANDLE hPOPSession, int iMsgIndex, BSOCK_HANDLE hBSock);
int UPopSessionTopMsg(POP3_HANDLE hPOPSession, int iMsgIndex, int iNumLines,
BSOCK_HANDLE hBSock);
int UPopSaveUserIP(POP3_HANDLE hPOPSession);
int UPopSyncRemoteLink(char const *pszSyncAddr, char const *pszRmtServer,
char const *pszRmtName, char const *pszRmtPassword,
MailSyncReport *pSRep, char const *pszSyncCfg,
char const *pszFetchHdrTags = "+X-Deliver-To,To,Cc",
char const *pszErrorAccount = NULL);
int UPopUserIpCheck(UserInfo *pUI, SYS_INET_ADDR const *pPeerInfo, unsigned int uExpireTime);
int UPopGetLastLoginInfo(UserInfo *pUI, PopLastLoginInfo *pInfo);
#endif