From 7c7158cf2401bd8531473b47d44aebb0d283c961 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Tue, 6 Jun 2023 16:48:47 +0100 Subject: [PATCH 01/10] Terminate lines with CR+LF instead of just LF when sending an email. From https://www.rfc-editor.org/rfc/rfc5321#section-2.3.1: > Lines consist of zero or more data characters terminated by the > sequence ASCII character "CR" (hex value 0D) followed immediately by > ASCII character "LF" (hex value 0A). --- src/mail.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/mail.cpp b/src/mail.cpp index 8cdd28193..4027e44f0 100644 --- a/src/mail.cpp +++ b/src/mail.cpp @@ -35,17 +35,17 @@ void Mail::Message::Run() return; } - fprintf(pipe, "From: %s\n", send_from.c_str()); + fprintf(pipe, "From: %s\r\n", send_from.c_str()); if (this->dont_quote_addresses) - fprintf(pipe, "To: %s <%s>\n", mail_to.c_str(), addr.c_str()); + fprintf(pipe, "To: %s <%s>\r\n", mail_to.c_str(), addr.c_str()); else - fprintf(pipe, "To: \"%s\" <%s>\n", mail_to.c_str(), addr.c_str()); - fprintf(pipe, "Subject: %s\n", subject.c_str()); - fprintf(pipe, "Content-Type: text/plain; charset=UTF-8;\n"); - fprintf(pipe, "Content-Transfer-Encoding: 8bit\n"); - fprintf(pipe, "\n"); + fprintf(pipe, "To: \"%s\" <%s>\r\n", mail_to.c_str(), addr.c_str()); + fprintf(pipe, "Subject: %s\r\n", subject.c_str()); + fprintf(pipe, "Content-Type: text/plain; charset=UTF-8;\r\n"); + fprintf(pipe, "Content-Transfer-Encoding: 8bit\r\n"); + fprintf(pipe, "\r\n"); fprintf(pipe, "%s", message.c_str()); - fprintf(pipe, "\n.\n"); + fprintf(pipe, "\r\n.\r\n"); pclose(pipe); From da2ac3e8a2bfcf5da541eb07c3ca3786d1c2e8ec Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Tue, 20 Jun 2023 00:55:45 +0100 Subject: [PATCH 02/10] Fix detection of the nopartmsg module in the InspIRCd proto modules. --- modules/protocol/inspircd20.cpp | 2 +- modules/protocol/inspircd3.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/protocol/inspircd20.cpp b/modules/protocol/inspircd20.cpp index 591075e81..59fd276aa 100644 --- a/modules/protocol/inspircd20.cpp +++ b/modules/protocol/inspircd20.cpp @@ -652,7 +652,7 @@ struct IRCDMessageCapab : Message::Capab ModeManager::AddChannelMode(new InspIRCdExtban::ChannelMatcher("CHANNELBAN", "BAN", 'j')); else if (module == "m_gecosban.so") ModeManager::AddChannelMode(new InspIRCdExtban::RealnameMatcher("REALNAMEBAN", "BAN", 'r')); - else if (module == "m_nopartmessage.so") + else if (module == "m_nopartmsg.so") ModeManager::AddChannelMode(new InspIRCdExtban::EntryMatcher("PARTMESSAGEBAN", "BAN", 'p')); else if (module == "m_serverban.so") ModeManager::AddChannelMode(new InspIRCdExtban::ServerMatcher("SERVERBAN", "BAN", 's')); diff --git a/modules/protocol/inspircd3.cpp b/modules/protocol/inspircd3.cpp index c58e55519..ad29b56d9 100644 --- a/modules/protocol/inspircd3.cpp +++ b/modules/protocol/inspircd3.cpp @@ -1165,7 +1165,7 @@ struct IRCDMessageCapab : Message::Capab ModeManager::AddChannelMode(new InspIRCdExtban::ChannelMatcher("CHANNELBAN", "BAN", 'j')); else if (module == "m_gecosban.so") ModeManager::AddChannelMode(new InspIRCdExtban::RealnameMatcher("REALNAMEBAN", "BAN", 'r')); - else if (module == "m_nopartmessage.so") + else if (module == "m_nopartmsg.so") ModeManager::AddChannelMode(new InspIRCdExtban::EntryMatcher("PARTMESSAGEBAN", "BAN", 'p')); else if (module == "m_serverban.so") ModeManager::AddChannelMode(new InspIRCdExtban::ServerMatcher("SERVERBAN", "BAN", 's')); From 4e1f5cce80b11e576ded19126980097ebd8e77b0 Mon Sep 17 00:00:00 2001 From: PeGaSuS Date: Wed, 5 Jul 2023 18:09:47 +0200 Subject: [PATCH 03/10] Tell users that they must identify to their account before using CONFIRM. This only happens when a nickname is registered via webcpanel and said nickname is online. --- modules/commands/ns_register.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/commands/ns_register.cpp b/modules/commands/ns_register.cpp index cfffc1413..bd188637c 100644 --- a/modules/commands/ns_register.cpp +++ b/modules/commands/ns_register.cpp @@ -83,7 +83,7 @@ class CommandNSConfirm : public Command source.Reply(_("Invalid passcode.")); } else - source.Reply(_("Invalid passcode.")); + source.Reply(NICK_IDENTIFY_REQUIRED); return; } From 098f19c005eb468654a4b2503bf6ffed17a5cfc2 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Thu, 6 Jul 2023 10:53:25 +0100 Subject: [PATCH 04/10] Fix a crash when a module tries to get another module's config. --- src/config.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/config.cpp b/src/config.cpp index 8287ad6de..8413e59f5 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -626,6 +626,9 @@ Block *Conf::GetModule(const Anope::string &mname) } } + if (!block) + block = &Block::EmptyBlock; + return GetModule(mname); } From 14204353ac1474476c621a293e82b1f870b89661 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Sun, 9 Jul 2023 14:39:51 +0100 Subject: [PATCH 05/10] Allow customising the email content type. This will allow people to send emails using HTML or non UTF-8 text. --- data/example.conf | 8 ++++++++ include/mail.h | 1 + src/mail.cpp | 13 +++++++++++-- 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/data/example.conf b/data/example.conf index ed0c9b3bc..1ccadcd31 100644 --- a/data/example.conf +++ b/data/example.conf @@ -997,6 +997,14 @@ mail */ #dontquoteaddresses = yes + /* + * The content type to use when sending emails. + * + * This directive is optional, and is generally only needed if you want to + * use HTML or non UTF-8 text in your services emails. + */ + #content_type = "text/plain; charset=UTF-8" + /* * The subject and message of emails sent to users when they register accounts. * diff --git a/include/mail.h b/include/mail.h index f9948d84e..1e24183fe 100644 --- a/include/mail.h +++ b/include/mail.h @@ -32,6 +32,7 @@ namespace Mail Anope::string addr; Anope::string subject; Anope::string message; + Anope::string content_type; bool dont_quote_addresses; bool success; diff --git a/src/mail.cpp b/src/mail.cpp index 4027e44f0..ca6edcffa 100644 --- a/src/mail.cpp +++ b/src/mail.cpp @@ -13,7 +13,16 @@ #include "mail.h" #include "config.h" -Mail::Message::Message(const Anope::string &sf, const Anope::string &mailto, const Anope::string &a, const Anope::string &s, const Anope::string &m) : Thread(), sendmail_path(Config->GetBlock("mail")->Get("sendmailpath")), send_from(sf), mail_to(mailto), addr(a), subject(s), message(m), dont_quote_addresses(Config->GetBlock("mail")->Get("dontquoteaddresses")), success(false) +Mail::Message::Message(const Anope::string &sf, const Anope::string &mailto, const Anope::string &a, const Anope::string &s, const Anope::string &m) + : Thread() + , sendmail_path(Config->GetBlock("mail")->Get("sendmailpath")) + , send_from(sf), mail_to(mailto) + , addr(a) + , subject(s) + , message(m) + , content_type(Config->GetBlock("mail")->Get("content_type", "text/plain; charset=UTF-8")) + , dont_quote_addresses(Config->GetBlock("mail")->Get("dontquoteaddresses")) + , success(false) { } @@ -41,7 +50,7 @@ void Mail::Message::Run() else fprintf(pipe, "To: \"%s\" <%s>\r\n", mail_to.c_str(), addr.c_str()); fprintf(pipe, "Subject: %s\r\n", subject.c_str()); - fprintf(pipe, "Content-Type: text/plain; charset=UTF-8;\r\n"); + fprintf(pipe, "Content-Type: %s\r\n", content_type.c_str()); fprintf(pipe, "Content-Transfer-Encoding: 8bit\r\n"); fprintf(pipe, "\r\n"); fprintf(pipe, "%s", message.c_str()); From 37b60f8d9df9cdc3f03194b1e1fb08fb7db7c339 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Sun, 9 Jul 2023 20:06:32 +0100 Subject: [PATCH 06/10] Update links to the bugtracker. --- docs/BUGS | 2 +- docs/README | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/BUGS b/docs/BUGS index d805dd78f..38398be01 100644 --- a/docs/BUGS +++ b/docs/BUGS @@ -1 +1 @@ -For all bug reports / updates please see https://bugs.anope.org/ +For all bug reports / updates please see https://github.com/anope/anope/issues diff --git a/docs/README b/docs/README index 7012ca412..7073d8476 100644 --- a/docs/README +++ b/docs/README @@ -252,7 +252,7 @@ Table of Contents The more precise you are the sooner you'll be likely to get an answer. If you think you found a bug, add it to the bug tracking system - (https://bugs.anope.org/) and - again - be as precise as possible. Also say - whether the bug happens always or under what circumstances, and anything + (https://github.com/anope/anope/issues) and - again - be as precise as possible. + Also say whether the bug happens always or under what circumstances, and anything that could be useful to track your bug down. If you wrote a patch, send it over. :) From 68b51c7481511e7ce68e922aaae8d2875e2b4116 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Sun, 9 Jul 2023 22:29:23 +0100 Subject: [PATCH 07/10] Fix not getting memo notifications when using SASL. --- modules/pseudoclients/memoserv.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/pseudoclients/memoserv.cpp b/modules/pseudoclients/memoserv.cpp index f90c318a6..f22556a6e 100644 --- a/modules/pseudoclients/memoserv.cpp +++ b/modules/pseudoclients/memoserv.cpp @@ -207,6 +207,11 @@ class MemoServCore : public Module, public MemoServService this->Check(u); } + void OnUserConnect(User *user, bool &exempt) anope_override + { + this->Check(user); + } + EventReturn OnPreHelp(CommandSource &source, const std::vector ¶ms) anope_override { if (!params.empty() || source.c || source.service != *MemoServ) From 47bbc9b3fb0b70af33897dd31809db1f94d61680 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Sun, 9 Jul 2023 21:59:05 +0100 Subject: [PATCH 08/10] Enable CanSQLineChannel in unreal4. Ref: https://www.unrealircd.org/docs/Server_protocol:SQLINE_command --- modules/protocol/unreal4.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/protocol/unreal4.cpp b/modules/protocol/unreal4.cpp index 5c67b80a2..ef5d09d40 100644 --- a/modules/protocol/unreal4.cpp +++ b/modules/protocol/unreal4.cpp @@ -31,6 +31,7 @@ class UnrealIRCdProto : public IRCDProto CanSetVIdent = true; CanSNLine = true; CanSQLine = true; + CanSQLineChannel = true; CanSZLine = true; CanSVSHold = true; CanCertFP = true; From 34ab54522e5000a26106c946506bbccfbf584b54 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Sun, 9 Jul 2023 22:57:40 +0100 Subject: [PATCH 09/10] Fix not serialising dontkickops/dontkickvoices properly. --- modules/commands/bs_kick.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/commands/bs_kick.cpp b/modules/commands/bs_kick.cpp index 74d53c31c..eeeaf4b22 100644 --- a/modules/commands/bs_kick.cpp +++ b/modules/commands/bs_kick.cpp @@ -31,7 +31,7 @@ struct KickerDataImpl : KickerData void Check(ChannelInfo *ci) anope_override { - if (amsgs || badwords || bolds || caps || colors || flood || italics || repeat || reverses || underlines) + if (amsgs || badwords || bolds || caps || colors || flood || italics || repeat || reverses || underlines || dontkickops || dontkickvoices) return; ci->Shrink("kickerdata"); @@ -67,6 +67,8 @@ struct KickerDataImpl : KickerData data.SetType("floodlines", Serialize::Data::DT_INT); data["floodlines"] << kd->floodlines; data.SetType("floodsecs", Serialize::Data::DT_INT); data["floodsecs"] << kd->floodsecs; data.SetType("repeattimes", Serialize::Data::DT_INT); data["repeattimes"] << kd->repeattimes; + data.SetType("dontkickops", Serialize::Data::DT_INT); data["dontkickops"] << kd->dontkickops; + data.SetType("dontkickvoices", Serialize::Data::DT_INT); data["dontkickvoices"] << kd->dontkickvoices; for (int16_t i = 0; i < TTB_SIZE; ++i) data["ttb"] << kd->ttb[i] << " "; } @@ -95,6 +97,8 @@ struct KickerDataImpl : KickerData data["floodlines"] >> kd->floodlines; data["floodsecs"] >> kd->floodsecs; data["repeattimes"] >> kd->repeattimes; + data["dontkickops"] >> kd->dontkickops; + data["dontkickvoices"] >> kd->dontkickvoices; Anope::string ttb, tok; data["ttb"] >> ttb; From e717ac0a89273b7eb50001b4374f3dda2934cd3a Mon Sep 17 00:00:00 2001 From: PeGaSuS Date: Mon, 10 Jul 2023 00:44:02 +0200 Subject: [PATCH 10/10] Clarify that operserv/sqline can also match channel names. --- modules/commands/os_sxline.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/commands/os_sxline.cpp b/modules/commands/os_sxline.cpp index 78ae3d559..4918a1793 100644 --- a/modules/commands/os_sxline.cpp +++ b/modules/commands/os_sxline.cpp @@ -676,7 +676,7 @@ class CommandOSSQLine : public CommandOSSXLineBase "regular expression, the expression will be matched against\n" "channels too.")); source.Reply(_(" \n" - "\002SQLINE ADD\002 adds the given (nick's) mask to the SQLINE\n" + "\002SQLINE ADD\002 adds the given (nick/channel) mask to the SQLINE\n" "list for the given reason (which \002must\002 be given).\n" "\037expiry\037 is specified as an integer followed by one of \037d\037\n" "(days), \037h\037 (hours), or \037m\037 (minutes). Combinations (such as\n"