summaryrefslogtreecommitdiff
path: root/src/checker/errors/mail/at_sign.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/checker/errors/mail/at_sign.cpp')
-rw-r--r--src/checker/errors/mail/at_sign.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/checker/errors/mail/at_sign.cpp b/src/checker/errors/mail/at_sign.cpp
new file mode 100644
index 0000000..f9dde08
--- /dev/null
+++ b/src/checker/errors/mail/at_sign.cpp
@@ -0,0 +1,18 @@
+#include <regex>
+
+#include "at_sign.hpp"
+#include "logger/logger_set.hpp"
+
+namespace smtp::checker::errors::settings
+{
+ bool AtSign::Check( std::string const& line ) const
+ {
+ std::string mask = R"([_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4}))";
+ auto result = std::regex_search( line, std::regex{mask} );
+ if(!result)
+ {
+ logger::LoggerSet::GetInstance()->LogError( GetMethodName(), "Error in mail note" );
+ }
+ return result;
+ }
+}