Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
John McEleney
/
mailutils
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit
dc8e91fa
...
dc8e91faa0d27e59e4c913f08ebaeb2cec70864d
authored
2007-07-18 17:03:37 +0000
by
Wojciech Polak
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
(_url_imap_init, _url_imaps_init): Call mu_url_init.
1 parent
e25a55cd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
14 deletions
libproto/imap/url.c
libproto/imap/url.c
View file @
dc8e91f
...
...
@@ -41,35 +41,55 @@ url_imap_destroy (mu_url_t url MU_ARG_UNUSED)
}
/*
IMAP URL:
IMAP URL
s
:
imap://[<user>[;AUTH=<auth>]@]<host>[/<mailbox>]
else
imap://[<user>[:<pass>]@]<host>[/<mailbox>]
*/
int
_url_imap_init
(
mu_url_t
url
)
{
int
status
=
0
;
int
status
=
mu_url_init
(
url
,
MU_IMAP_PORT
,
"imap"
);
if
(
status
)
return
status
;
url
->
_destroy
=
url_imap_destroy
;
status
=
mu_url_parse
(
url
);
if
(
!
url
->
host
||
url
->
query
)
return
EINVAL
;
/* fill in default auth, if necessary */
if
(
!
url
->
auth
)
{
url
->
auth
=
malloc
(
1
+
1
);
if
(
!
url
->
auth
)
return
ENOMEM
;
url
->
auth
[
0
]
=
'*'
;
url
->
auth
[
1
]
=
'\0'
;
}
return
0
;
}
/*
IMAPS URLs:
imaps://[<user>[;AUTH=<auth>]@]<host>[/<mailbox>]
imaps://[<user>[:<pass>]@]<host>[/<mailbox>]
*/
int
_url_imaps_init
(
mu_url_t
url
)
{
int
status
=
mu_url_init
(
url
,
MU_IMAPS_PORT
,
"imaps"
);
if
(
status
)
return
status
;
if
(
!
url
->
host
||
url
->
query
)
return
EINVAL
;
url
->
_destroy
=
url_imap_destroy
;
/* is it pop? */
if
(
strcmp
(
"imap"
,
url
->
scheme
)
!=
0
)
if
(
!
url
->
host
||
url
->
query
)
return
EINVAL
;
/* fill in default port, if necesary */
if
(
url
->
port
==
0
)
url
->
port
=
MU_IMAP_PORT
;
/* fill in default auth, if necessary */
if
(
!
url
->
auth
)
{
...
...
@@ -81,7 +101,7 @@ _url_imap_init (mu_url_t url)
url
->
auth
[
1
]
=
'\0'
;
}
return
status
;
return
0
;
}
#endif
#endif
/* ENABLE_IMAP */
...
...
Please
register
or
sign in
to post a comment