aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuilhem Moulin <guilhem@fripost.org>2016-03-09 16:02:29 +0100
committerGuilhem Moulin <guilhem@fripost.org>2016-03-09 16:02:29 +0100
commit2676ef52da48625a2d260169d815717313a0613d (patch)
treeb56774f4ddc34fd516f9b3456d83414c62291353
parente69c927ac798156e99407b4b00c15f446d4ca4d6 (diff)
wibble
-rw-r--r--lib/Net/IMAP/InterIMAP.pm2
-rwxr-xr-xpullimap5
2 files changed, 4 insertions, 3 deletions
diff --git a/lib/Net/IMAP/InterIMAP.pm b/lib/Net/IMAP/InterIMAP.pm
index 5e9028e..bd69d87 100644
--- a/lib/Net/IMAP/InterIMAP.pm
+++ b/lib/Net/IMAP/InterIMAP.pm
@@ -887,7 +887,7 @@ sub append($$@) {
delete $vanished2{$_} foreach keys %vanished;
my $VANISHED = scalar(keys %vanished2); # number of messages VANISHED meanwhile
$cache->{EXISTS} += $#_+1 if defined $cache->{EXISTS} and $cache->{EXISTS} + $VANISHED == $EXISTS;
- $cache->{UIDNEXT} = $UIDNEXT if ($cache->{UIDNEXT} // 1) < $UIDNEXT;
+ $cache->{UIDNEXT} = $UIDNEXT if ($cache->{UIDNEXT} // 1) < $UIDNEXT;
}
unless ($self->{quiet}) {
diff --git a/pullimap b/pullimap
index b620891..a1f82e2 100755
--- a/pullimap
+++ b/pullimap
@@ -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";