summaryrefslogtreecommitdiff
path: root/src/checker/errors/mail/at_sign.cpp
blob: f9dde0893fce6bd7a111f777a7f32bd0778e8edc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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;
    }
}