From e23cf0c221eb8380f56f4f2e246db60dba29cadb Mon Sep 17 00:00:00 2001 From: genius3000 Date: Tue, 16 Aug 2016 17:12:25 -0600 Subject: Added a Date field to the Header --- src/tools/anopesmtp.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/tools/anopesmtp.cpp b/src/tools/anopesmtp.cpp index 392c6e627..b0cf0847d 100644 --- a/src/tools/anopesmtp.cpp +++ b/src/tools/anopesmtp.cpp @@ -107,6 +107,18 @@ static std::string get_logname(struct tm *tm = NULL) return name; } +/* TimeStamp for Email Header */ +static std::string GetTimeStamp() +{ + char tbuf[256]; + time_t t = time(NULL); + struct tm *tm = localtime(&t); + + strftime(tbuf, sizeof(tbuf) - 1, "%a, %d %b %Y %H:%M:%S %z", tm); + + return tbuf; +} + /* Log stuff to the log file with a datestamp. Note that errno is * preserved by this routine and log_perror(). */ @@ -417,7 +429,7 @@ int main(int argc, char *argv[]) if (argc == 1) return 0; - + if (argc == 3 && !strcmp(argv[2], "--debug")) smtp_debug = 1; @@ -468,6 +480,7 @@ int main(int argc, char *argv[]) break; else { + smail.smtp_headers.push_back("Date: " + GetTimeStamp() + "\r\n"); headers_done = true; smail.smtp_body.push_back(strip(buf) + "\r\n"); } -- cgit From d8a945b1a6f4e500bcb9162cf388f6984ad38328 Mon Sep 17 00:00:00 2001 From: Adam Date: Wed, 14 Sep 2016 17:24:06 -0400 Subject: Always use display for memo source --- modules/commands/ms_rsend.cpp | 2 +- modules/commands/ms_send.cpp | 2 +- modules/commands/ms_sendall.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/commands/ms_rsend.cpp b/modules/commands/ms_rsend.cpp index b7744131a..e703ba067 100644 --- a/modules/commands/ms_rsend.cpp +++ b/modules/commands/ms_rsend.cpp @@ -51,7 +51,7 @@ class CommandMSRSend : public Command source.Reply(ACCESS_DENIED); else { - MemoServService::MemoResult result = memoserv->Send(source.GetNick(), nick, text); + MemoServService::MemoResult result = memoserv->Send(source.GetAccount()->display, nick, text); if (result == MemoServService::MEMO_INVALID_TARGET) source.Reply(_("\002%s\002 is not a registered unforbidden nick or channel."), nick.c_str()); else if (result == MemoServService::MEMO_TOO_FAST) diff --git a/modules/commands/ms_send.cpp b/modules/commands/ms_send.cpp index b028706d3..73ffd4c41 100644 --- a/modules/commands/ms_send.cpp +++ b/modules/commands/ms_send.cpp @@ -45,7 +45,7 @@ class CommandMSSend : public Command return; } - MemoServService::MemoResult result = memoserv->Send(source.GetNick(), nick, text); + MemoServService::MemoResult result = memoserv->Send(source.GetAccount()->display, nick, text); if (result == MemoServService::MEMO_SUCCESS) { source.Reply(_("Memo sent to \002%s\002."), nick.c_str()); diff --git a/modules/commands/ms_sendall.cpp b/modules/commands/ms_sendall.cpp index 4cc0f350c..8f0514d6f 100644 --- a/modules/commands/ms_sendall.cpp +++ b/modules/commands/ms_sendall.cpp @@ -39,7 +39,7 @@ class CommandMSSendAll : public Command const NickCore *nc = it->second; if (nc != source.nc) - memoserv->Send(source.GetNick(), nc->display, text); + memoserv->Send(source.GetAccount()->display, nc->display, text); } source.Reply(_("A massmemo has been sent to all registered users.")); -- cgit