if (socket_write( &imap->buf.sock, buf, bufl ) != bufl) {
free( cmd->cmd );
free( cmd );
- if (cb && cb->data)
+ if (cb)
free( cb->data );
return NULL;
}
normal:
if (cmdp->cb.done)
cmdp->cb.done( ctx, cmdp, resp );
- if (cmdp->cb.data)
- free( cmdp->cb.data );
+ free( cmdp->cb.data );
free( cmdp->cmd );
free( cmdp );
if (!tcmd || tcmd == cmdp)
static char *imap_folder;
static int
-git_imap_config(const char *key, const char *val)
+git_imap_config(const char *key, const char *val, void *cb)
{
char imap_key[] = "imap.";
/* init the random number generator */
arc4_init();
- git_config( git_imap_config );
+ git_config(git_imap_config, NULL);
if (!imap_folder) {
fprintf( stderr, "no imap store specified\n" );
return 1;
}
+ if (!server.host) {
+ if (!server.tunnel) {
+ fprintf( stderr, "no imap host specified\n" );
+ return 1;
+ }
+ server.host = "tunnel";
+ }
/* read the messages */
if (!read_message( stdin, &all_msgs )) {