From 3bc3cc8ed99ab1b23fb20f94ba610c24d404455c Mon Sep 17 00:00:00 2001 From: Guilhem Moulin Date: Sun, 13 Mar 2016 04:02:27 +0100 Subject: interimap: reformulation in manpage --- interimap.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/interimap.md b/interimap.md index 9d55d9e..7d119ab 100644 --- a/interimap.md +++ b/interimap.md @@ -375,8 +375,9 @@ Valid options are: Supported extensions ==================== -Performance is better for servers supporting the following extensions to -the [IMAP4rev1 protocol][RFC 3501]: +`interimap` takes advantage of servers supporting the following +extensions to the [IMAP4rev1 protocol][RFC 3501] (those marked as +“recommended” give the most significant performance gain): * `LITERAL+` ([RFC 2088], recommended); * `MULTIAPPEND` ([RFC 3502], recommended); -- cgit v1.2.3 From 11c1344bdadb5a5aca061e1a5483c05c3b2c746e Mon Sep 17 00:00:00 2001 From: Guilhem Moulin Date: Sun, 13 Mar 2016 16:23:26 +0100 Subject: pullimap: fix struct flock packing --- pullimap | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pullimap b/pullimap index 317e880..65e222b 100755 --- a/pullimap +++ b/pullimap @@ -83,7 +83,9 @@ do { } sysopen($STATE, $statefile, O_CREAT|O_RDWR|O_DSYNC, 0600) or die "Can't open $statefile: $!"; - fcntl($STATE, F_SETLK, pack('sslll', F_WRLCK, SEEK_SET, 0, 0, $$)) or die "Can't lock $statefile: $!"; + # XXX we need to pack the struct flock manually: not portable! + my $struct_flock = pack('s!s!l!l!i!', F_WRLCK, SEEK_SET, 0, 0, 0); + fcntl($STATE, F_SETLK, $struct_flock) or die "Can't lock $statefile: $!"; my $flags = fcntl($STATE, F_GETFD, 0) or die "fcntl F_GETFD: $!"; fcntl($STATE, F_SETFD, $flags | FD_CLOEXEC) or die "fcntl F_SETFD: $!"; }; -- cgit v1.2.3 From 0cb3d9c8d688920fbe88721f36140a1281da3b9a Mon Sep 17 00:00:00 2001 From: Guilhem Moulin Date: Sun, 13 Mar 2016 18:44:24 +0100 Subject: pullimap: precise that the mailbox needs to be UTF-7 encoded and unquoted. --- pullimap.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pullimap.md b/pullimap.md index 244e7ac..5ff3af1 100644 --- a/pullimap.md +++ b/pullimap.md @@ -92,8 +92,9 @@ Valid options are: *mailbox* -: The IMAP mailbox to pull messages from. Support for persistent - message Unique Identifiers (UID) is required. (Default: `INBOX`.) +: The IMAP mailbox ([UTF-7 encoded][RFC 2152] and unquoted) to pull + messages from. Support for persistent message Unique Identifiers + (UID) is required. (Default: `INBOX`.) *deliver-method* @@ -314,6 +315,9 @@ Standards [RFC 2033], October 1996. * J. Myers, _IMAP4 non-synchronizing literals_, [RFC 2088], January 1997. + * D. Goldsmith and M. Davis, + _A Mail-Safe Transformation Format of Unicode_, + [RFC 2152], May 1997. * B. Leiba, _IMAP4 `IDLE` command_, [RFC 2177], June 1997. * C. Newman, _Using TLS with IMAP, POP3 and ACAP_, @@ -337,6 +341,7 @@ Standards [RFC 2177]: https://tools.ietf.org/html/rfc2177 [RFC 2595]: https://tools.ietf.org/html/rfc2595 [RFC 4959]: https://tools.ietf.org/html/rfc4959 +[RFC 2152]: https://tools.ietf.org/html/rfc2152 [RFC 2088]: https://tools.ietf.org/html/rfc2088 [RFC 5321]: https://tools.ietf.org/html/rfc5321 [RFC 2033]: https://tools.ietf.org/html/rfc2033 -- cgit v1.2.3 From f2f4d314990f67ad1ad842951f724f6bda678cfd Mon Sep 17 00:00:00 2001 From: Guilhem Moulin Date: Sun, 12 Jun 2016 22:17:44 +0200 Subject: pullimap: Clean up PATH. --- interimap | 2 +- pullimap | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/interimap b/interimap index 17d28c2..150c754 100755 --- a/interimap +++ b/interimap @@ -33,7 +33,7 @@ use lib 'lib'; use Net::IMAP::InterIMAP qw/read_config compact_set/; # Clean up PATH -$ENV{PATH} = join ':', qw{/usr/local/bin /usr/bin /bin}; +$ENV{PATH} = join ':', qw{/usr/bin /bin}; delete @ENV{qw/IFS CDPATH ENV BASH_ENV/}; my %CONFIG; diff --git a/pullimap b/pullimap index 65e222b..054048c 100755 --- a/pullimap +++ b/pullimap @@ -33,6 +33,10 @@ use Socket qw/PF_INET PF_INET6 SOCK_STREAM/; use lib 'lib'; use Net::IMAP::InterIMAP qw/read_config compact_set/; +# Clean up PATH +$ENV{PATH} = join ':', qw{/usr/bin /bin}; +delete @ENV{qw/IFS CDPATH ENV BASH_ENV/}; + my %CONFIG; sub usage(;$) { my $rv = shift // 0; -- cgit v1.2.3 From 320a4da020952e3a8b926535d03d49a28dea20d0 Mon Sep 17 00:00:00 2001 From: Guilhem Moulin Date: Sun, 12 Jun 2016 22:18:43 +0200 Subject: pullimap: enable locally unsetting the 'purge-after' option. --- pullimap | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pullimap b/pullimap index 054048c..e971f64 100755 --- a/pullimap +++ b/pullimap @@ -66,7 +66,7 @@ my $CONF = read_config( delete $CONFIG{config} // $NAME, , 'deliver-method' => qr/\A([ls]mtp:\[.*\]:\d+)\z/ , 'deliver-ehlo' => qr/\A(\P{Control}+)\z/ , 'deliver-rcpt' => qr/\A(\P{Control}+)\z/ - , 'purge-after' => qr/\A(\d+)\z/ + , 'purge-after' => qr/\A(\d*)\z/ )->{$ARGV[0]}; my ($MAILBOX, $STATE); @@ -238,7 +238,7 @@ my $LAST_PURGED; sub purge() { my $days = $CONF->{'purge-after'} // return; my ($uidnext) = $IMAP->get_cache('UIDNEXT'); - return unless 1<$uidnext; + return unless $days ne '' and 1<$uidnext; my $set = "1:".($uidnext-1); unless ($days == 0) { -- cgit v1.2.3