]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
ftpserver: don't verify SMTP MAIL FROM names
authorDaniel Stenberg <daniel@haxx.se>
Thu, 2 Jul 2020 14:42:55 +0000 (16:42 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Fri, 3 Jul 2020 08:10:30 +0000 (10:10 +0200)
Rely on tests asking the names to get refused instead - test servers
should be as dumb as possible. Edited test 914, 955 and 959 accordingly.

Closes #5639

tests/data/test914
tests/data/test955
tests/data/test959
tests/ftpserver.pl

index d1532c806c695481f99f8e6a18c319251232247f..0124b7671d5fb6ae0fffac1bf55f0c16d7c78842 100644 (file)
@@ -8,6 +8,9 @@ SMTP
 #
 # Server-side
 <reply>
+<servercmd>
+REPLY MAIL 501 not fine enough
+</servercmd>
 </reply>
 
 #
index 57d618c7d38d126794b5ef854f71756733170ebd..97ef295611455792e9a68699a51db0dbd39060af 100644 (file)
@@ -8,6 +8,9 @@ SMTP
 #
 # Server-side
 <reply>
+<servercmd>
+REPLY MAIL 501 not fine enough
+</servercmd>
 </reply>
 
 #
index a61c3d14294ece93d057f952c2ad3608a3991842..1b2d65842cc9bdbc6627fdaa5cd213a14d26a9a6 100644 (file)
@@ -8,6 +8,9 @@ SMTP
 #
 # Server-side
 <reply>
+<servercmd>
+REPLY MAIL 501 not fine enough
+</servercmd>
 </reply>
 
 #
index 92420ea4b1c2407e03e518d96d53be152cc8496a..a0b36e5de4daf891590e554f8521992049198ac2 100755 (executable)
@@ -835,13 +835,8 @@ sub MAIL_smtp {
             }
         }
 
-        # Validate the from address (only <> and a valid email address inside
-        # <> are allowed, such as <user@example.com>)
-        if (($from eq "<>") ||
-            (!$smtputf8 && $from =~
-              /^<([a-zA-Z0-9._%+-]+)\@(([a-zA-Z0-9-]+)\.)+([a-zA-Z]{2,4})>$/) ||
-            ($smtputf8 && $from =~
-              /^<([a-zA-Z0-9\x{80}-\x{ff}._%+-]+)\@(([a-zA-Z0-9\x{80}-\x{ff}-]+)\.)+([a-zA-Z]{2,4})>$/)) {
+        # this server doesn't "validate" MAIL FROM addresses
+        if (length($from)) {
             my @found;
             my $valid = 1;