@matheusbsbs / matheus-bagliano / commits / 34b5cd1fe9
Fork 0

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 <andyparkins@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Jeff King committed Apr 22, 2008 at 06:41 UTC 34b5cd1fe9f9130b747388a1a968a8d4c9906865
1 file changed +5 -2
imap-send.c
+5 -2
@@ -1303,8 +1303,11 @@ main(int argc, char **argv)
1303 return 1;
1304 }
1305 if (!server.host) {
1306 - fprintf( stderr, "no imap host specified\n" );
1307 - return 1;
1306 + if (!server.tunnel) {
1307 + fprintf( stderr, "no imap host specified\n" );
1308 + return 1;
1309 + }
1310 + server.host = "tunnel";
1311 }
1312
1313 /* read the messages */