/[imapfilter]/imapfilter/account.h
ViewVC logotype

Contents of /imapfilter/account.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1.2.3 - (show annotations)
Mon Jan 26 21:37:49 2004 UTC (20 years, 2 months ago) by lefcha
Branch: release-0_9-patches
Changes since 1.1.2.2: +1 -0 lines
File MIME type: text/plain
Cosmetic changes.

1 #ifndef ACCOUNT_H
2 #define ACCOUNT_H
3
4
5 #include <sys/types.h> /* IEEE Std 1003.1-2001 non-conformance. */
6 #include <regex.h>
7
8 #include "config.h"
9
10
11 /* String lengths of account settings. */
12 #define SERVER_LEN (635 + 1) /* Section 2.5 RFC 1123. */
13 #define USERNAME_LEN 128
14 #define PASSWORD_LEN 128
15
16 /* Attributes of a password. */
17 #define PASSWORD_NONE 0
18 #define PASSWORD_PLAIN 1
19 #define PASSWORD_ENCRYPTED 2
20
21 /* Secure Socket Layer protocols. */
22 #define SSL_DISABLED 0
23 #define SSL_SSL_V2 1
24 #define SSL_SSL_V3 2
25 #define SSL_TLS_V1 3
26
27 /* String length of keys (aliases). */
28 #define KEY_LEN 32
29
30 /* String length of mailbox's name. */
31 #define MBOX_NAME_LEN 128
32
33 /* Maximum filters assigned to a mailbox. */
34 #define MBOX_FILTERS_MAX 64
35
36 /* Maximum mailboxes contained in a mailbox-group. */
37 #define MBOXGRP_MBOXES_MAX 64
38
39
40 /* Account. */
41 typedef struct account {
42 char key[KEY_LEN]; /* Alias of account. */
43 char server[SERVER_LEN];/* Hostname of mail server. */
44 unsigned short int port;/* Port to connect. */
45 char username[USERNAME_LEN]; /* Username. */
46 char *password; /* Password. */
47 int passwdattr; /* Password attributes. */
48 unsigned int ssl; /* Secure Socket Layer support. */
49 struct mbox *mboxes; /* Mailboxes. */
50 struct account *next; /* Next node of linked list. */
51 } account_t;
52
53 /* Mailbox. */
54 typedef struct mbox {
55 char name[MBOX_NAME_LEN]; /* Name of mailbox. */
56 struct filter *filters[MBOX_FILTERS_MAX]; /* Filters to be
57 * applied. */
58 struct mbox *next; /* Next node of linked list. */
59 } mbox_t;
60
61 /* Group of mailboxes. */
62 typedef struct mboxgrp {
63 char key[KEY_LEN]; /* Alias of mailbox group. */
64 struct mbox *mboxes[MBOXGRP_MBOXES_MAX]; /* Mailboxes of group. */
65 struct mboxgrp *left, *right; /* Left/right nodes of tree. */
66 } mboxgrp_t;
67
68
69 /* account.c */
70 int set_account(char *line, regmatch_t * match);
71 int set_mboxgrp(char *line, regmatch_t * match);
72
73 #ifdef ENCRYPTED_PASSWORDS
74 char *find_password(char *user, char *serv);
75 #endif
76
77 char *apply_namespace(char *mbox, char *prefix, char delim);
78
79
80 #endif /* ACCOUNT_H */

webmaster@linux.gr
ViewVC Help
Powered by ViewVC 1.1.26