Fix up mail delivery wot I broked.

This commit is contained in:
alexhudson
2007-12-23 20:24:55 +00:00
parent 3be719beaf
commit 999f87a9bd
2 changed files with 6 additions and 4 deletions
+2 -2
View File
@@ -109,9 +109,9 @@ MaildirTempDocument(StoreClient *client, uint64_t collection, char *dest, size_t
int
MaildirDeliverTempDocument(StoreClient *client, uint64_t collection, const char *path, uint64_t uid)
{
char newpath[XPL_MAX_PATH];
char newpath[XPL_MAX_PATH+1];
snprintf(newpath, XPL_MAX_PATH, "%s" GUID_FMT "/cur/" GUID_FMT, client->store, collection, uid);
FindPathToDocument(client, collection, uid, &newpath, XPL_MAX_PATH);
if (link(path, newpath) != 0) {
// look at errno. EEXIST suggests we already delivered it; maybe ignore that?
+4 -2
View File
@@ -664,7 +664,6 @@ ImportIncomingMail(StoreClient *client)
int dcode = 0;
DStoreDocInfo collinfo;
NLockStruct *collLock;
char path[XPL_MAX_PATH+1];
char tmppath[XPL_MAX_PATH+1];
FILE *destfile = NULL;
char buffer[CONN_BUFSIZE];
@@ -736,8 +735,11 @@ ImportIncomingMail(StoreClient *client)
if (MaildirDeliverTempDocument(client, info.collection, tmppath, info.guid) != 0)
goto finish;
// Mail is no longer in the temporary file
FindPathToDocument(client, info.collection, info.guid, tmppath, sizeof(tmppath));
if (StoreProcessDocument(client, &info, &collinfo, path, index, 0)) {
if (StoreProcessDocument(client, &info, &collinfo, tmppath, index, 0)) {
/* we were unable to process this message for some reason, so
let's save it to the side and skip over it */