| 1092 | #endif |
| 1093 | |
| 1094 | static void server_fill_credential(struct imap_server_conf *srvc, struct credential *cred) |
| 1095 | { |
| 1096 | if (srvc->user && srvc->pass) |
| 1097 | return; |
| 1098 | |
| 1099 | cred->protocol = xstrdup(srvc->use_ssl ? "imaps" : "imap"); |
| 1100 | cred->host = xstrfmt("%s:%d", srvc->host, srvc->port); |
| 1101 | |
| 1102 | cred->username = xstrdup_or_null(srvc->user); |
| 1103 | cred->password = xstrdup_or_null(srvc->pass); |
| 1104 | |
| 1105 | credential_fill(the_repository, cred, 1); |
| 1106 | |
| 1107 | if (!srvc->user) |
| 1108 | srvc->user = xstrdup(cred->username); |
| 1109 | if (!srvc->pass) |
| 1110 | srvc->pass = xstrdup(cred->password); |
| 1111 | } |
| 1112 | |
| 1113 | static int try_auth_method(struct imap_server_conf *srvc, |
| 1114 | struct imap_store *ctx, |
no test coverage detected