}
if (mode == MT_RFC822) {
- // Construct a fun message id
- cprintf("Message-ID: <%s", mid);
- if (strchr(mid, '@')==NULL) {
- cprintf("@%s", snode);
- }
- cprintf(">%s", nl);
+ // Make the message ID RFC2822 compliant
+ cprintf("Message-ID: <%s%s%s>%s", // put it in angle brackets
+ mid,
+ (strchr(mid, '@') ? "" : "@"), // if there is no domain part,
+ (strchr(mid, '@') ? "" : snode), // tack on ours.
+ nl
+ );
if (!is_room_aide() && (TheMessage->cm_anon_type == MES_ANONONLY)) {
cprintf("From: \"----\" <x@x.org>%s", nl);
}
if (error_count > 0) {
- syslog(LOG_ERR, "msgbase: encountered %d errors storing message %ld", error_count, msgid);
+ syslog(LOG_ERR, "msgbase: encountered %ld errors storing message %ld", error_count, msgid);
}
// Free the memory we used for the serialized message