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:password@ftp.my.site:8021/README */
     char *ptr=strchr(conn->host.name, '@');
     char *userpass = conn->host.name;

