[Bug 41025] New: Koha::Email->is_valid approves addresses like test@test
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41025 Bug ID: 41025 Summary: Koha::Email->is_valid approves addresses like test@test Change sponsored?: --- Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: koha-bugs@lists.koha-community.org Reporter: m.de.rooy@rijksmuseum.nl QA Contact: testopia@bugs.koha-community.org -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41025 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=28870 -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41025 --- Comment #1 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Related to change from Email::Valid to Email::Address -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41025 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |tomascohen@gmail.com --- Comment #2 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Tomas added an issue on CPAN: https://github.com/Perl-Email-Project/Email-Address/issues/24 -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41025 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Small patch -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41025 --- Comment #3 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 187917 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=187917&action=edit Bug 41025: Check for a dot in domain name, allow localhost If Email::Address has been patched, this can be removed. Test plan: Run t/Koha/Email.t Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41025 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |m.de.rooy@rijksmuseum.nl |ity.org | -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41025 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dcook@prosentient.com.au --- Comment #4 from David Cook <dcook@prosentient.com.au> --- Hmm, technically I think that Tomas might be wrong to raise a bug for the email library. A valid email address is just a localpart@domain where domain can be a domain name or an IP address. As noted in this patch, the domain could be localhost. It could be a computer name, it could be an internal domain of some other type. I think there's a difference between a valid email address and an existing email address. That said, it could be worthwhile adding some extra validation at the Koha level. Rather than hard-coding localhost, we might want to have a syspref to allow admins to add additional local domains. While it seems unlikely for most real world scenarios I can think of off the top of my head, it is possible for special/edge cases. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41025 --- Comment #5 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- (In reply to David Cook from comment #4)
Hmm, technically I think that Tomas might be wrong to raise a bug for the email library.
A valid email address is just a localpart@domain where domain can be a domain name or an IP address. As noted in this patch, the domain could be localhost. It could be a computer name, it could be an internal domain of some other type.
You're probably right. RFC 5322 says the domain-literal needs to make sense in the context being used: https://datatracker.ietf.org/doc/html/rfc5322#section-3.4.1 I was looking at the SMTP RFC: https://datatracker.ietf.org/doc/html/rfc5321#section-2.3.5 and thought in the context of SMTP it should really be a FQDN, an IP or some reserved words like localhost. Either way, it is not the email address parser responsibility, but the transport's. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41025 --- Comment #6 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- (In reply to David Cook from comment #4)
Hmm, technically I think that Tomas might be wrong to raise a bug for the email library.
I'd like to hear from the author, though. I need to know if that project is alive at all. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41025 --- Comment #7 from David Cook <dcook@prosentient.com.au> --- (In reply to Tomás Cohen Arazi (tcohen) from comment #6)
(In reply to David Cook from comment #4)
Hmm, technically I think that Tomas might be wrong to raise a bug for the email library.
I'd like to hear from the author, though. I need to know if that project is alive at all.
Mmm good call. Fingers crossed they get back to you. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41025 --- Comment #8 from David Cook <dcook@prosentient.com.au> --- (In reply to Tomás Cohen Arazi (tcohen) from comment #5)
Either way, it is not the email address parser responsibility, but the transport's.
I figure the SMTP client will work it out in the end, as per its specs, but it could be interesting to have validation in Koha as well. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41025 --- Comment #9 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to David Cook from comment #8)
(In reply to Tomás Cohen Arazi (tcohen) from comment #5)
Either way, it is not the email address parser responsibility, but the transport's.
I figure the SMTP client will work it out in the end, as per its specs, but it could be interesting to have validation in Koha as well.
If you use a smarthost to push the mail further for later processing (in my case in another mail container), Koha will just mark these wrong mails as sent (like successful) while they will be failing later on. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41025 --- Comment #10 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- I am wondering too if we should allow IP addresses and local host names (like localhost etc) by default? I guess not. See also bug 28017 which was (partially) undone when moving away from Email::Valid. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41025 --- Comment #11 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to Marcel de Rooy from comment #9)
(In reply to David Cook from comment #8)
(In reply to Tomás Cohen Arazi (tcohen) from comment #5)
Either way, it is not the email address parser responsibility, but the transport's.
I figure the SMTP client will work it out in the end, as per its specs, but it could be interesting to have validation in Koha as well.
If you use a smarthost to push the mail further for later processing (in my case in another mail container), Koha will just mark these wrong mails as sent (like successful) while they will be failing later on.
Suppose that using the queue runner in exim would have the same result btw. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41025 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Koha::Email->is_valid |Koha::Email->is_valid needs |approves addresses like |more attention |test@test | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41025 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #187917|0 |1 is obsolete| | --- Comment #12 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Comment on attachment 187917 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=187917 Bug 41025: Check for a dot in domain name, allow localhost This is not enough and arguable -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41025 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|m.de.rooy@rijksmuseum.nl |koha-bugs@lists.koha-commun | |ity.org -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41025 --- Comment #13 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Changed the title to be a bit more generic. To include this observation. is_valid decides that an email address is valid when parse creates one or more Email::Address objects. That is imo a wrong algorithm. Do we really want to check multiple lines / addresses here in the first place? The line "Name" <some@domain.com> is parsed. The address is available via object->address. But is_valid just looks at the count and says the line is valid! So we are going to push the line to SMTP, but not the parsed address! Does not work. The confusion about localhost, non-FQDN etc. still lingers here too. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41025 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=41026 -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41025 --- Comment #14 from David Cook <dcook@prosentient.com.au> --- (In reply to Marcel de Rooy from comment #9)
If you use a smarthost to push the mail further for later processing (in my case in another mail container), Koha will just mark these wrong mails as sent (like successful) while they will be failing later on.
That's true. That is often confusing for users. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41025 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=25382 -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org