diff options
Diffstat (limited to 'imap-send.c')
-rw-r--r-- | imap-send.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/imap-send.c b/imap-send.c index f3cb79b1f..ea56dc9ae 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) { |