X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=imap-send.c;h=ea56dc9ae5e2110c88a3538a9559a6e6d0adb23c;hb=1cd88cc9e6d6f83fed554419166a52a900e6f9a5;hp=f3cb79b1f8ea6fb2e21c89d6b1dba35e975aca30;hpb=521a3f676794987bfd03703fe58fbec46ed69d49;p=git.git diff --git a/imap-send.c b/imap-send.c index f3cb79b1..ea56dc9a 100644 --- a/imap-send.c +++ b/imap-send.c @@ -1332,6 +1332,12 @@ main(int argc, char **argv) return 1; } + total = count_messages( &all_msgs ); + if (!total) { + fprintf(stderr,"no messages to send\n"); + return 1; + } + /* write it to the imap server */ ctx = imap_open_store( &server ); if (!ctx) { @@ -1339,7 +1345,6 @@ main(int argc, char **argv) return 1; } - total = count_messages( &all_msgs ); fprintf( stderr, "sending %d message%s\n", total, (total!=1)?"s":"" ); ctx->name = imap_folder; while (1) {