Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions dist.ini
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ copyright_holder = Ricardo Signes
Moo = 2.000000 ; do not apply fatal warnings to us!
MooX::Types::MooseLike = 0.15 ; InstanceOf uses ->isa
Throwable::Error = 0.200003 ; with $obj->throw and ->throw($str) and Moo
Net::IDN::Encode = 0

Net::SMTP = 3.07 ; SSL support, fixed datasend

Expand Down
8 changes: 7 additions & 1 deletion lib/Email/Sender/Transport/SMTP.pm
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ use Email::Sender::Success::Partial;
use Email::Sender::Role::HasMessage ();
use Email::Sender::Util;
use MooX::Types::MooseLike::Base qw(Bool Int Str HashRef);
use Net::IDN::Encode qw(domain_to_ascii);
use Net::SMTP 3.07; # SSL support, fixed datasend

use utf8 (); # See below. -- rjbs, 2015-05-14
Expand Down Expand Up @@ -105,7 +106,12 @@ has allow_partial_success => (is => 'ro', isa => Bool, default => sub { 0 });

=cut

has helo => (is => 'ro', isa => Str);
has helo => (
is => 'ro',
isa => Str,
coerce => sub { domain_to_ascii( $_[0] ) }
);

has localaddr => (is => 'ro');
has localport => (is => 'ro', isa => Int);

Expand Down
13 changes: 12 additions & 1 deletion t/smtp-via-mock.t
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!perl
use strict;
use warnings;
use utf8;
use Test::More;

BEGIN {
Expand Down Expand Up @@ -32,7 +33,7 @@ BEGIN {
$mock_smtp->{failaddr}{'permfail@example.net'} = [ 519 => 'Permanent STHU' ];
}

plan tests => 95;
plan tests => 97;

use Email::Sender::Transport::SMTP;
use Email::Sender::Transport::SMTP::Persistent;
Expand Down Expand Up @@ -348,6 +349,16 @@ for my $class (qw(
},
);
}

{
local $test = 'helo idn conversion';
local $sender = $class->new({
helo => 'Bücher.ch',
});

is($sender->helo, 'xn--bcher-kva.ch', 'IDN conversion successful');
}

}

subtest "quoteaddr" => sub {
Expand Down