From 09199ae2ea091126d0481e16ad16b3a0479c256b Mon Sep 17 00:00:00 2001 From: Peter Williams Date: Thu, 10 Aug 2000 19:34:50 +0000 Subject: Show 'no new mail' correctly. svn path=/trunk/; revision=4699 --- mail/mail-tools.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'mail/mail-tools.c') diff --git a/mail/mail-tools.c b/mail/mail-tools.c index 10e70a6a6f..2ae83229ef 100644 --- a/mail/mail-tools.c +++ b/mail/mail-tools.c @@ -156,6 +156,7 @@ mail_tool_do_movemail (const gchar *source_url, CamelException *ex) gchar *dest_path; const gchar *source; CamelFolder *ret; + struct stat sb; #ifndef MOVEMAIL_PATH int tmpfd; #endif @@ -195,6 +196,13 @@ mail_tool_do_movemail (const gchar *source_url, CamelException *ex) mail_tool_camel_lock_up(); camel_movemail (source, dest_path, ex); mail_tool_camel_lock_down(); + + if (stat (dest_path, &sb) < 0 || sb.st_size == 0) { + g_free (dest_path); + g_free (dest_url); + return NULL; + } + g_free (dest_path); if (camel_exception_is_set (ex)) { @@ -423,6 +431,10 @@ mail_tool_fetch_mail_into_searchable (const char *source_url, gboolean keep_on_s else spool_folder = mail_tool_get_inbox (source_url, ex); + /* No new mail */ + if (spool_folder == NULL) + return NULL; + if (camel_exception_is_set (ex)) goto cleanup; -- cgit