diff options
-rw-r--r-- | win32/sendmail.c | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/win32/sendmail.c b/win32/sendmail.c index fbc76752ba..2a32cff950 100644 --- a/win32/sendmail.c +++ b/win32/sendmail.c @@ -316,19 +316,21 @@ int PostHeader(char *RPath, char *Subject, char *mailTo, char *xheaders) zoneh /= (60 * 60); zonem = (abs(_timezone) / 60) - (zoneh * 60); - p += sprintf(p, "Date: %s, %02d %s %04d %02d:%02d:%02d %s%02d%02d\r\n", - days[tm->tm_wday], - tm->tm_mday, - months[tm->tm_mon], - tm->tm_year + 1900, - tm->tm_hour, - tm->tm_min, - tm->tm_sec, - (_timezone > 0) ? "+" : (_timezone < 0) ? "-" : "", - zoneh, - zonem); - - if(xheaders && strnicmp("From:",xheaders,5)){ + if(!xheaders || !strstr(xheaders, "Date:")){ + p += sprintf(p, "Date: %s, %02d %s %04d %02d:%02d:%02d %s%02d%02d\r\n", + days[tm->tm_wday], + tm->tm_mday, + months[tm->tm_mon], + tm->tm_year + 1900, + tm->tm_hour, + tm->tm_min, + tm->tm_sec, + (_timezone > 0) ? "+" : (_timezone < 0) ? "-" : "", + zoneh, + zonem); + } + + if(!xheaders || !strstr(xheaders, "From:")){ p += sprintf(p, "From: %s\r\n", RPath); } p += sprintf(p, "Subject: %s\r\n", Subject); |