AEV Blocks long Email addresses on User Registration Form

Created on 30 October 2024, 5 months ago

Problem/Motivation

I'm using the Advanced Email Validation module to prevent the registration of suspicious email addresses.
However, I've encountered an issue where the module blocks users with long email addresses from registering. For example, the following email format is prevented from being registered: john.doe+companywithlongadressemaisalorsvraimenttreslong0910@company.com.

(This is a test email; for privacy reasons, Iā€™m unable to provide a real email address. However, the client attempting to register on the site uses a valid long email address format.)

How can I adjust or add a custom validation in order to allow long email addresses?

šŸ’¬ Support request
Status

Active

Version

2.0

Component

Code

Created by

šŸ‡²šŸ‡¦Morocco youssef.maaddi

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @youssef.maaddi
  • šŸ‡¦šŸ‡ŗAustralia darvanen Sydney, Australia

    Hi @youssef.maaddi,

    I just tried registering that email address on a fresh installation of Drupal (11) with AEV installed with default settings - because if anything it would be the automatic basic formatting rule (from the third-party library) that could cause this.

    I was not able to reproduce your problem, can you provide more information please?

  • šŸ‡²šŸ‡¦Morocco youssef.maaddi

    Hello @darvanen

    thank you for your response

    Iā€™m using Drupal 10.3.3 and attempting to create a user through admin/people/create. Before installing the module, I could register users with long email addresses without any issues. you find attached the current configuration:

  • šŸ‡¦šŸ‡ŗAustralia darvanen Sydney, Australia

    @youssef.maaddi I tried creating users through the admin form and the anonymous registration form on 10.3.6 with AEV enabled and the settings you posted. I still cannot reproduce your problem. I would like to help.

    Standard procedure for this kind of this is - attempt to reproduce in a clean install of Drupal with only the required modules installed. If you can reproduce that way please provide steps

    If not, you will need to debug your project to find the cause.

    It is not possible at the moment to override the results provided by the third-party library and I do not yet see a good use-case for that here. Instead I think you're coming up against a bug which may be in contributed or custom code and surfaced by the installation of this module - or may well be in this module.

  • šŸ‡²šŸ‡¦Morocco youssef.maaddi

    @darvanen Apologies, I provided the wrong test email earlier. This email is quite similar to those of real users:
    youssef.maaddi+testtreslongutilisateurmaisalorsvraimenttreslong0910@comp...

    I tested registering that email address on a fresh installation on Drupal 10.3.6, and the issue was reproduced.

  • šŸ‡¦šŸ‡ŗAustralia darvanen Sydney, Australia

    Thanks @youssef.maaddi :)

    I'm sorry to tell you but even if that email address works in some situations it breaks the restrictions for email addresses, specifically https://datatracker.ietf.org/doc/html/rfc5321#section-4.5.3.1.1 which states:

    The maximum total length of a user name or other local-part is 64 octets.

    64 octets is basically 64 characters; I don't really understand the difference, if any. The local part of the email address that is failing is 67 characters long.

    The way this module works is to gather configuration and the value to test which is then passed to stymiee/email-validator. Emails are assumed to be ok until they break one of the checks in that library. The check that this one will be failing is basic email validation which uses the PHP FILTER_VALIDATE_EMAIL Filter. There is no way to alter the output of that particular function, it is a core part of PHP.

    The only way to alter the outcome in favour of email addresses that don't meet the RFC requirements would be to turn off that check, and replace it with a custom implementation, at which point you may as well be using a different module. I'm sorry.

    Please let me know if there is any other way I can help.

  • Status changed to Fixed 3 months ago
  • šŸ‡¦šŸ‡ŗAustralia darvanen Sydney, Australia

    As there has been no answer for nearly 3 months I am closing this as I believe I have answered your query.

    Please feel free to re-open if that is not the case :)

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024