Lines Matching defs:url
14 #include "imap-url.h"
15 #include "imap-msgpart-url.h"
123 struct imap_url *url, const char *const *access_applications)
139 if (strncasecmp(url->uauth_access_application, app, len-1) == 0) {
142 return url->uauth_access_user == NULL;
146 return (!uctx->access_anonymous && url->uauth_access_user != NULL);
154 struct imap_url *url, bool ignore_unknown,
159 if (url->uauth_access_application == NULL) {
166 if (strcasecmp(url->uauth_access_application, "user") == 0) {
168 if (url->uauth_access_user == NULL) {
173 strcasecmp(url->uauth_access_user, uctx->access_user) == 0)
175 } else if (strcasecmp(url->uauth_access_application, "authuser") == 0) {
179 } else if (strcasecmp(url->uauth_access_application, "anonymous") == 0) {
183 (uctx, url, uctx->access_applications)) {
189 if (strcasecmp(url->uauth_access_application, "submit") != 0) {
190 userid = url->uauth_access_user == NULL ? "" :
191 t_strdup_printf("+%s", url->uauth_access_user);
194 url->uauth_access_application, userid);
196 } else if (url->uauth_access_user == NULL) {
200 strcasecmp(url->uauth_access_user, uctx->access_user) == 0) {
205 userid = url->uauth_access_user == NULL ? "" :
206 t_strdup_printf("+%s", url->uauth_access_user);
211 url->uauth_access_application, userid);
215 url->uauth_access_application, userid, uctx->access_user);
222 struct imap_url *url, const char **error_r)
227 strcmp(url->host.name, uctx->url_host) != 0) {
233 if ((url->port == 0 && uctx->url_port != 143) ||
234 (url->port != 0 && uctx->url_port != url->port)) {
248 struct imap_url *url;
265 if (imap_url_parse(rumpurl, NULL, url_flags, &url, &error) < 0) {
270 if (url->mailbox == NULL || url->uid == 0 || url->search_program != NULL ||
271 url->uauth_rumpurl == NULL || url->uauth_mechanism != NULL) {
277 if (url->uauth_expire != (time_t)-1) {
280 if (now > url->uauth_expire) {
287 if (url->userid == NULL) {
291 if (user->anonymous || strcmp(url->userid, user->username) != 0) {
294 url->userid);
299 if (!imap_urlauth_check_hostport(uctx, url, error_r))
303 if ((ret = imap_msgpart_url_create(user, url, &mpurl, &error)) < 0 ||
328 struct imap_url *url, bool ignore_unknown_access,
332 if (url->mailbox == NULL || url->uid == 0 ||
333 url->search_program != NULL || url->uauth_rumpurl == NULL ||
334 url->uauth_mechanism == NULL) {
340 if (url->userid == NULL) {
346 if (strcasecmp(url->uauth_mechanism, "INTERNAL") != 0) {
348 url->uauth_mechanism);
353 if (url->uauth_expire != (time_t)-1) {
356 if (now > url->uauth_expire) {
363 if (!imap_urlauth_check_access(uctx, url, ignore_unknown_access,
367 if (!imap_urlauth_check_hostport(uctx, url, error_r))
373 struct imap_url *url,
390 if (!imap_urlauth_check(uctx, url, FALSE, error_r)) {
396 if (user->anonymous || strcmp(url->userid, user->username) != 0) {
398 url->userid);
404 if ((ret = imap_msgpart_url_create(user, url, &mpurl, &error)) < 0) {
424 (void)imap_urlauth_internal_verify(url->uauth_rumpurl,
425 mailbox_key, url->uauth_token, url->uauth_token_size);
441 !imap_urlauth_internal_verify(url->uauth_rumpurl, mailbox_key,
442 url->uauth_token,
443 url->uauth_token_size)) {
461 struct imap_url *url;
466 if (imap_url_parse(urlauth, NULL, url_flags, &url, &error) < 0) {
472 return imap_urlauth_fetch_parsed(uctx, url, mpurl_r,