- /* Always make sure there's something in the msg text field */
- if (ret->cm_fields['M'] == NULL)
- ret->cm_fields['M'] = strdup("<no text>\n");
+ /* Always make sure there's something in the msg text field. If
+ * it's NULL, the message text is most likely stored separately,
+ * so go ahead and fetch that. Failing that, just set a dummy
+ * body so other code doesn't barf.
+ */
+ if (ret->cm_fields['M'] == NULL) {
+
+ dbigmsg = cdb_fetch(CDB_BIGMSGS, &msgnum, sizeof(long));
+ if (dmsgtext == NULL) {
+ ret->cm_fields['M'] = strdup("<no text>\n");
+ }
+ else {
+ ret->cm_fields['M'] = strdup(dbigmsg->ptr);
+ cdb_free(dbigmsg);
+ }
+ }