enabled for the remote server, and disabled for the local server.
* Add traffic statistics after closing the connection to the IMAP
server.
+ * Add a configuration option 'null-stderr=YES' to send STDERR to
+ /dev/null for type=tunnel.
-- Guilhem Moulin <guilhem@guilhem.org> Wed, 09 Sep 2015 00:44:35 +0200
(Default: \(lqNO\(rq for the \(lq[local]\(rq section, \(lqYES\(rq for
the \(lq[remote]\(rq section.)
+.TP
+.I null-stderr
+Whether to redirect \fIcommand\fR's standard error to \(lq/dev/null\(rq
+for type \fItype\fR=tunnel.
+(Default: \(lqNO\(rq.)
+
.SH KNOWN BUGS AND LIMITATIONS
.IP \[bu]
password => qr/\A([\x01-\x7F]+)\z/,
auth => qr/\A($RE_ATOM_CHAR+(?: $RE_ATOM_CHAR+)*)\z/,
command => qr/\A(\/\P{Control}+)\z/,
+ 'null-stderr' => qr/\A(YES|NO)\z/i,
compress => qr/\A($RE_ATOM_CHAR+(?: $RE_ATOM_CHAR+)*)\z/,
SSL_fingerprint => qr/\A([A-Za-z0-9]+\$\p{AHex}+)\z/,
SSL_cipher_list => qr/\A(\P{Control}+)\z/,
open STDIN, '<&', $rd or $self->panic("Can't dup: $!");
open STDOUT, '>&', $wd or $self->panic("Can't dup: $!");
+ my $stderr2;
+ if (uc ($self->{'null-stderr'} // 'NO') eq 'YES') {
+ open $stderr2, '>&', *STDERR;
+ open STDERR, '>', '/dev/null' or $self->panic("Can't open /dev/null: $!");
+ }
+
my $sigset = POSIX::SigSet::->new(SIGINT);
my $oldsigset = POSIX::SigSet::->new();
sigprocmask(SIG_BLOCK, $sigset, $oldsigset) // $self->panic("Can't block SIGINT: $!");
- exec $command or $self->panic("Can't exec: $!");
+ unless (exec $command) {
+ my $err = $!;
+ if (defined $stderr2) {
+ close STDERR;
+ open STDERR, '>&', $stderr2;
+ }
+ $self->panic("Can't exec: $err");
+ }
}
# parent