Added "junk" response to filter protocol

master
Thor 4 years ago
parent 0f75541caa
commit 106aa91366
  1. 3
      include/protocol/protocol.hpp
  2. 11
      src/protocol/protocol.cpp

@ -35,10 +35,11 @@ namespace protocol {
void absorb(const std::string& input);
void send(const token::list_t& tokens);
// TODO: Move these methods to a separate session_t class!
void send_result(const session_key_t& session_key, token::list_t tokens);
void proceed(const session_key_t& session_key);
void junk(const session_key_t& session_key);
void fail(const session_key_t& session_key);
void submit_message(const session_key_t& session_key, const std::vector<std::string>& header, const std::vector<std::string>& body);
protected:

@ -8,9 +8,8 @@
using namespace std;
using namespace util;
//config|smtpd-version|6.6.1
//config|smtp-session-timeout|300
//config|subsystem|smtp-in
// OpenSMTPD filter protocol documentation:
// https://man7.org/linux/man-pages/man7/smtpd-filters.7.html
const bool debug = true;
@ -24,10 +23,10 @@ namespace protocol {
}
}
}
max_pattern_length = length;
debug && cerr << "Maximum handler pattern length is " << length << endl;
this->handlers = handlers;
max_pattern_length = length;
}
void protocol_t::send(const token::list_t& tokens) {
@ -59,6 +58,10 @@ namespace protocol {
send_result(session_key, {"proceed"});
}
void protocol_t::junk(const session_key_t& session_key) {
send_result(session_key, {"junk"});
}
void protocol_t::fail(const session_key_t& session_key) {
send_result(session_key, {"disconnect", "451 Aborted"});
}

Loading…
Cancel
Save