diff options
author | Urban Müller | 2022-03-14 14:05:43 +0100 |
---|---|---|
committer | Urban Müller | 2022-03-14 14:10:40 +0100 |
commit | ffa02ae4d0b2b2f6e8239f48e309ee992fba1e3f (patch) | |
tree | d30d7d3482cb862807fd0d361a7ee82ae3bc63fd | |
parent | 1bded8a016bb64221fff4003e28947f50e9e00d9 (diff) | |
download | itools-ffa02ae4d0b2b2f6e8239f48e309ee992fba1e3f.tar.gz itools-ffa02ae4d0b2b2f6e8239f48e309ee992fba1e3f.tar.bz2 itools-ffa02ae4d0b2b2f6e8239f48e309ee992fba1e3f.zip |
accept naked unix user names as recipients
-rw-r--r-- | it_mail.class | 8 |
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) } } - -?> |