And some other mail URLs as well. Seems to me that all could be enabled,
and just let protocols ignore the username/password if they don't
care. This patch just adds a few, however. I've only tested this with
SMTP and SMTPS, but can't imagine it causing harm to the others.
mail: Allow mail URLs to contain username/passwords.
Thanks,
Ben
--
Ben Greear <[email protected]>
Candela Technologies Inc http://www.candelatech.com
diff --git a/lib/url.c b/lib/url.c
index bd9bd46..7a88326 100644
--- a/lib/url.c
+++ b/lib/url.c
@@ -4119,9 +4119,11 @@ static CURLcode parse_url_userpass(struct SessionHandle
*data,
user[0] =0; /* to make everything well-defined */
passwd[0]=0;
- if(conn->protocol & (PROT_FTP|PROT_HTTP|PROT_SCP|PROT_SFTP)) {
- /* This is a FTP, HTTP, SCP or SFTP URL, we will now try to extract the
- * possible user+password pair in a string like:
+ if(conn->protocol & (PROT_FTP|PROT_HTTP|PROT_SCP|PROT_SFTP|PROT_SMTP
+ |PROT_SMTPS |PROT_IMAP|PROT_IMAPS|PROT_POP3
+ |PROT_POP3S)) {
+ /* This is a protocol that might use passwords. We will now try to
+ * extract the possible user+password pair in a string like:
* ftp://user:[email protected]:8021/README */
char *ptr=strchr(conn->host.name, '@');
char *userpass = conn->host.name;
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html