Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed #90: Allow for longer email address in Return-Path #91

Merged
merged 1 commit into from
Sep 14, 2023

Conversation

derickr
Copy link
Member

@derickr derickr commented Sep 13, 2023

RFC 2821 states that the local part may only be 64 characters, but with SRS this often gets violated.

This patch takes PHP's filter_var() email validation regular expression, and extends the allowed length from 64 to 124 for the local part, but only for Return-Path headers.

RFC 2821 states that the local part may only be 64 characters, but with SRS
this often gets violated.

This patch takes PHP's `filter_var()` email validation regular expression, and
extends the allowed length from 64 to 124 for the local part, but only for
Return-Path headers.
@eileenmcnaughton
Copy link
Contributor

@agileware-justin does this work with your problem emails?

@agileware-justin
Copy link
Contributor

I tested this change using the two email addresses we recorded as being problematic. Tests as shown below passed.

    public function testLongReturnPath1()
    {
        $mail = new ezcMail();
        $mail->returnPath = new ezcMailAddress( "SRS0=3Ypr33=QM=crm.nothappyjohn.org.au=bounce+b.25211.6039846.eb7e7e8ba282f9d0@airquotes.com.au" );
        $this->assertEquals( "SRS0=3Ypr33=QM=crm.nothappyjohn.org.au=bounce+b.25211.6039846.eb7e7e8ba282f9d0@airquotes.com.au", $mail->returnPath->email );
    }

    public function testLongReturnPath2()
    {
        $mail = new ezcMail();
        $mail->returnPath = new ezcMailAddress( "x2108-arfsfufwyfgkvni2x7ww5wvac3eifc2wx3vr1fcwbbysieqppis4ytnyip09xcohck9s1vrm77nbg4xh431tthdsmtmfvfpa@rspf.mxthunderstruck.net" );
        $this->assertEquals( "x2108-arfsfufwyfgkvni2x7ww5wvac3eifc2wx3vr1fcwbbysieqppis4ytnyip09xcohck9s1vrm77nbg4xh431tthdsmtmfvfpa@rspf.mxthunderstruck.net", $mail->returnPath->email );
    }

@derickr derickr merged commit 4b2c96a into master Sep 14, 2023
10 checks passed
@derickr derickr deleted the issue90-returnPath-ezcMail branch September 14, 2023 13:17
@agileware-justin
Copy link
Contributor

Awesome thanks @derickr and @eileenmcnaughton - that's going to unblock a lot of emails 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants