aboutsummaryrefslogtreecommitdiffstats
path: root/mail/mail-tools.c
diff options
context:
space:
mode:
authorPeter Williams <peterw@src.gnome.org>2000-08-11 03:34:50 +0800
committerPeter Williams <peterw@src.gnome.org>2000-08-11 03:34:50 +0800
commit09199ae2ea091126d0481e16ad16b3a0479c256b (patch)
treed3adf3737bb843b1dae5c7036af031784ffc2ca7 /mail/mail-tools.c
parent8d36ddc51a03541d41c7bc517fb84f8382d56254 (diff)
downloadgsoc2013-evolution-09199ae2ea091126d0481e16ad16b3a0479c256b.tar
gsoc2013-evolution-09199ae2ea091126d0481e16ad16b3a0479c256b.tar.gz
gsoc2013-evolution-09199ae2ea091126d0481e16ad16b3a0479c256b.tar.bz2
gsoc2013-evolution-09199ae2ea091126d0481e16ad16b3a0479c256b.tar.lz
gsoc2013-evolution-09199ae2ea091126d0481e16ad16b3a0479c256b.tar.xz
gsoc2013-evolution-09199ae2ea091126d0481e16ad16b3a0479c256b.tar.zst
gsoc2013-evolution-09199ae2ea091126d0481e16ad16b3a0479c256b.zip
Show 'no new mail' correctly.
svn path=/trunk/; revision=4699
Diffstat (limited to 'mail/mail-tools.c')
-rw-r--r--mail/mail-tools.c12
1 files changed, 12 insertions, 0 deletions
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;