diff options
-rw-r--r-- | docs/TOOLS | 5 | ||||
-rw-r--r-- | src/tools/anopesmtp.cpp | 7 |
2 files changed, 6 insertions, 6 deletions
diff --git a/docs/TOOLS b/docs/TOOLS index d33d142de..c8e92fc70 100644 --- a/docs/TOOLS +++ b/docs/TOOLS @@ -16,9 +16,8 @@ Anope Bundled Tools sendmailpath = "/home/anope/services/bin/anopesmtp 127.0.0.1" If the SMTP client doesn't send mail, or if there's an other problem with - it, you can compile it in debug mode. To do this, open anopesmtp.cpp, and look - for "smtp_debug" near the top. Change this from 0 to 1 and recompile - the code. This should generate a log file of what happened when it tried + it, you can enable debug mode by passing the --debug flag after the server + address. This should generate a log file of what happened when it tried to connect to the SMTP server. Credits: diff --git a/src/tools/anopesmtp.cpp b/src/tools/anopesmtp.cpp index 2948e4d93..1f2c0febb 100644 --- a/src/tools/anopesmtp.cpp +++ b/src/tools/anopesmtp.cpp @@ -90,8 +90,6 @@ struct smtp_message ano_socket_t sock; }; - -/* set this to 1 if you want to get a log otherwise it runs silent */ int smtp_debug = 0; struct smtp_message smail; @@ -107,7 +105,7 @@ static std::string get_logname(struct tm *tm = NULL) } strftime(timestamp, sizeof(timestamp), "%Y%m%d", tm); - std::string name = std::string("logs/anopesmtp.") + timestamp; + std::string name = std::string("anopesmtp.") + timestamp; return name; } @@ -445,6 +443,9 @@ int main(int argc, char *argv[]) if (argc == 1) return 0; + + if (argc == 3 && !strcmp(argv[2], "--debug")) + smtp_debug = 1; char *server = strtok(argv[1], ":"), *aport; short port; |