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

Merged
merged 13 commits into from Mar 24, 2015

Conversation

Projects
None yet
2 participants
@zhanleewo
Contributor

zhanleewo commented Mar 20, 2015

163 mail server will reject the command which with a number tag.
eg.
1 CAPABILITY
2 LOGIN USERNAME PASSWORD
3 CAPABILITY
4 LIST "" ""
5 ID NIL
6 SELECT INBOX
this command sequence above, will be reject at the last line by 163.com mail server, the response is:
6 NO SELECT The login is not safe! Please update your mail client: http://mail.163.com/dashi

if the command tag with some prefix character.this issue will be solved.

zhanleewo added some commits Mar 20, 2015

Update mailimap.c
163 mail server will reject the command which with a number tag.
@zhanleewo

This comment has been minimized.

Show comment
Hide comment
@zhanleewo

zhanleewo Mar 20, 2015

Owner

As 'X' as prefix of tag will not work.

Owner

zhanleewo commented on f0f5b4a Mar 20, 2015

As 'X' as prefix of tag will not work.

@dinhviethoa

This comment has been minimized.

Show comment
Hide comment
@dinhviethoa

dinhviethoa Mar 20, 2015

Owner

Could you add a setting in mailimap to tweak that behavior?

void mailimap_set_163_workaround_enabled(mailimap * imap, int enabled);
int mailimap_is_163_workaround_enabled(mailimap * imap);
Owner

dinhviethoa commented Mar 20, 2015

Could you add a setting in mailimap to tweak that behavior?

void mailimap_set_163_workaround_enabled(mailimap * imap, int enabled);
int mailimap_is_163_workaround_enabled(mailimap * imap);
@zhanleewo

This comment has been minimized.

Show comment
Hide comment
@zhanleewo

zhanleewo Mar 23, 2015

Contributor

I think the two function had better defined as:
void mailimap_set_complex_command_tag_enabled(mailimap * imap, int enabled);
int mailimap_is__complex_command_tag_enabled(mailimap * imap);

Contributor

zhanleewo commented Mar 23, 2015

I think the two function had better defined as:
void mailimap_set_complex_command_tag_enabled(mailimap * imap, int enabled);
int mailimap_is__complex_command_tag_enabled(mailimap * imap);

src/low-level/imap/mailimap.c
@@ -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

This comment has been minimized.

@dinhviethoa

dinhviethoa Mar 23, 2015

Owner

missing ";": the build failed.

@dinhviethoa

dinhviethoa Mar 23, 2015

Owner

missing ";": the build failed.

@@ -2309,7 +2309,7 @@ int mailimap_send_current_tag(mailimap * session)
int r;
session->imap_tag ++;
- snprintf(tag_str, 15, "%i", session->imap_tag);

This comment has been minimized.

@dinhviethoa

dinhviethoa Mar 23, 2015

Owner

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

@dinhviethoa

dinhviethoa Mar 23, 2015

Owner

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

@dinhviethoa

This comment has been minimized.

Show comment
Hide comment
@dinhviethoa

dinhviethoa Mar 23, 2015

Owner

I like mailimap_set_163_workaround_enabled() because it's self documenting. If you really like mailimap_set_complex_command_tag_enabled(), add a comment to describe what it's for. Also, I'm not sure that it makes the tag really complex either.

Owner

dinhviethoa commented Mar 23, 2015

I like mailimap_set_163_workaround_enabled() because it's self documenting. If you really like mailimap_set_complex_command_tag_enabled(), add a comment to describe what it's for. Also, I'm not sure that it makes the tag really complex either.

zhanleewo added some commits Mar 24, 2015

Update mailimap.c
changed 
` int mailimap_is__complex_command_tag_enabled(mailimap * imap); `
` void mailimap_set_complex_command_tag_enabled(mailimap * imap, int enabled);`
to
`int mailimap_is_163_workaround_enabled(mailimap * imap);`
`void mailimap_set_163_workaround_enabled(mailimap * imap, int enabled);`
Update mailimap.h
changed 
` int mailimap_is__complex_command_tag_enabled(mailimap * imap); `
` void mailimap_set_complex_command_tag_enabled(mailimap * imap, int enabled);`
to
`int mailimap_is_163_workaround_enabled(mailimap * imap);`
`void mailimap_set_163_workaround_enabled(mailimap * imap, int enabled);`
Update mailimap_types.h
changed mailimap's member `complex_command_tag_enabled` to `is_163_workaround_enabled`.
@zhanleewo

This comment has been minimized.

Show comment
Hide comment
@zhanleewo

zhanleewo Mar 24, 2015

Contributor

changed
int mailimap_is__complex_command_tag_enabled(mailimap * imap);
void mailimap_set_complex_command_tag_enabled(mailimap * imap, int enabled);
to
int mailimap_is_163_workaround_enabled(mailimap * imap);
void mailimap_set_163_workaround_enabled(mailimap * imap, int enabled);

Contributor

zhanleewo commented Mar 24, 2015

changed
int mailimap_is__complex_command_tag_enabled(mailimap * imap);
void mailimap_set_complex_command_tag_enabled(mailimap * imap, int enabled);
to
int mailimap_is_163_workaround_enabled(mailimap * imap);
void mailimap_set_163_workaround_enabled(mailimap * imap, int enabled);

@zhanleewo

This comment has been minimized.

Show comment
Hide comment
@zhanleewo

zhanleewo Mar 24, 2015

Owner

changed parameter name from imap to session.

changed
int mailimap_is_163_workaround_enabled(mailimap * imap);
void mailimap_set_163_workaround_enabled(mailimap * imap, int enabled);
to
int mailimap_is_163_workaround_enabled(mailimap * session);
void mailimap_set_163_workaround_enabled(mailimap * session, int enabled);

Owner

zhanleewo commented on 4175a4e Mar 24, 2015

changed parameter name from imap to session.

changed
int mailimap_is_163_workaround_enabled(mailimap * imap);
void mailimap_set_163_workaround_enabled(mailimap * imap, int enabled);
to
int mailimap_is_163_workaround_enabled(mailimap * session);
void mailimap_set_163_workaround_enabled(mailimap * session, int enabled);

Update mailimap.c
changed parameter name from `imap` to `session`.
@dinhviethoa

This comment has been minimized.

Show comment
Hide comment
@dinhviethoa

dinhviethoa Mar 24, 2015

Owner

Thanks!

Owner

dinhviethoa commented Mar 24, 2015

Thanks!

dinhviethoa added a commit that referenced this pull request Mar 24, 2015

Merge pull request #190 from zhanleewo/patch-1
Implemented workaround for 163.com servers.

@dinhviethoa dinhviethoa merged commit 050f15f into dinhviethoa:master Mar 24, 2015

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@zhanleewo zhanleewo changed the title from Patch 1 to The imap service provided by 163.com could not be access. Mar 25, 2015

zhanleewo added a commit to zhanleewo/libetpan that referenced this pull request Mar 26, 2015

Update mailimap.c
#190  parse response

@zhanleewo zhanleewo referenced this pull request Mar 26, 2015

Merged

Update mailimap.c #194

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment