summaryrefslogtreecommitdiffabout
path: root/kmicromail/libetpan/generic/pop3storage.c
Unidiff
Diffstat (limited to 'kmicromail/libetpan/generic/pop3storage.c') (more/less context) (ignore whitespace changes)
-rw-r--r--kmicromail/libetpan/generic/pop3storage.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kmicromail/libetpan/generic/pop3storage.c b/kmicromail/libetpan/generic/pop3storage.c
index 8e7a94e..375aeaf 100644
--- a/kmicromail/libetpan/generic/pop3storage.c
+++ b/kmicromail/libetpan/generic/pop3storage.c
@@ -47,49 +47,49 @@
47#define POP3_DEFAULT_PORT 110 47#define POP3_DEFAULT_PORT 110
48#define POP3S_DEFAULT_PORT 995 48#define POP3S_DEFAULT_PORT 995
49 49
50static int pop3_mailstorage_connect(struct mailstorage * storage); 50static int pop3_mailstorage_connect(struct mailstorage * storage);
51static int pop3_mailstorage_get_folder_session(struct mailstorage * storage, 51static int pop3_mailstorage_get_folder_session(struct mailstorage * storage,
52 char * pathname, mailsession ** result); 52 char * pathname, mailsession ** result);
53static void pop3_mailstorage_uninitialize(struct mailstorage * storage); 53static void pop3_mailstorage_uninitialize(struct mailstorage * storage);
54 54
55static mailstorage_driver pop3_mailstorage_driver = { 55static mailstorage_driver pop3_mailstorage_driver = {
56 .sto_name = "pop3", 56 .sto_name = "pop3",
57 .sto_connect = pop3_mailstorage_connect, 57 .sto_connect = pop3_mailstorage_connect,
58 .sto_get_folder_session = pop3_mailstorage_get_folder_session, 58 .sto_get_folder_session = pop3_mailstorage_get_folder_session,
59 .sto_uninitialize = pop3_mailstorage_uninitialize, 59 .sto_uninitialize = pop3_mailstorage_uninitialize,
60}; 60};
61 61
62int pop3_mailstorage_init(struct mailstorage * storage, 62int pop3_mailstorage_init(struct mailstorage * storage,
63 char * pop3_servername, uint16_t pop3_port, 63 char * pop3_servername, uint16_t pop3_port,
64 char * pop3_command, 64 char * pop3_command,
65 int pop3_connection_type, int pop3_auth_type, 65 int pop3_connection_type, int pop3_auth_type,
66 char * pop3_login, char * pop3_password, 66 char * pop3_login, char * pop3_password,
67 int pop3_cached, char * pop3_cache_directory, char * pop3_flags_directory) 67 int pop3_cached, char * pop3_cache_directory, char * pop3_flags_directory)
68{ 68{
69 struct pop3_mailstorage * pop3_storage; 69 struct pop3_mailstorage * pop3_storage;
70 70
71 pop3_storage = malloc(sizeof(struct pop3_mailstorage)); 71 pop3_storage = malloc(sizeof(* pop3_storage));
72 if (pop3_storage == NULL) 72 if (pop3_storage == NULL)
73 goto err; 73 goto err;
74 74
75 pop3_storage->pop3_servername = strdup(pop3_servername); 75 pop3_storage->pop3_servername = strdup(pop3_servername);
76 if (pop3_storage->pop3_servername == NULL) 76 if (pop3_storage->pop3_servername == NULL)
77 goto free; 77 goto free;
78 78
79 pop3_storage->pop3_connection_type = pop3_connection_type; 79 pop3_storage->pop3_connection_type = pop3_connection_type;
80 80
81 if (pop3_port == 0) { 81 if (pop3_port == 0) {
82 switch (pop3_connection_type) { 82 switch (pop3_connection_type) {
83 case CONNECTION_TYPE_PLAIN: 83 case CONNECTION_TYPE_PLAIN:
84 case CONNECTION_TYPE_TRY_STARTTLS: 84 case CONNECTION_TYPE_TRY_STARTTLS:
85 case CONNECTION_TYPE_STARTTLS: 85 case CONNECTION_TYPE_STARTTLS:
86 case CONNECTION_TYPE_COMMAND: 86 case CONNECTION_TYPE_COMMAND:
87 case CONNECTION_TYPE_COMMAND_TRY_STARTTLS: 87 case CONNECTION_TYPE_COMMAND_TRY_STARTTLS:
88 case CONNECTION_TYPE_COMMAND_STARTTLS: 88 case CONNECTION_TYPE_COMMAND_STARTTLS:
89 pop3_port = POP3_DEFAULT_PORT; 89 pop3_port = POP3_DEFAULT_PORT;
90 break; 90 break;
91 91
92 case CONNECTION_TYPE_TLS: 92 case CONNECTION_TYPE_TLS:
93 case CONNECTION_TYPE_COMMAND_TLS: 93 case CONNECTION_TYPE_COMMAND_TLS:
94 pop3_port = POP3S_DEFAULT_PORT; 94 pop3_port = POP3S_DEFAULT_PORT;
95 break; 95 break;