Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The imap service provided by 163.com could not be access. #190

Merged
merged 13 commits into from Mar 24, 2015
14 changes: 12 additions & 2 deletions src/low-level/imap/mailimap.c
Expand Up @@ -2309,7 +2309,7 @@ int mailimap_send_current_tag(mailimap * session)
int r;

session->imap_tag ++;
snprintf(tag_str, 15, "%i", session->imap_tag);
snprintf(tag_str, 15, "C%i", session->imap_tag);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should use the value of the flag to decide which version of the tag to use.


r = mailimap_tag_send(session->imap_stream, tag_str);
if (r != MAILIMAP_NO_ERROR)
Expand Down Expand Up @@ -2502,7 +2502,7 @@ mailimap * mailimap_new(size_t imap_progr_rate,

f->imap_logger = NULL;
f->imap_logger_context = NULL;

f->complex_command_tag_enabled = 0
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing ";": the build failed.

return f;

free_stream_buffer:
Expand Down Expand Up @@ -2590,3 +2590,13 @@ void mailimap_set_logger(mailimap * session, void (* logger)(mailimap * session,
session->imap_logger = logger;
session->imap_logger_context = logger_context;
}

LIBETPAN_EXPORT
void mailimap_set_complex_command_tag_enabled(mailimap * imap, int enabled) {
imap->complex_command_tag_enabled = enabled;
}

LIBETPAN_EXPORT
int mailimap_is_complex_command_tag_enabled(mailimap * imap) {
return imap->complex_command_tag_enabled;
}
6 changes: 6 additions & 0 deletions src/low-level/imap/mailimap.h
Expand Up @@ -802,6 +802,12 @@ time_t mailimap_get_timeout(mailimap * session);
LIBETPAN_EXPORT
void mailimap_set_logger(mailimap * session, void (* logger)(mailimap * session, int log_type,
const char * str, size_t size, void * context), void * logger_context);

LIBETPAN_EXPORT
void mailimap_set_complex_command_tag_enabled(mailimap * imap, int enabled);

LIBETPAN_EXPORT
int mailimap_is_complex_command_tag_enabled(mailimap * imap);

#ifdef __cplusplus
}
Expand Down
2 changes: 2 additions & 0 deletions src/low-level/imap/mailimap_types.h
Expand Up @@ -3385,6 +3385,8 @@ struct mailimap {

void (* imap_logger)(mailimap * session, int log_type, const char * str, size_t size, void * context);
void * imap_logger_context;

int complex_command_tag_enabled;
};


Expand Down