Skip to content

Commit

Permalink
Don't force imap.host to be set when imap.tunnel is set
Browse files Browse the repository at this point in the history
The documentation for git-imap-send suggests a tunnel setting such as

  Tunnel = "ssh -q [email protected] /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 <[email protected]>

Signed-off-by: Junio C Hamano <[email protected]>
  • Loading branch information
peff authored and gitster committed Apr 23, 2008
1 parent 2498a1a commit 34b5cd1
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions imap-send.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit 34b5cd1

Please sign in to comment.