I'm using Perl with the
Mime::Lite module
to send email to my subscribed mailing list using
DomainKeys Identified Mail (DKIM)
and
Sender Policy Framework (SPF)
record:
use MIME::Lite;
use Net::SMTP;
my $host = 'mail.domain.com';
my $user = '[email protected]';
my $pass = 'password1234';
MIME::Lite->send('smtp', $host, AuthUser => $user, AuthPass => $pass);
my $msg = MIME::Lite->new(
From => $from,
To => $to,
Subject => $subject_enc,
Type => 'text/plain; charset=UTF-8',
Encoding => 'quoted-printable',
Data => 'Hello everyone!'
);
$msg->send;
This works just fine, but the DKIM signature fails in Gmail (and presumably others).
However, when I send email without SMTP authentication:
use MIME::Lite;
my $msg = MIME::Lite->new(
From => $from,
To => $to,
Subject => $subject_enc,
Type => 'text/plain; charset=UTF-8',
Encoding => 'quoted-printable',
Data => 'Hello everyone!'
);
$msg->send;
The DKIM passes fine.
So my question is: if I have successfully implemented both DKIM and SPF records on all my outgoing email, is it even necessary to use SMTP authentication to verify the sender of the email, or is piping to Sendmail with the appropriate headers sufficient to ensure best chance of delivery?