summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUrban Müller2022-03-14 14:05:43 +0100
committerUrban Müller2022-03-14 14:10:40 +0100
commitffa02ae4d0b2b2f6e8239f48e309ee992fba1e3f (patch)
treed30d7d3482cb862807fd0d361a7ee82ae3bc63fd
parent1bded8a016bb64221fff4003e28947f50e9e00d9 (diff)
downloaditools-ffa02ae4d0b2b2f6e8239f48e309ee992fba1e3f.tar.gz
itools-ffa02ae4d0b2b2f6e8239f48e309ee992fba1e3f.tar.bz2
itools-ffa02ae4d0b2b2f6e8239f48e309ee992fba1e3f.zip
accept naked unix user names as recipients
-rw-r--r--it_mail.class8
1 files changed, 4 insertions, 4 deletions
diff --git a/it_mail.class b/it_mail.class
index 6394e5f..ab75ffc 100644
--- a/it_mail.class
+++ b/it_mail.class
@@ -408,9 +408,11 @@ static function send_smtp_cmd($fp, $cmd, &$answer, $timeoutok = false, $failcode
/* Return errors found with email address, null otherwise
*/
-static function address_error($email)
+static function address_error($emails)
{
- return it::match(self::$addr_regex, $email) ? null : "invalid format";
+ foreach (it::split(',\s*', $emails) as $email)
+ if (!it::match(self::$addr_regex, $email) && !it::match('^[a-z][-a-z0-9]*$', $email))
+ return "invalid format";
}
@@ -528,5 +530,3 @@ static function check_email($email, $checkmailbox = false)
}
}
-
-?>