summaryrefslogtreecommitdiff
path: root/dbmail-imapsession.c
diff options
context:
space:
mode:
authorpaul <paul@7b491191-dbf0-0310-aff6-d879d4d69008>2004-11-04 13:18:56 +0000
committerpaul <paul@7b491191-dbf0-0310-aff6-d879d4d69008>2004-11-04 13:18:56 +0000
commit6ac6e3039923eb67ebeaf705db18e2d87929ef5f (patch)
tree3f2a2b582e8ceb7cb9690584d34d82c303e5e679 /dbmail-imapsession.c
parentfb2982d351b173192d63c652c54fc1304afc6fc5 (diff)
fixed dbmail-imapsession so _ic_fetch works again for outlook users
git-svn-id: https://svn.ic-s.nl/svn/dbmail/trunk/dbmail@1432 7b491191-dbf0-0310-aff6-d879d4d69008
Diffstat (limited to 'dbmail-imapsession.c')
-rw-r--r--dbmail-imapsession.c35
1 files changed, 15 insertions, 20 deletions
diff --git a/dbmail-imapsession.c b/dbmail-imapsession.c
index c901d07e..f17ce37a 100644
--- a/dbmail-imapsession.c
+++ b/dbmail-imapsession.c
@@ -329,26 +329,18 @@ static GList * _imap_get_envelope(struct list *rfcheader)
for (idx = 0; envelope_items[idx]; idx++) {
mime_findfield(envelope_items[idx], rfcheader, &mr);
if (mr && strlen(mr->value) > 0) {
- tmp = g_list_join(_imap_get_addresses(mr)," ");
- g_string_printf(tmp,"(%s)", tmp->str);
- list = g_list_append(list, g_strdup(tmp->str));
+ list = g_list_append(list, dbmail_imap_plist_as_string(_imap_get_addresses(mr)));
} else if (strcasecmp(envelope_items[idx], "reply-to") == 0) {
- /* default this field */
mime_findfield("from", rfcheader, &mr);
if (mr && strlen(mr->value) > 0) {
- tmp = g_list_join(_imap_get_addresses(mr)," ");
- g_string_printf(tmp,"(%s)", tmp->str);
- list = g_list_append(list, g_strdup(tmp->str));
- } else /* no from field ??? */
+ list = g_list_append(list, dbmail_imap_plist_as_string(_imap_get_addresses(mr)));
+ } else
list = g_list_append(list, "((NIL NIL \"nobody\" \"nowhere.nirgendwo\"))");
} else if (strcasecmp(envelope_items[idx], "sender") == 0) {
- /* default this field */
mime_findfield("from", rfcheader, &mr);
if (mr && strlen(mr->value) > 0) {
- tmp = g_list_join(_imap_get_addresses(mr)," ");
- g_string_printf(tmp,"(%s)", tmp->str);
- list = g_list_append(list, g_strdup(tmp->str));
- } else /* no from field ??? */
+ list = g_list_append(list, dbmail_imap_plist_as_string(_imap_get_addresses(mr)));
+ } else
list = g_list_append(list, "((NIL NIL \"nobody\" \"nowhere.nirgendwo\"))");
} else
list = g_list_append(list,"NIL");
@@ -465,9 +457,7 @@ static GList * _imap_get_addresses(struct mime_record *mr)
while (isspace(mr->value[delimiter]))
delimiter++;
}
- tmp = g_list_join(sublist," ");
- g_string_printf(tmp,"(%s)", tmp->str);
- list = g_list_append(list, g_strdup(tmp->str));
+ list = g_list_append(list, dbmail_imap_plist_as_string(sublist));
} while (delimiter > 0);
@@ -717,6 +707,8 @@ static int _imap_session_fetch_parse_octet_range(struct ImapSession *self, int i
char *token = self->args[idx];
+ trace(TRACE_DEBUG,"%s,%s: parse token [%s]",__FILE__, __func__, token);
+
if (token && token[0] == '<') {
/* check argument */
@@ -747,6 +739,7 @@ static int _imap_session_fetch_parse_octet_range(struct ImapSession *self, int i
} else {
self->fi.bodyfetch.octetstart = -1;
self->fi.bodyfetch.octetcnt = -1;
+ return idx;
}
return idx + 1; /* DONE */
@@ -832,7 +825,7 @@ int dbmail_imap_session_fetch_parse_args(struct ImapSession * self, int idx)
self->fi.getBodyTotalPeek = 1;
else
self->fi.getBodyTotal = 1;
- return _imap_session_fetch_parse_octet_range(self,idx);
+ return _imap_session_fetch_parse_octet_range(self,idx+1);
}
if (ispeek)
@@ -840,10 +833,12 @@ int dbmail_imap_session_fetch_parse_args(struct ImapSession * self, int idx)
idx = _imap_session_fetch_parse_partspec(self,idx);
- if (idx < 0)
+ if (idx < 0) {
+ trace(TRACE_DEBUG,"%s,%s: fetch_parse_partspec return with error", __FILE__, __func__);
return -2;
- idx++; /* points to ']' now */
- return _imap_session_fetch_parse_octet_range(self,idx);
+ }
+ /* idx points to ']' now */
+ return _imap_session_fetch_parse_octet_range(self,idx+1);
}
} else if (MATCH(token,"all")) {
self->fi.msgparse_needed=1;