From: Jeff King Date: Tue, 22 Apr 2008 10:41:47 +0000 (-0400) Subject: Don't force imap.host to be set when imap.tunnel is set X-Git-Tag: v1.5.5.2~25 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=34b5cd1fe9f9130b747388a1a968a8d4c9906865;p=git.git Don't force imap.host to be set when imap.tunnel is set The documentation for git-imap-send suggests a tunnel setting such as Tunnel = "ssh -q user@server.com /usr/bin/imapd ./Maildir 2> /dev/null" which works wonderfully and doesn't require a username, password or port setting. However, git-imap-send currently requires that the imap.host variable be set in the config even when it was unused. This patch changes imap-send to only require that the imap.host setting is set if imap.tunnel is not set. Otherwise, server.host is set to "tunnel" for reporting purposes. Acked-by: Andy Parkins Signed-off-by: Junio C Hamano --- diff --git a/imap-send.c b/imap-send.c index 04afbc492..db6559725 100644 --- a/imap-send.c +++ b/imap-send.c @@ -1303,8 +1303,11 @@ main(int argc, char **argv) return 1; } if (!server.host) { - fprintf( stderr, "no imap host specified\n" ); - return 1; + if (!server.tunnel) { + fprintf( stderr, "no imap host specified\n" ); + return 1; + } + server.host = "tunnel"; } /* read the messages */