- /* Axe the namespace, we don't care about it */
- safestrncpy(el, supplied_el, sizeof el);
- while (sep = strchr(el, ':'), sep) {
- strcpy(el, ++sep);
- }
+ if (SaveMsg->author_or_creator != NULL) {
+
+ char *From;
+ StrBuf *Encoded = NULL;
+ int FromAt;
+
+ From = html_to_ascii(ChrPtr(SaveMsg->author_or_creator),
+ StrLength(SaveMsg->author_or_creator),
+ 512, 0);
+ StrBufPlain(SaveMsg->author_or_creator, From, -1);
+ StrBufTrim(SaveMsg->author_or_creator);
+ free(From);
+
+ FromAt = strchr(ChrPtr(SaveMsg->author_or_creator), '@') != NULL;
+ if (!FromAt && StrLength (SaveMsg->author_email) > 0)
+ {
+ StrBufRFC2047encode(&Encoded, SaveMsg->author_or_creator);
+ SaveMsg->Msg.cm_fields['A'] = SmashStrBuf(&Encoded);
+ SaveMsg->Msg.cm_fields['P'] =
+ SmashStrBuf(&SaveMsg->author_email);
+ }
+ else
+ {
+ if (FromAt)
+ {
+ SaveMsg->Msg.cm_fields['A'] =
+ SmashStrBuf(&SaveMsg->author_or_creator);
+ SaveMsg->Msg.cm_fields['P'] =
+ strdup(SaveMsg->Msg.cm_fields['A']);
+ }
+ else
+ {
+ StrBufRFC2047encode(&Encoded,
+ SaveMsg->author_or_creator);
+ SaveMsg->Msg.cm_fields['A'] =
+ SmashStrBuf(&Encoded);
+ SaveMsg->Msg.cm_fields['P'] =
+ strdup("rss@localhost");