If you use that, it will be accepted. The line is parsed correctly by Email::Address. But exim will return a SMTP error.
Note that adding two email addresses separated by a comma, does work and results in an email to two recipients. The list of emails is in the to_address of the message queue.
(In reply to Marcel de Rooy from comment #1) > Note that adding two email addresses separated by a comma, does work and > results in an email to two recipients. > The list of emails is in the to_address of the message queue. Another thing is if we really want that. This allows a logged-in patron to send a mail to a lot of recipients.
(In reply to Marcel de Rooy from comment #0) > If you use that, it will be accepted. The line is parsed correctly by > Email::Address. But exim will return a SMTP error. Changed the title. But I meant here (in short) sending an address "Marcel <my@email.com>" will pass all current validation. But results in SMTP error. Note that we pass the input param email just through to EnqueueLetter. Later on Koha::Email checks is_valid when processing the queue. But that algorithm is unreliable (bug 41025).
(In reply to Marcel de Rooy from comment #2) > Another thing is if we really want that. This allows a logged-in patron to > send a mail to a lot of recipients. That's a very good point. This one might be a bit of a bug/feature. I know we've been expanding the number of places in Koha that allow multiple recipients, but that's not great when it's the OPAC I think...
(In reply to Marcel de Rooy from comment #0) > If you use that, it will be accepted. The line is parsed correctly by > Email::Address. But exim will return a SMTP error. I'm not sure it's Koha's job to figure out if the email address is real? I think it's OK to get the SMTP error? For me, I think the key concern is "is this in email address format where the SMTP software can deal with it?"
(In reply to David Cook from comment #5) > (In reply to Marcel de Rooy from comment #0) > > If you use that, it will be accepted. The line is parsed correctly by > > Email::Address. But exim will return a SMTP error. > > I'm not sure it's Koha's job to figure out if the email address is real? I > think it's OK to get the SMTP error? For me, I think the key concern is "is > this in email address format where the SMTP software can deal with it?" Agreed. There is just a nasty bug somewhere: Adding the unexpected/unsupported(?) marcel <marcel@domain.com> or with quotes "marcel" <marcel@domain.com> in sendbasket/sendshelf are confirmed in the interface with Message sent. And die silently. The to address/header with the name (quoted and unquoted) pass Email::Address and should actually be correct for SMTP. But fail somewhere between Koha::Email and Email::Sender::Transport::SMTP. The fact that we use an encapsulated Email::Mime object within Email::Stuffer going to Email::Sender::Simple etc does not make it easier.. Part of the trace below.
[2025/10/17 09:28:41] [WARN] <marcel"@domain.com>: "@" or "." expected after "marcel" Trace begun at /usr/share/perl5/Email/Sender/Transport/SMTP.pm line 256 Email::Sender::Transport::SMTP::send_email('Email::Sender::Transport::SMTP::Persistent=HASH(0x56178566c960)', 'Email::Abstract=ARRAY(0x5617858cf3f8)', 'HASH(0x561785771838)') called at /usr/share/perl5/Email/Sender/Role/CommonSending.pm line 45 Email::Sender::Role::CommonSending::try {...} at /usr/share/perl5/Try/Tiny.pm line 102 eval {...} at /usr/share/perl5/Try/Tiny.pm line 93 Try::Tiny::try('CODE(0x561785684d10)', 'Try::Tiny::Catch=REF(0x561784f9de68)') called at /usr/share/perl5/Email/Sender/Role/CommonSending.pm line 58 Email::Sender::Role::CommonSending::send('Email::Sender::Transport::SMTP::Persistent=HASH(0x56178566c960)', 'Email::Abstract=ARRAY(0x5617858cf3f8)', 'HASH(0x561785667940)') called at /usr/share/perl5/Email/Sender/Simple.pm line 119 Email::Sender::Simple::send_email('Email::Sender::Simple', 'Email::Abstract=ARRAY(0x5617858cf3f8)', 'HASH(0x561785797560)') called at /usr/share/perl5/Email/Sender/Role/CommonSending.pm line 45 Email::Sender::Role::CommonSending::try {...} at /usr/share/perl5/Try/Tiny.pm line 102 eval {...} at /usr/share/perl5/Try/Tiny.pm line 93 Try::Tiny::try('CODE(0x56178576c9a0)', 'Try::Tiny::Catch=REF(0x56178566efd0)') called at /usr/share/perl5/Email/Sender/Role/CommonSending.pm line 58 Email::Sender::Role::CommonSending::send('Email::Sender::Simple', 'Email::MIME=HASH(0x5617842f0960)', 'HASH(0x56177f79d1e8)') called at /usr/share/perl5/Email/Stuffer.pm line 784 Email::Stuffer::send_or_die('Koha::Email=HASH(0x561784f645f0)', 'HASH(0x5617856681e0)') called at /usr/share/koha/Koha/Email.pm line 237 Koha::Email::send_or_die('Koha::Email=HASH(0x561784f645f0)', 'HASH(0x5617856681e0)') called at /usr/share/koha/C4/Letters.pm line 1573 C4::Letters::try {...} at /usr/share/perl5/Try/Tiny.pm line 100 eval {...} at /usr/share/perl5/Try/Tiny.pm line 93 Try::Tiny::try('CODE(0x561782f0aa40)', 'Try::Tiny::Catch=REF(0x561785771ad8)') called at /usr/share/koha/C4/Letters.pm line 1595 C4::Letters::_send_message_by_email('HASH(0x561785669e90)', undef, undef, undef, 'HASH(0x5617855899e0)') called at /usr/share/koha/C4/Letters.pm line 1077 C4::Letters::SendQueuedMessages('HASH(0x561785559468)') called at /usr/share/koha/opac/opac-sendshelf.pl line 122 eval {...} at /usr/share/koha/opac/opac-sendshelf.pl line 2