diff options
Diffstat (limited to 'pullimap')
-rwxr-xr-x | pullimap | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -110,6 +110,7 @@ sub writeUID($) { ; $offset < 4 ; $offset += syswrite($STATE, $uid, 4-$offset, $offset) // die "Can't syswrite: $!" ) {} + # no need to sync (or flush) since $STATE is opened with O_DSYNC } @@ -218,10 +219,10 @@ sub smtp_send(@) { # Initialize the cache from the statefile, then pull new messages from # the remote mailbox # -$CONF->{'logger-fd'} = \*STDERR if $CONFIG{debug}; my $IMAP = do { my %config = (%$CONF, %CONFIG{qw/quiet debug/}, name => $ARGV[0]); $config{keepalive} = 1 if defined $CONFIG{idle}; + $config{'logger-fd'} = \*STDERR if $CONFIG{debug}; Net::IMAP::InterIMAP::->new( %config ); }; @@ -287,7 +288,7 @@ sub pull(;$) { $IMAP->silent_store(compact_set(@$ignore, @uid), '+', '\Seen') if @$ignore or @uid; # update the statefile - sysseek($STATE, 4, SEEK_SET) // die "Can't seek: $!"; + sysseek($STATE, 4, SEEK_SET) or die "Can't seek: $!"; my ($uidnext) = $IMAP->get_cache('UIDNEXT'); writeUID($uidnext); truncate($STATE, 8) // die "Can't truncate"; |