Skip to content

Commit

Permalink
[Fix: corecode#75] Cron mail is rejected due to missing domain.
Browse files Browse the repository at this point in the history
Drop the anyway malformed "From: root (Cron Daemon)"
That cron daemon place by default at head of its messages.

Just like mistakenly inserted RFC-976 "From_" or ">From_" are already
dropped.

When not removed, lot of modern mail delivery service will reject or
silently drop the message.

Only some very new version of cron can change this behavior and it is
not the default.
On old version there is nothing you can do.

When removed the expediter is available anyway by the mail envelop.
Then no meaningful information is lost.
  • Loading branch information
HenriGEIST committed Sep 6, 2024
1 parent 55d22c2 commit 2e96816
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion mail.c
Original file line number Diff line number Diff line change
Expand Up @@ -396,8 +396,11 @@ readmail(struct queue *queue, int nodot, int recp_from_header)
/*
* Ignore a leading RFC-976 From_ or >From_ line mistakenly
* inserted by some programs.
* And also malformed cron "From: root (Cron Daemon)".
*/
if (strprefixcmp(line, "From ") == 0 || strprefixcmp(line, ">From ") == 0)
if (strprefixcmp(line, "From ") == 0 ||
strprefixcmp(line, ">From ") == 0 ||
strprefixcmp(line, "From: root (Cron Daemon)") == 0)
continue;
had_first_line = 1;
}
Expand Down

0 comments on commit 2e96816

Please sign in to comment.