Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Ángel
evolution
Commits
eac4adfb
Commit
eac4adfb
authored
Mar 03, 2011
by
Milan Crha
Committed by
Rodrigo Moya
Jun 29, 2011
Browse files
Bug #643218 - Local delivery doesn't deliver after maildir migration
parent
c1b409dd
Changes
6
Hide whitespace changes
Inline
Side-by-side
mail/e-mail-store.c
View file @
eac4adfb
...
...
@@ -30,6 +30,7 @@
#include
"mail/e-mail-local.h"
#include
"mail/em-folder-tree-model.h"
#include
"mail/em-utils.h"
#include
"mail/mail-folder-cache.h"
#include
"mail/mail-mt.h"
#include
"mail/mail-ops.h"
...
...
@@ -251,6 +252,10 @@ mail_store_load_accounts (EMailSession *session,
if
(
uri
==
NULL
||
*
uri
==
'\0'
)
continue
;
/* do not add local-delivery files into the tree those are server specifically */
if
(
em_utils_is_local_delivery_mbox_file
(
uri
))
continue
;
e_mail_store_add_by_uri
(
session
,
uri
,
display_name
);
}
...
...
mail/em-utils.c
View file @
eac4adfb
...
...
@@ -2353,3 +2353,27 @@ emu_restore_folder_tree_state (EMFolderTree *folder_tree)
g_key_file_free
(
key_file
);
}
/* checks whether uri points to a local mbox file and returns TRUE if yes. */
gboolean
em_utils_is_local_delivery_mbox_file
(
const
gchar
*
uri
)
{
g_return_val_if_fail
(
uri
!=
NULL
,
FALSE
);
if
(
g_str_has_prefix
(
uri
,
"mbox:///"
))
{
CamelURL
*
curl
;
curl
=
camel_url_new
(
uri
,
NULL
);
if
(
curl
)
{
if
(
curl
->
path
&&
g_file_test
(
curl
->
path
,
G_FILE_TEST_EXISTS
)
&&
!
g_file_test
(
curl
->
path
,
G_FILE_TEST_IS_DIR
))
{
camel_url_free
(
curl
);
return
TRUE
;
}
camel_url_free
(
curl
);
}
}
return
FALSE
;
}
mail/em-utils.h
View file @
eac4adfb
...
...
@@ -102,6 +102,8 @@ void emu_free_mail_cache (void);
void
emu_restore_folder_tree_state
(
EMFolderTree
*
folder_tree
);
gboolean
em_utils_is_local_delivery_mbox_file
(
const
gchar
*
uri
);
G_END_DECLS
#endif
/* __EM_UTILS_H__ */
mail/mail-ops.c
View file @
eac4adfb
...
...
@@ -241,7 +241,7 @@ fetch_mail_exec (struct _fetch_mail_msg *m,
/* FIXME: this should support keep_on_server too, which would then perform a spool
access thingy, right? problem is matching raw messages to uid's etc. */
if
(
!
strncmp
(
m
->
source_uri
,
"maildir:"
,
5
))
{
if
(
em_utils_is_local_delivery_mbox_file
(
m
->
source_uri
))
{
gchar
*
path
=
mail_tool_do_movemail
(
m
->
source_uri
,
error
);
if
(
path
&&
(
!
error
||
!*
error
))
{
...
...
mail/mail-send-recv.c
View file @
eac4adfb
...
...
@@ -39,6 +39,7 @@
#include
"e-mail-session.h"
#include
"em-event.h"
#include
"em-filter-rule.h"
#include
"em-utils.h"
#include
"mail-folder-cache.h"
#include
"mail-mt.h"
#include
"mail-ops.h"
...
...
@@ -382,9 +383,9 @@ get_receive_type (const gchar *url)
{
CamelProvider
*
provider
;
/*
HACK: since mbox is ALSO used for native evolution trees now, we need to
fudge this to treat it as a special 'movemail' source
*/
if
(
!
strncmp
(
url
,
"maildir:"
,
8
))
/*
mbox pointing to a file is a 'Local delivery' source
which requires special processing
*/
if
(
em_utils_is_local_delivery_mbox_file
(
url
))
return
SEND_RECEIVE
;
provider
=
camel_provider_get
(
url
,
NULL
);
...
...
mail/mail-tools.c
View file @
eac4adfb
...
...
@@ -94,7 +94,7 @@ mail_tool_do_movemail (const gchar *source_url, GError **error)
if
(
uri
==
NULL
)
return
NULL
;
if
(
strcmp
(
uri
->
protocol
,
"m
aildir
"
)
!=
0
)
{
if
(
strcmp
(
uri
->
protocol
,
"m
box
"
)
!=
0
)
{
/* This is really only an internal error anyway */
g_set_error
(
error
,
CAMEL_SERVICE_ERROR
,
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment