+ if (!reason.empty())
+ {
+ this->SendError("CAPAB negotiation failed: " + reason);
+ return false;
+ }
+
+ if (this->capab->CapKeys.find("CASEMAPPING") != this->capab->CapKeys.end())
+ {
+ const std::string casemapping = this->capab->CapKeys.find("CASEMAPPING")->second;
+ if (casemapping != ServerInstance->Config->CaseMapping)
+ {
+ reason = "The casemapping of the remote server differs to that of the local server."
+ " Local casemapping: " + ServerInstance->Config->CaseMapping +
+ " Remote casemapping: " + casemapping;
+ this->SendError("CAPAB negotiation failed: " + reason);
+ return false;
+ }
+ }
+