if (Msg->AllAttach == NULL)
Msg->AllAttach = NewHash(1,NULL);
Put(Msg->AllAttach, SKEY(Msg->MsgBody->PartNum), Msg->MsgBody, DestroyMime);
-
/* strip the bare contenttype, so we ommit charset etc. */
StrBufExtract_token(Buf, Msg->MsgBody->ContentType, 0, ';');
if (Msg->AttachLinks == NULL)
Msg->AttachLinks = NewHash(1,NULL);
Put(Msg->AttachLinks, SKEY(Mime->PartNum), Mime, reference_free_handler);
- if (strcasecmp(ChrPtr(Mime->ContentType), "application/octet-stream") == 0) {
+ if ((strcasecmp(ChrPtr(Mime->ContentType), "application/octet-stream") == 0) &&
+ (StrLength(Mime->FileName) > 0)) {
FlushStrBuf(Mime->ContentType);
StrBufAppendBufPlain(Mime->ContentType,
GuessMimeByFilename(SKEY(Mime->FileName)),
StrBuf *cs = NULL;
const char *ptr, *pte;
const char *BufPtr = NULL;
- StrBuf *Line = NewStrBuf();
- StrBuf *Line1 = NewStrBuf();
- StrBuf *Line2 = NewStrBuf();
- StrBuf *Target = NewStrBufPlain(NULL, StrLength(Mime->Data));
- int ConvertIt = 1;
+ StrBuf *Line;
+ StrBuf *Line1;
+ StrBuf *Line2;
+ StrBuf *Target;
+
+ int ConvertIt = 0;
int bn = 0;
int bq = 0;
int i, n, done = 0;
}
}
#endif
+ Line = NewStrBuf();
+ Line1 = NewStrBuf();
+ Line2 = NewStrBuf();
+ Target = NewStrBufPlain(NULL, StrLength(Mime->Data));
while ((n = StrBufSipLine(Line, Mime->Data, &BufPtr), n >= 0) && !done)
{
StrBuf *tmp;
tmp = NewStrBufPlain(WC->wc_roomname, -1);;
StrBufAppendTemplate(Target, nArgs, Tokens, Context, ContextType, tmp, 0);
+ FreeStrBuf(&tmp);
}
void _gotonext(void) { slrp_highest(); gotonext(); }
{
case 'H':
WCC = WC;
- Buf = NewStrBufPlain(NULL, StrLength(Buf));
+ Buf = NewStrBufPlain(NULL, StrLength(Source));
StrBuf_RFC822_to_Utf8(Buf,
Source,
(WCC!=NULL)? WCC->DefaultCharset : NULL,