no From: line in the header.
+/*
+ * Tries to extract useful content from the From_ line
+ */
+char *reduce_from_(char *from_)
+{
+ static char name[HDR_LEN];
+ char *cpl, *cpr;
+
+ for (cpl=from_; *cpl && isspace(*cpl); cpl++);
+ for (cpr=cpl; *cpr && !isspace(*cpr); cpr++);
+
+ if (cpr > cpl)
+ stringcopy(name, cpl,
+ sizeof(name) < cpr-cpl+1?sizeof(name):cpr-cpl+1);
+ return name;
+}
+
int inspect_mbox(char *path, char *prefix, off_t size, int opt_flags)
{
FILE *f;
int inspect_mbox(char *path, char *prefix, off_t size, int opt_flags)
{
FILE *f;
continue;
if (strlen(buf) > 0 && buf[strlen(buf)-1] == '\n') {
buf[strlen(buf)-1] = '\0';
continue;
if (strlen(buf) > 0 && buf[strlen(buf)-1] == '\n') {
buf[strlen(buf)-1] = '\0';
+ if (strlen(buf) > 0 && buf[strlen(buf)-1] == '\r')
+ buf[strlen(buf)-1] = '\0';
} else {
while (!feof(f) && fgets(tmp, sizeof(tmp), f) != NULL) {
if (strlen(tmp) > 0 && tmp[strlen(tmp)-1] == '\n')
} else {
while (!feof(f) && fgets(tmp, sizeof(tmp), f) != NULL) {
if (strlen(tmp) > 0 && tmp[strlen(tmp)-1] == '\n')
if (strlen(from))
stringcopy(realfrom, realname(from), sizeof(realfrom));
if (strlen(from))
stringcopy(realfrom, realname(from), sizeof(realfrom));
else
stringcopy(realfrom, reduce_from_(from_), sizeof(realfrom));
else
stringcopy(realfrom, reduce_from_(from_), sizeof(realfrom));
emit(prefix, realfrom, subject, priority, opt_flags);
emit(prefix, realfrom, subject, priority, opt_flags);