Index: src/email.c ================================================================== --- src/email.c +++ src/email.c @@ -666,10 +666,11 @@ ** This routine will add fields to the header as follows: ** ** From: ** Date: ** Message-Id: +** MIME-Version: ** Content-Type: ** Content-Transfer-Encoding: ** ** The caller maintains ownership of the input Blobs. This routine will ** read the Blobs and send them onward to the email system, but it will @@ -703,11 +704,12 @@ sqlite3_randomness(sizeof(r1), &r1); r2 = time(0); blob_appendf(pOut, "Message-Id: <%llxx%016llx.%s>\r\n", r2, r1, p->zFrom); } blob_add_final_newline(pBody); - blob_appendf(pOut,"Content-Type: text/plain\r\n"); + blob_append(pOut,"MIME-Version: 1",-1); + blob_appendf(pOut,"Content-Type: text/plain;charset=UTF-8\r\n"); #if 0 blob_appendf(pOut, "Content-Transfer-Encoding: base64\r\n\r\n"); append_base64(pOut, pBody); #else blob_appendf(pOut, "Content-Transfer-Encoding: quoted-printable\r\n\r\n"); @@ -1827,10 +1829,12 @@ EmailEvent *p; EmailEvent anchor; EmailEvent *pLast; const char *zUrl = db_get("email-url","http://localhost:8080"); const char *zFrom; + const char *zHost; + const char *zMsgId; const char *zSub; /* First do non-forum post events */ db_prepare(&q, @@ -1916,10 +1920,12 @@ " WHERE event.objid=substr(wantalert.eventId,2)+0" " AND eventId GLOB 'f*'" " AND forumpost.fpid=event.objid" ); zFrom = db_get("email-self",0); + zHost = strchr(zFrom,'@'); + zMsgId = zHost ? zHost + 1 : zFrom; zSub = db_get("email-subname",""); while( db_step(&q)==SQLITE_ROW ){ Manifest *pPost = manifest_get(db_column_int(&q,0), CFTYPE_FORUM, 0); const char *zIrt; const char *zUuid; @@ -1937,11 +1943,11 @@ if( p->needMod ){ blob_appendf(&p->hdr, "Subject: %s Pending Moderation: %s\r\n", zSub, zTitle); }else{ blob_appendf(&p->hdr, "Subject: %s %s\r\n", zSub, zTitle); - blob_appendf(&p->hdr, "Message-Id: <%s.%s>\r\n", zUuid, zFrom); + blob_appendf(&p->hdr, "Message-Id: <%s.%s>\r\n", zUuid, zMsgId); zIrt = db_column_text(&q, 4); if( zIrt && zIrt[0] ){ blob_appendf(&p->hdr, "In-Reply-To: <%s.%s>\r\n", zIrt, zFrom); } }