Script that allows cPanel-forwarded emails to pass spam authentication
Already Exists
One of our customers wrote a script to resolve an issue where resends cause spam filters to mis-identify the email as spam. I'm submitting their script for consideration of being added into a future version of cPanel, per their request:
- #!/usr/bin/perl -w
- # Author: Steve Wolf (stevewolf6@gmail.com)
- # The standard cPanel mail forwarders don't rewrite any of the mail
- # headers, which causes SPF tests to fail, of the form:
- #
- # Received-SPF: softfail (google.com: domain of transitioning
- # user@gmail.com does not designate 208.92.162.130 as
- # permitted sender) client-ip=208.92.162.130;
- # Authentication-Results: mx.google.com;
- # dkim=pass header.i=@gmail.com;
- # spf=softfail (google.com: domain of transitioning
- # user@gmail.com does not designate 208.92.162.130 as
- # permitted sender) smtp.mailfrom=user@gmail.com;
- # dmarc=pass (p=NONE dis=NONE) header.from=gmail.com
- #
- # For the most part, these messages get delivered. But we found that
- # Apple domains (e.g. me.com, mac.com) consider the authentication to be
- # a hard failure from certain addresses (such as paypal.com).
- #
- # This script inserts Resent-* headers into the message before sending
- # it on, thus allowing authentication to succeed downstream.
- #
- # Call this script with the email addresses to which the message will be
- # forwarded, e.g.
- #
- # "| resend.pl user@example.com user@me.com"
- use POSIX qw(strftime);
- use Email::MessageID;
- my @lines;
- while (<STDIN>) {
- next if (/^From /);
- push(@lines, $_);
- }
- my $resent_date = strftime("Resent-Date: %a, %d %b %Y %T %z\n",
- localtime());
- my $resent_id = "Resent-Message-ID: "
- . Email::MessageID->new->in_brackets . "\n";
- foreach my $to (@ARGV) {
- open(MAIL, "| /usr/sbin/sendmail -oi $to")
- || die "sendmail failed\n";
- print MAIL $resent_date, $resent_id, "Resent-To: $to\n", @lines;
- close MAIL;
- }
This request is be resolved in cPanel & WHM version 54. You can see it by enabling SRS in the Exim configuration manager in WHM.
This request is be resolved in cPanel & WHM version 54. You can see it by enabling SRS in the Exim configuration manager in WHM.
This request is be resolved in cPanel & WHM version 54. You can see it by enabling SRS in the Exim configuration manager in WHM.
This request is be resolved in cPanel & WHM version 54. You can see it by enabling SRS in the Exim configuration manager in WHM.
Replies have been locked on this page!