aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuilhem Moulin <guilhem@fripost.org>2016-03-12 00:52:04 +0100
committerGuilhem Moulin <guilhem@fripost.org>2016-03-12 00:52:12 +0100
commitd4f52ae67f007ceacfc1a3ea2d0678600b0df73d (patch)
tree32540484b9b5ba8ccee2fe129ee79e77424004e7
parent1b69b4b599d7acf03e426cfbb376e26bdba95c26 (diff)
Net::IMAP::InterIMAP: set binmode on the socket (and our pipe ends)
-rw-r--r--lib/Net/IMAP/InterIMAP.pm5
-rwxr-xr-xpullimap1
2 files changed, 5 insertions, 1 deletions
diff --git a/lib/Net/IMAP/InterIMAP.pm b/lib/Net/IMAP/InterIMAP.pm
index 1686448..f3e9c9e 100644
--- a/lib/Net/IMAP/InterIMAP.pm
+++ b/lib/Net/IMAP/InterIMAP.pm
@@ -313,6 +313,9 @@ sub new($%) {
foreach ($rd, $wd) {
close $_ or $self->panic("Can't close: $!");
}
+ foreach (qw/STDIN STDOUT/) {
+ binmode($self->{$_}) // $self->panic("binmode: $!")
+ }
}
else {
foreach (qw/host port/) {
@@ -338,10 +341,10 @@ sub new($%) {
setsockopt($socket, Socket::IPPROTO_TCP, 18, 1000 * $cnt * $intvl)
or $self->fail("Can't setsockopt TCP_USER_TIMEOUT: $!");
+ binmode($socket) // $self->panic("binmode: $!");
$self->_start_ssl($socket) if $self->{type} eq 'imaps';
$self->{$_} = $socket for qw/STDOUT STDIN/;
}
- binmode $self->{$_} foreach qw/STDIN STDOUT/;
# command counter
$self->{_TAG} = 0;
diff --git a/pullimap b/pullimap
index c8d4018..8eb2ac0 100755
--- a/pullimap
+++ b/pullimap
@@ -142,6 +142,7 @@ sub sendmail($$) {
next if $! == EINTR; # try again if connect(2) was interrupted by a signal
die "connect: $!";
}
+ binmode($SMTP) // die "binmode: $!";
smtp_resp('220');
my @r = smtp_send($ehlo => '250');