Index: camel/providers/local/camel-spool-summary.c
===================================================================
--- camel/providers/local/camel-spool-summary.c	(revision 8617)
+++ camel/providers/local/camel-spool-summary.c	(working copy)
@@ -139,7 +139,7 @@ spool_summary_sync_full(CamelMboxSummary
 
 	camel_operation_start(NULL, _("Storing folder"));
 
-	fd = open(((CamelLocalSummary *)cls)->folder_path, O_RDWR);
+	fd = open(((CamelLocalSummary *)cls)->folder_path, O_RDWR|O_LARGEFILE);
 	if (fd == -1) {
 		camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
 				      _("Could not open file: %s: %s"),
Index: camel/providers/local/camel-mh-summary.c
===================================================================
--- camel/providers/local/camel-mh-summary.c	(revision 8617)
+++ camel/providers/local/camel-mh-summary.c	(working copy)
@@ -152,7 +152,7 @@ static char *mh_summary_next_uid_string(
 			uid = camel_folder_summary_next_uid(s);
 			name = g_strdup_printf("%s/%u", cls->folder_path, uid);
 			/* O_EXCL isn't guaranteed, sigh.  Oh well, bad luck, mh has problems anyway */
-			fd = open(name, O_WRONLY|O_CREAT|O_EXCL, 0600);
+			fd = open(name, O_WRONLY|O_CREAT|O_EXCL|O_LARGEFILE, 0600);
 			g_free(name);
 		} while (fd == -1 && errno == EEXIST);
 
@@ -174,7 +174,7 @@ static int camel_mh_summary_add(CamelLoc
 
 	d(printf("summarising: %s\n", name));
 
-	fd = open(filename, O_RDONLY);
+	fd = open(filename, O_RDONLY|O_LARGEFILE);
 	if (fd == -1) {
 		g_warning ("Cannot summarise/index: %s: %s", filename, strerror (errno));
 		g_free(filename);
Index: camel/providers/local/camel-maildir-summary.c
===================================================================
--- camel/providers/local/camel-maildir-summary.c	(revision 8617)
+++ camel/providers/local/camel-maildir-summary.c	(working copy)
@@ -478,7 +478,7 @@ camel_maildir_summary_add (CamelLocalSum
 
 	d(printf("summarising: %s\n", name));
 
-	fd = open(filename, O_RDONLY);
+	fd = open(filename, O_RDONLY|O_LARGEFILE);
 	if (fd == -1) {
 		g_warning ("Cannot summarise/index: %s: %s", filename, strerror (errno));
 		g_free(filename);
Index: camel/providers/local/camel-mbox-folder.c
===================================================================
--- camel/providers/local/camel-mbox-folder.c	(revision 8617)
+++ camel/providers/local/camel-mbox-folder.c	(working copy)
@@ -150,7 +150,7 @@ static int mbox_lock(CamelLocalFolder *l
 	/* make sure we have matching unlocks for locks, camel-local-folder class should enforce this */
 	g_assert(mf->lockfd == -1);
 
-	mf->lockfd = open(lf->folder_path, O_RDWR, 0);
+	mf->lockfd = open(lf->folder_path, O_RDWR|O_LARGEFILE, 0);
 	if (mf->lockfd == -1) {
 		camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
 				      _("Cannot create folder lock on %s: %s"),
Index: camel/providers/local/ChangeLog
===================================================================
--- camel/providers/local/ChangeLog	(revision 8617)
+++ camel/providers/local/ChangeLog	(working copy)
@@ -1,3 +1,14 @@
+2008-04-04  Milan Crha  <mcrha@redhat.com>
+
+	** Fix for bug #522433
+
+	* camel-spool-summary.c: (spool_summary_sync_full):
+	* camel-mh-summary.c: (mh_summary_next_uid_string),
+	(camel_mh_summary_add):
+	* camel-maildir-summary.c: (camel_maildir_summary_add):
+	* camel-mbox-folder.c: (mbox_lock):
+	* camel-spool-folder.c: (spool_lock): Open files with O_LARGEFILE flag.
+
 2008-01-22  Srinivasa Ragavan  <sragavan@novell.com>
 
 	** Fix for bug #450840
Index: camel/providers/local/camel-spool-folder.c
===================================================================
--- camel/providers/local/camel-spool-folder.c	(revision 8617)
+++ camel/providers/local/camel-spool-folder.c	(working copy)
@@ -144,7 +144,7 @@ spool_lock(CamelLocalFolder *lf, CamelLo
 	CamelMboxFolder *mf = (CamelMboxFolder *)lf;
 	CamelSpoolFolder *sf = (CamelSpoolFolder *)lf;
 
-	mf->lockfd = open(lf->folder_path, O_RDWR, 0);
+	mf->lockfd = open(lf->folder_path, O_RDWR|O_LARGEFILE, 0);
 	if (mf->lockfd == -1) {
 		camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
 				      _("Cannot create folder lock on %s: %s"),
