Announcement

Collapse
No announcement yet.

Sellerdeck emails blocked by Gmail and Yahoo new sender policy changes

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Sellerdeck emails blocked by Gmail and Yahoo new sender policy changes

    I have started having several customers having their website emails (contact form, order notification etc) blocked and returned as undeliverable. My hosting is by Krystal and they use Mail Channels to deliver mail and it is Mail Channels blocking the emails. Other hosts may be having similar issues with their Mail Delivery systems.

    See my blog post: https://www.graphicz.co.uk/blog/ensu...est-practices/

    After much investigation it seems that the messages are being blocked because Sellerdeck does not add a message-id to the emails it sends out.

    If you look at the headers of a non delivered email there IS a message-id but it has a dot in the middle
    Code:
    1710778280371.2db30d7448aa7d28@website.com
    The message ID with the dot in the middle is automatically injected by MailChannels because the message did not have an ID at the point of the initial email transaction.

    Sellerdeck support were unhelpful.

    To try and avoid SMTP I went to Norman's sendmail patch. As it stands, it doesn't work in v18 but with minor editing I got it to work. It sends out emails WITH a message-id (no dot!) and these are delivered without issue by MailChannels.

    Here is the fix:

    This needs a host with Perl that supports the Mail::Mailer module

    Patching instructions for Actinic.pm (back it up first - use a text editor - not a word processor):-

    Look about 25 lines down from the top. You should see a line

    Code:
    use strict;
    ADD the following line immediately after this

    Code:
    use Mail::Mailer;
    Search for the line (there is only one instance)

    Code:
    sub SendMail
    DELETE the above line and everything following it down to the line above the following fragment

    Code:
    #######################################################
    #
    # GetScriptUrl - retrieve an url to the specified script

    REPLACE the stuff you just deleted with the following new routine:-
    ===============================================================================================

    Code:
    sub SendMail
    {
    #? ACTINIC::ASSERT($#_ >= 4, "Invalid argument count in SendMail ($#_)", __LINE__, __FILE__);
    
    #
    # !!!!!! Thiss. Any changes to its interface will
    # !!!!!! need to be verified with the various utility scripts.
    #
    
    if ($#_ < 4)
    {
    return($::FAILURE, GetPhrase(-1, 12, 'Actinic::SendMail'), 0, 0);
    }
    
    my ($sSmtpServer, $sEmailAddress, $sLocalError, $sSubjectText, $sMessageText, $sMessageHTML, $sBoundary, $sReturnAddress);
    ($sSmtpServer, $sEmailAddress, $sSubjectText, $sMessageText, $sMessageHTML, $sReturnAddress) = @_;
    #
    # Check message content for bare LFs and repair if there are some
    #
    
    $sMessageText =~ s/\r\n/\n/g; # CRLF -> LF
    $sMessageText =~ s/\r/\n/g; # remaining CR -> LF
    $sMessageText =~ s/\n/\r\n/g; # all LF -> CRLF
    # and check the HTML content as well
    $sMessageHTML =~ s/\r\n/\n/g; # CRLF -> LF
    $sMessageHTML =~ s/\r/\n/g; # remaining CR -> LF
    $sMessageHTML =~ s/\n/\r\n/g; # all LF -> CRLF
    #
    # Check the return address
    #
    if (!$sReturnAddress) # if no return address defined
    {
    $sReturnAddress = $sEmailAddress; # use the destination email address
    }
    
    # (V11) use systems sendmail program
    my $mailer = Mail::Mailer->new();
    $mailer->open({ From => $sReturnAddress,
    To => $sEmailAddress,
    Subject => $sSubjectText,
    })
    or die "Can't open: $!\n";
    
    print $mailer $sMessageText;
    $mailer->close();
    
    return($::SUCCESS, '', 0, 0);
    }
    ===================================================================================================
    Save and do a site update and that's that.

    Norman's original had SendRichMail - I just changed all instances of this to SendMail

    Bugs / Quirks.

    Some users have reported that the e-mail is sent on one long line.
    If this happens open the (patched)Actinic.pm and look for the line

    Code:
    $sMessageText =~ s/\n/\r\n/g; # all LF -> CRLF
    and comment it out by adding "#" at the beginning. I.e.

    Code:
    # $sMessageText =~ s/\n/\r\n/g; # all LF -> CRLF
    Save and see if that fixes it.

    Remember that if you update Actinic the updater will overwrite patched scripts with new
    version and you'll have to redo the patch.

    Thank you to Norman www.drillpine.biz (V11) (adapted for v18)

    Testing and feedback welcome - posted as a good will thing without warranty express or implied.
    Jonathan Chappell
    Website Designer
    SellerDeck Website Designer
    Actinic to SellerDeck upgrades
    Graphicz Limited - www.graphicz.co.uk

    #2
    Apparently this problem can be resolved by adding a line and some code to the SMPTLibrary.pm script. Look at line 489:

    Code:
     my $mail_headers = "From: $mail_from\n".
    "To: $mail_to\n".
    "Reply-to: $mail_replyTo\n".
    "Subject: ".encode('MIME-Header', $mail_subject)."\n".
    "Date: $sNow\n";
    "MIME-Version: 1.0\n";
    Change this to:

    Code:
     my $mail_headers = "From: $mail_from\n".
    "To: $mail_to\n".
    "Reply-to: $mail_replyTo\n".
    "Subject: ".encode('MIME-Header', $mail_subject)."\n".
    "Date: $sNow\n".
    "Message-Id: " . create_mid()."\n".
    "MIME-Version: 1.0\n";
    Note that "Date: $sNow\n"; is different to "Date: $sNow\n".

    AT the very bottom of SMPTLibrary.pm replace:

    Code:
    }
    1;
    with

    Code:
     }
    
    # Code derived from Email::MessageID 1.406 by Ricardo Signes
    # http://cpansearch.perl.org/src/RJBS/Email-MessageID-1.406/lib/Email/MessageID.pm
    use Sys::Hostname qw/hostname/;
    my @CHARS = ('A'..'F','a'..'f',0..9);
    my %uniq;
    sub create_mid {
    my $noise = join '',
    map {; $CHARS[rand @CHARS] } (0 .. (3 + int rand 6));
    my $t = time;
    my $u = exists $uniq{$t} ? ++$uniq{$t} : (%uniq = ($t => 0))[1];
    my $user = join '.', $t . $u, $noise, $$;
    return '<' . $user . '@' . hostname . '>';
    }
    
    1;

    Link to my blog version: https://www.graphicz.co.uk/blog/edit...eliverability/

    Download the patched file with instructions;

    • Please go to https://graphicz.solutions/SmtpLibrary.pm.txt - the file SMPTLibrary.pm.txt will download to your Downloads folder
    • Copy SMPTLibrary.pm.txt to your Desktop then rename the file by removing the .txt (ignore any warnings) so you are left with SMPTLibrary.pm
    • Close Sellerdeck and do a snapshot.
    • In the Site folder find SMPTLibrary.pm and right click, copy and paste so you have a backup.
    • Delete the original SMPTLibrary.pm.
    • Copy the new SMPTLibrary.pm from your Desktop and paste into the site folder.
    • Reopen Sellerdeck and do Web, Refresh website.
    Last edited by graphicz; 29-Mar-2024, 08:28 AM. Reason: => replaces =&gt;
    Jonathan Chappell
    Website Designer
    SellerDeck Website Designer
    Actinic to SellerDeck upgrades
    Graphicz Limited - www.graphicz.co.uk

    Comment


      #3
      Thanks Jonathan, and well spotted.

      Note that "Date: $sNow\n"; is different to "Date: $sNow\n".
      That missing DOT explains why the MIME version isn't being added to the email header.

      I'll go and add this to my scripts.

      Mike
      -----------------------------------------

      First Tackle - Fly Fishing and Game Angling

      -----------------------------------------

      Comment


        #4
        Thanks Mike. I can't take any credit. Kudos to Hugh and Gordon.
        Jonathan Chappell
        Website Designer
        SellerDeck Website Designer
        Actinic to SellerDeck upgrades
        Graphicz Limited - www.graphicz.co.uk

        Comment


          #5
          I was going to say give Hugh and Gordon some Kudos but I could not get that perl version of the code to run at all.

          So after a lot of persistence I gave up and simplified it.

          What I've done is cut out the subroutine and use this as the first part of the code (from line 489).

          Code:
          my $random_header = '<' . localtime(). 'xyz' . int(rand(100000)). '@my-domain.co.uk>';
          
          my $mail_headers = "From: $mail_from\n".
          "To: $mail_to\n".
          "Reply-to: $mail_replyTo\n".
          "Subject: ".encode('MIME-Header', $mail_subject)."\n".
          "Date: $sNow\n".
          # "Message-Id: " . create_mid()."\n".
          "Message-Id: " . $random_header ."\n".
          "MIME-Version: 1.0\n";
          This seems to work and generates a correct and unique message ID that looks like this:

          Message-Id: <Thu Mar 28 16:16:41 2024xyz56447@my-domain.co.uk>

          I think it's pretty obvious how the random header for the message ID is created and it can easily be customised. Use your own domain in the random header string and you're good to go.
          -----------------------------------------

          First Tackle - Fly Fishing and Game Angling

          -----------------------------------------

          Comment


            #6
            It was certainly tested by me and SD. Prior to your post I had added a download link and instructions for the patched file above.

            The post seems to have suffered some encoding issue, I have changed < > instead of &lt; and &gt;

            Also => replaces =&gt;

            Also don't miss the curly bracket at the top of the code to go at the bottom

            Last edited by graphicz; 29-Mar-2024, 08:28 AM. Reason: => replaces =&gt;
            Jonathan Chappell
            Website Designer
            SellerDeck Website Designer
            Actinic to SellerDeck upgrades
            Graphicz Limited - www.graphicz.co.uk

            Comment


              #7
              I seem to have customers with Yahoo emails missing their confirmation emails recently.
              I don't use any patches or add-ons for email, so is this something that Sellrdeck are looking into?

              Comment


                #8
                I do not speak for Sellerdeck.

                The SMPTLibrary.pm script fix (https://www.graphicz.co.uk/blog/edit...eliverability/), plus attending to https://www.graphicz.co.uk/blog/ensu...est-practices/ should deal with any Yahoo difficulties too.
                Jonathan Chappell
                Website Designer
                SellerDeck Website Designer
                Actinic to SellerDeck upgrades
                Graphicz Limited - www.graphicz.co.uk

                Comment


                  #9
                  I personally haven't had any complaints as yet, is this something we should all do as a precaution?


                  Thanks Ed
                  https://www.harrisontelescopes.co.uk/

                  Ed Harrison - Menmuir Scotland

                  Comment


                    #10
                    Thanks Jon,
                    I spent a whole weekend on SPIF, DKIM and DMARC and couldn't get one tool to verify all were working at the same time so it is hit and miss when testing.
                    After doing all the best practices I could get an email through to yahoo.com without the patch but I have added it anyway to another site and that works as well and comes straight through.
                    I did notice a ten-minute delay before making the best practice changes.

                    How do you interrogate the mime headers to see the message id?
                    No worries, found it. https://support.microsoft.com/en-gb/...4-c048563d212c

                    Hi Ed,
                    Good question and I hope it can be answered.

                    Comment


                      #11
                      is this something we should all do as a precaution?
                      I do not speak for SD but my understanding is that the SMTPLibrary edit will be incorportated in a future release of SD.

                      Personally I would ensure your outgoing emails do have a 'Message-Id' but it is up to you.

                      Michael, I use https://www.mail-tester.com/ and I subscribe to the MxToolbox Delivery Center (https://mxtoolbox.com/c/products/deliverycenter)
                      Jonathan Chappell
                      Website Designer
                      SellerDeck Website Designer
                      Actinic to SellerDeck upgrades
                      Graphicz Limited - www.graphicz.co.uk

                      Comment

                      Working...
                      X