diff --git a/#main.cpp# b/#main.cpp# new file mode 100644 index 0000000..8a0eaa4 --- /dev/null +++ b/#main.cpp# @@ -0,0 +1,63 @@ + +#include +#include "EPoll.h" +#include "ConsoleServer.h" +#include "Exception.h" +#include "File.h" +#include "Log.h" +#include "IPAddress.h" +#include "MailFileSystem.h" +#include "SMTPServer.h" +#include "POP3Server.h" +#include "IMAPServer.h" +#include "SendMail2.h" + +#define BUFFER_SIZE 1000000 + +int main(int argc, char **argv) { + coreutils::Log(new coreutils::File("/var/log/barantmail.log", O_WRONLY | O_APPEND | O_CREAT, 0644)); + coreutils::Log(coreutils::LOG_INFO) << "BMAMAIL called with link " << argv[0]; + if(strcmp(argv[0], "./sendmail2") == 0) { + try { + coreutils::Log(coreutils::LOG_INFO) << "Starting Mail Injector. Build " << __DATE__ << " " << __TIME__; + char buffer[BUFFER_SIZE]; + int len = read(0, buffer, BUFFER_SIZE); + core::EPoll ePoll; + mail::SendMail2(ePoll, argv[1], argv[2]); + } + catch(coreutils::Exception exception) { + std::cout << exception.text << " Error reason is '" << strerror(exception.errorNumber) << "' in file " << exception.file << " at line " << exception.line << std::endl; + } + } else { + + try { + + coreutils::Log(coreutils::LOG_INFO) << "BMAMail Server starting. Build " << __DATE__ << " " << __TIME__; + + std::string hostName = "localhost"; + std::string ipAddress = "0.0.0.0"; + coreutils::ZString mailPath("/var/mail"); + + mail::MailFileSystem mailFileSystem(mailPath); + + core::EPoll ePoll; + ePoll.start(1, 1000); + mail::SMTPServer smtpServer(ePoll, hostName, mailFileSystem, core::IPAddress(ipAddress, 9025)); +// mail::POP3Server pop3Server(ePoll, hostName, mailFileSystem, core::IPAddress(ipAddress, 110)); +// mail::IMAPServer imapServer(ePoll, hostName, mailFileSystem, core::IPAddress(ipAddress, 143)); + core::ConsoleServer consoleServer(ePoll, core::IPAddress(ipAddress, 1027)); + consoleServer.commands.add(consoleServer.commands, "help"); + consoleServer.commands.add(smtpServer.commands, "smtp"); + + while(true) + sleep(3600); + + ePoll.stop(); + + } + + catch(coreutils::Exception exception) { + std::cout << exception.text << " Error reason is '" << strerror(exception.errorNumber) << "' in file " << exception.file << " at line " << exception.line << std::endl; + } + } +} diff --git a/BMAMail b/BMAMail index be326c3..d108037 100755 Binary files a/BMAMail and b/BMAMail differ diff --git a/SendMail.cpp b/SendMail.cpp index cf244ed..50b5a93 100644 --- a/SendMail.cpp +++ b/SendMail.cpp @@ -6,24 +6,24 @@ #include namespace mail { - + SendMail::SendMail(core::EPoll &ePoll, std::string from, std::string recipient, std::string mailFileName) - : core::TCPSession2(ePoll, "Send Mail Agent"), from(from), recipient(recipient), mailFileName(mailFileName), + : core::TCPSession2(ePoll, "Send Mail Agent"), from(from), recipient(recipient), mailFileName(mailFileName), mailData(mailFileName), Timer(ePoll, 0.00f), ePoll(ePoll) { - + coreutils::Log(coreutils::LOG_DEBUG_1) << this->recipient; this->recipient.split("@"); coreutils::Log(coreutils::LOG_DEBUG_1) << this->recipient[1]; - + u_char nsbuff[4096]; char *domain = this->recipient[1].c_str(); int len = res_query(domain, ns_c_any, ns_t_mx, nsbuff, sizeof(nsbuff)); coreutils::Log(coreutils::LOG_DEBUG_1) << ">" << len; ns_msg msg; - + ns_initparse(nsbuff, len, &msg); len = ns_msg_count(msg, ns_s_an); - + char dispbuf[4096]; ns_rr rr; for (int i = 0; i < 1; i++) { @@ -31,102 +31,100 @@ namespace mail { ns_sprintrr(&msg, &rr, NULL, NULL, dispbuf, sizeof(dispbuf)); printf ("%s\n", dispbuf); } - - coreutils::ZString mxArray(dispbuf); - mxArray.split("\t"); - mxArray[3].split(" "); - coreutils::Log(coreutils::LOG_DEBUG_1) << "MX: " << mxArray[3][1]; - + + coreutils::ZString mxArray(dispbuf); + mxArray.split("\t"); + mxArray[3].split(" "); + coreutils::Log(coreutils::LOG_DEBUG_1) << "MX: " << mxArray[3][1]; + core::IPAddress mxAddress(mxArray[3][1].c_str(), 25); connect(mxAddress); - ePoll.registerSocket((TCPSession2 *)(this)); - + coreutils::Log(coreutils::LOG_DEBUG_1) << "SendMail initiated..."; - - } - + + } + SendMail::SendMail(const SendMail ©) : core::TCPSession2(ePoll, "Send Mail Agent"), from(copy.from), recipient(copy.recipient), mailFileName(copy.mailFileName), mailData(mailFileName), Timer(ePoll, 0.00f), ePoll(copy.ePoll) {} - + SendMail::~SendMail() { - ePoll.unregisterSocket((TCPSession2 *)(this)); coreutils::Log(coreutils::LOG_DEBUG_1) << "SendMail destructing..."; } - + void SendMail::onTimeout() { state = stateOnTimeout; coreutils::Log(coreutils::LOG_DEBUG_1) << "onTimeout..."; protocol(buffer); TCPSession2::send(); } - + void SendMail::protocol(coreutils::ZString &data) { - + coreutils::Log(coreutils::LOG_DEBUG_1) << "[" << data << "..." << state; - + switch (state) { - - case CONNECT: - // read recipient - // parse email for name and domain name - // open tcpsocket with connect - // wait for greeting - if(data.asInteger() == 220) { - out << "EHLO " << "mail.barant.com" << CRLF; - state = READY; - } - break; - - case READY: - buffer = data; - setTimer(.05); - stateOnTimeout = READYX; - break; - - case READYX: - if(buffer.asInteger() == 250) { - out << "MAIL FROM:<" << from << ">" << CRLF; - state = MAIL; - } - break; - - case MAIL: - if(data.asInteger() == 250) { - out << "RCPT TO:<" << recipient << ">" << CRLF; - state = RCPT; - } - break; - - case RCPT: - if(data.asInteger() == 250) { - out << "DATA" << CRLF; - state = DATA; - } - break; - - case DATA: - if(data.asInteger() == 354) { - while(!mailData.eof()) { - mailData.readLine(); - out << mailData.asZString() << CRLF; - } - out << "." << CRLF; - state = SENT; - } - break; - - case SENT: - if(data.asInteger() == 250) { - out << "QUIT" << CRLF; - } - break; - + + case CONNECT: + // read recipient + // parse email for name and domain name + // open tcpsocket with connect + // wait for greeting + if(data.asInteger() == 220) { + out << "EHLO " << "mail.barant.com" << CRLF; + state = READY; + } + break; + + case READY: + buffer = data; + setTimer(.05); + stateOnTimeout = READYX; + break; + + case READYX: + if(buffer.asInteger() == 250) { + out << "MAIL FROM:<" << from << ">" << CRLF; + state = MAIL; + } + break; + + case MAIL: + if(data.asInteger() == 250) { + out << "RCPT TO:<" << recipient << ">" << CRLF; + state = RCPT; + } + break; + + case RCPT: + if(data.asInteger() == 250) { + out << "DATA" << CRLF; + state = DATA; + } + break; + + case DATA: + if(data.asInteger() == 354) { + while(!mailData.eof()) { + mailData.readLine(); + out << mailData.asZString() << CRLF; + } + out << "." << CRLF; + state = SENT; + } + break; + + case SENT: + if(data.asInteger() == 250) { + out << "QUIT" << CRLF; + } + break; + } - + } - + std::vector& SendMail::extractRecipientList() { return recipientList; } - + } diff --git a/SendMail.h b/SendMail.h index 1a3a4f7..e28803d 100644 --- a/SendMail.h +++ b/SendMail.h @@ -7,7 +7,11 @@ #include "Timer.h" #define CRLF "\r\n" +#define CRLF "\r\n" +#ifndef ___state_defined___ +#define ___state_defined___ typedef enum {CONNECT, READY, READYX, MAIL, RCPT, DATA, SENT} State; +#endif namespace mail { diff --git a/SendMail2.cpp b/SendMail2.cpp new file mode 100644 index 0000000..6409e85 --- /dev/null +++ b/SendMail2.cpp @@ -0,0 +1,184 @@ +#include "SendMail2.h" +#include "ZString.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "Log.h" + +#define BUFFER_SIZE 1048576 + +namespace mail { + + SendMail2::SendMail2(core::EPoll &ePoll, coreutils::MString from, coreutils::MString recipient, coreutils::MString message) + : core::TCPSession2(ePoll, "Send Mail Injector"), from(from), recipient(recipient), + Timer(ePoll, 30.00f), ePoll(ePoll), message(message) { + coreutils::Log(coreutils::LOG_DEBUG_1) << "SendMail2 constructed."; + } + + int SendMail2::send() { + + waiter.lock(); + coreutils::Log(coreutils::LOG_DEBUG_1) << this->recipient; + this->recipient.split("@"); + coreutils::Log(coreutils::LOG_DEBUG_1) << this->recipient[1]; + + u_char nsbuff[4096]; + char *domain = this->recipient[1].c_str(); + int len = res_search(domain, C_IN, T_MX, nsbuff, sizeof(nsbuff)); + ns_msg msg; + + ns_initparse(nsbuff, len, &msg); + len = ns_msg_count(msg, ns_s_an); + + char dispbuf[4096]; + ns_rr rr; + for (int i = 0; i < 1; i++) { + ns_parserr(&msg, ns_s_an, i, &rr); + ns_sprintrr(&msg, &rr, NULL, NULL, dispbuf, sizeof(dispbuf)); + } + coreutils::Log(coreutils::LOG_DEBUG_1) << "dispbuf: " << dispbuf; + + coreutils::ZString mxArray(dispbuf); + mxArray.find("MX"); + mxArray.ifNext("MX"); + mxArray.skipWhitespace(); + mxArray.getTokenInclude("0123456789"); + mxArray.skipWhitespace(); + coreutils::Log(coreutils::LOG_DEBUG_1) << "MX: " << mxArray.unparsed(); + core::IPAddress mxAddress(mxArray.unparsed().c_str(), 25); + coreutils::Log(coreutils::LOG_DEBUG_1) << "IP: " << mxAddress.getClientAddressAndPort(); + connect(mxAddress); + + coreutils::Log(coreutils::LOG_DEBUG_1) << "SendMail2 injector initiated..."; + return 0; + } + + SendMail2::SendMail2(const SendMail2 ©) : core::TCPSession2(ePoll, "Send Mail Injector"), from(copy.from), recipient(copy.recipient), + Timer(ePoll, 30.00f), ePoll(copy.ePoll), message(copy.message) {} + + SendMail2::~SendMail2() { + coreutils::Log(coreutils::LOG_DEBUG_1) << "SendMail destructing..."; + } + + void SendMail2::onTimeout() { + coreutils::Log(coreutils::LOG_DEBUG_1) << "onTimeout..." << state; + returnValue << "timeout in " << state; + state = SENT; + waiter.unlock(); + } + + void SendMail2::protocol(coreutils::ZString &data) { + + coreutils::Log(coreutils::LOG_DEBUG_1) << "[" << data << "..." << state; + + switch (state) { + + case CONNECT: + if(data.asInteger() == 220) { + out << "EHLO " << "drinkwise.barant.com" << CRLF; + coreutils::Log(coreutils::LOG_DEBUG_1) << ">EHLO"; + state = READY; + } + break; + + case READY: + buffer = data; + setTimer(30); + stateOnTimeout = READYX; + state = READYX; + break; + + case READYX: + if(buffer.asInteger() == 250) { + coreutils::Log(coreutils::LOG_DEBUG_1) << ">MAIL FROM:<" << from << ">"; + out << "MAIL FROM:<" << from << ">" << CRLF; + state = MAIL; + } + break; + + case MAIL: + if(data.asInteger() == 250) { + coreutils::Log(coreutils::LOG_DEBUG_1) << ">RCPT TO:<" << recipient << ">"; + out << "RCPT TO:<" << recipient << ">" << CRLF; + state = RCPT; + } + break; + + case RCPT: + if(data.asInteger() == 250) { + out << "DATA" << CRLF; + state = DATA; + } + break; + + case DATA: + if(data.asInteger() == 354) { + out << message << CRLF; + out << "." << CRLF; + state = SENT; + } else if (data.asInteger() == 421) { + coreutils::Log(coreutils::LOG_DEBUG_1) << "Error 421"; + data.split(" ", 2); + returnValue = data; + state = SENT; + waiter.unlock(); + } else if (data.asInteger() == 450) { + coreutils::Log(coreutils::LOG_DEBUG_1) << "Error 450"; + data.split(" ", 2); + returnValue = data; + state = SENT; + waiter.unlock(); + } else if (data.asInteger() == 451) { + coreutils::Log(coreutils::LOG_DEBUG_1) << "Error 451"; + data.split(" ", 2); + returnValue = data; + state = SENT; + waiter.unlock(); + } else if (data.asInteger() == 452) { + coreutils::Log(coreutils::LOG_DEBUG_1) << "Error 452"; + data.split(" ", 2); + returnValue = data; + state = SENT; + waiter.unlock(); + } else if (data.asInteger() == 550) { + data.split(" ", 2); + returnValue = data; + state = SENT; + waiter.unlock(); + } else if (data.asInteger() == 552) { + coreutils::Log(coreutils::LOG_DEBUG_1) << "Error 552"; + data.split(" ", 2); + returnValue = data; + state = SENT; + waiter.unlock(); + } + break; + + case SENT: + returnValue = data; + out << "QUIT" << CRLF; + waiter.unlock(); + break; + + } + + } + + coreutils::MString SendMail2::wait() { + waiter.lock(); + waiter.unlock(); + return returnValue; + } + + + std::vector& SendMail2::extractRecipientList() { + return recipientList; + } + +} diff --git a/SendMail2.h b/SendMail2.h new file mode 100644 index 0000000..b86b0ba --- /dev/null +++ b/SendMail2.h @@ -0,0 +1,51 @@ +#ifndef __SendMail2_h__ +#define __SendMail2_h__ + +#include "EPoll.h" +#include "TCPSession2.h" +#include "MString.h" +#include "Timer.h" +#include + +#define CRLF "\r\n" +#ifndef ___state_defined___ +#define ___state_defined___ +typedef enum {CONNECT, READY, READYX, MAIL, RCPT, DATA, SENT} State; +#endif + +namespace mail { + + class SendMail2 : public core::TCPSession2, private core::Timer { + + public: + SendMail2(core::EPoll &ePoll, coreutils::MString from, coreutils::MString recipient, coreutils::MString message); + SendMail2(const SendMail2 ©); + ~SendMail2(); + + void protocol(coreutils::ZString &data) override; + + int send(); + coreutils::MString wait(); + coreutils::MString returnValue; + + private: + std::vector& extractRecipientList(); + void onTimeout() override; + + core::EPoll &ePoll; + + coreutils::MString from; + coreutils::MString recipient; + coreutils::MString buffer; + coreutils::MString message; + std::vector recipientList; + + State state = CONNECT; + State stateOnTimeout = CONNECT; + + std::mutex waiter; + }; + +} + +#endif diff --git a/__SMTP_AUTH.cpp b/__SMTP_AUTH.cpp index 4e2b590..75b58f1 100644 --- a/__SMTP_AUTH.cpp +++ b/__SMTP_AUTH.cpp @@ -3,11 +3,11 @@ #include "SMTPServer.h" namespace mail { - + int __SMTP_AUTH::processCommand(coreutils::ZString &request, SMTPSession &session, SMTPServer &server) { - + switch(session.authState) { - + case USER_UNKNOWN: if(request[1].equals("LOGIN")) { session.out << "334 VXNlcm5hbWU6" << CRLF; @@ -19,7 +19,7 @@ namespace mail { session.out << "504 AUTH method not supported." << CRLF; } return 1; - + case USER_QUERY: session.userName = request[0]; // setTimer(0.0f); @@ -27,7 +27,7 @@ namespace mail { // setTimer(10.0f); session.authState = USER_SECRET_QUERY; return 1; - + case USER_SECRET_QUERY: session.password = request[0]; // setTimer(0.0f); @@ -45,13 +45,13 @@ namespace mail { } return 0; } - + bool __SMTP_AUTH::authLogin(coreutils::ZString &userName, coreutils::ZString &password, SMTPServer &server) { coreutils::MString secretPath; secretPath << server.mailFileSystem.getMailBoxPath(userName) << "/.password"; coreutils::File secret(secretPath); secret.read(); - return password == secret.asString(); + return password == secret.asZString(); } - + } diff --git a/compile b/compile index ffb2ef0..922ecca 100755 --- a/compile +++ b/compile @@ -1,23 +1,23 @@ #!/bin/bash for file in *.cpp -do - filename="${file%.*}" - list="$list $filename.o" - echo -n "Compiling $filename..." - g++ -g -c -std=c++17 -I../CoreUtils -I../ServerCore $file - if [ $? = '0' ] - then - echo "OK" - else - echo "ERROR" - exit -1 - fi +do + filename="${file%.*}" + list="$list $filename.o" + echo -n "Compiling $filename..." + g++ -g -c -std=c++17 -I../CoreUtils -I../ServerCore $file + if [ $? = '0' ] + then + echo "OK" + else + echo "ERROR" + exit -1 + fi done wait echo -n "Building executable BMAMail..." -g++ -g -std=c++17 -o BMAMail $list -L../CoreUtils -lCoreUtils -L../ServerCore -lServerCore -lpthread -luuid -lssl -lcrypto -lresolv +g++ -g -std=c++17 -o BMAMail $list -I../CoreUtils -I../ServerCore -L../CoreUtils -lCoreUtils -L../ServerCore -lServerCore -lpthread -luuid -lssl -lcrypto -lresolv if [ $? = '0' ] then echo "OK" @@ -25,6 +25,7 @@ else echo "ERROR" exit -1 fi + rm *~ rm *.o diff --git a/error.log b/error.log deleted file mode 100644 index 4b22b31..0000000 --- a/error.log +++ /dev/null @@ -1,1207 +0,0 @@ -In file included from /usr/include/x86_64-linux-gnu/c++/11/bits/c++allocator.h:33, - from /usr/include/c++/11/bits/allocator.h:46, - from /usr/include/c++/11/string:41, - from /usr/include/c++/11/bits/locale_classes.h:40, - from /usr/include/c++/11/bits/ios_base.h:41, - from /usr/include/c++/11/ios:42, - from /usr/include/c++/11/ostream:38, - from /usr/include/c++/11/iostream:39, - from ../ServerCore/includes:1, - from ../ServerCore/Command.h:4, - from SMTPCommand.h:4, - from __SMTP_RCPT.h:4, - from __SMTP_RCPT.cpp:1: -/usr/include/c++/11/ext/new_allocator.h: In instantiation of ‘void __gnu_cxx::new_allocator<_Tp>::construct(_Up*, _Args&& ...) [with _Up = mail::SendMail; _Args = {mail::SendMail}; _Tp = mail::SendMail]’: -/usr/include/c++/11/bits/alloc_traits.h:516:17: required from ‘static void std::allocator_traits >::construct(std::allocator_traits >::allocator_type&, _Up*, _Args&& ...) [with _Up = mail::SendMail; _Args = {mail::SendMail}; _Tp = mail::SendMail; std::allocator_traits >::allocator_type = std::allocator]’ -/usr/include/c++/11/bits/vector.tcc:115:30: required from ‘std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::emplace_back(_Args&& ...) [with _Args = {mail::SendMail}; _Tp = mail::SendMail; _Alloc = std::allocator; std::vector<_Tp, _Alloc>::reference = mail::SendMail&]’ -SMTPServer.h:73:38: required from here -/usr/include/c++/11/ext/new_allocator.h:162:11: error: use of deleted function ‘mail::SendMail::SendMail(const mail::SendMail&)’ - 162 | { ::new((void *)__p) _Up(std::forward<_Args>(__args)...); } - | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -In file included from SMTPServer.h:23, - from __SMTP_RCPT.cpp:2: -SendMail.h:14:10: note: ‘mail::SendMail::SendMail(const mail::SendMail&)’ is implicitly deleted because the default definition would be ill-formed: - 14 | class SendMail : public core::TCPSession2, private core::Timer { - | ^~~~~~~~ -SendMail.h:14:10: error: use of deleted function ‘core::TCPSession2::TCPSession2(const core::TCPSession2&)’ -In file included from SendMail.h:6, - from SMTPServer.h:23, - from __SMTP_RCPT.cpp:2: -../ServerCore/TCPSession2.h:26:10: note: ‘core::TCPSession2::TCPSession2(const core::TCPSession2&)’ is implicitly deleted because the default definition would be ill-formed: - 26 | class TCPSession2 : public TCPSocket { - | ^~~~~~~~~~~ -../ServerCore/TCPSession2.h:26:10: error: use of deleted function ‘core::TCPSocket::TCPSocket(const core::TCPSocket&)’ -In file included from ../ServerCore/TCPSession.h:4, - from ../ServerCore/Command.h:6, - from SMTPCommand.h:4, - from __SMTP_RCPT.h:4, - from __SMTP_RCPT.cpp:1: -../ServerCore/TCPSocket.h:20:10: note: ‘core::TCPSocket::TCPSocket(const core::TCPSocket&)’ is implicitly deleted because the default definition would be ill-formed: - 20 | class TCPSocket : public Socket { - | ^~~~~~~~~ -../ServerCore/TCPSocket.h:20:10: error: use of deleted function ‘core::Socket::Socket(const core::Socket&)’ -In file included from ../ServerCore/TCPSocket.h:5, - from ../ServerCore/TCPSession.h:4, - from ../ServerCore/Command.h:6, - from SMTPCommand.h:4, - from __SMTP_RCPT.h:4, - from __SMTP_RCPT.cpp:1: -../ServerCore/Socket.h:34:10: note: ‘core::Socket::Socket(const core::Socket&)’ is implicitly deleted because the default definition would be ill-formed: - 34 | class Socket { - | ^~~~~~ -../ServerCore/Socket.h:34:10: error: use of deleted function ‘std::mutex::mutex(const std::mutex&)’ -In file included from /usr/include/c++/11/mutex:43, - from ../ServerCore/includes:17, - from ../ServerCore/Command.h:4, - from SMTPCommand.h:4, - from __SMTP_RCPT.h:4, - from __SMTP_RCPT.cpp:1: -/usr/include/c++/11/bits/std_mutex.h:94:5: note: declared here - 94 | mutex(const mutex&) = delete; - | ^~~~~ -In file included from ../ServerCore/TCPSocket.h:5, - from ../ServerCore/TCPSession.h:4, - from ../ServerCore/Command.h:6, - from SMTPCommand.h:4, - from __SMTP_RCPT.h:4, - from __SMTP_RCPT.cpp:1: -../ServerCore/Socket.h:34:10: error: use of deleted function ‘std::mutex::mutex(const std::mutex&)’ - 34 | class Socket { - | ^~~~~~ -In file included from /usr/include/c++/11/mutex:43, - from ../ServerCore/includes:17, - from ../ServerCore/Command.h:4, - from SMTPCommand.h:4, - from __SMTP_RCPT.h:4, - from __SMTP_RCPT.cpp:1: -/usr/include/c++/11/bits/std_mutex.h:94:5: note: declared here - 94 | mutex(const mutex&) = delete; - | ^~~~~ -In file included from SendMail.h:6, - from SMTPServer.h:23, - from __SMTP_RCPT.cpp:2: -../ServerCore/TCPSession2.h:26:10: error: use of deleted function ‘std::__cxx11::basic_stringstream<_CharT, _Traits, _Alloc>::basic_stringstream(const std::__cxx11::basic_stringstream<_CharT, _Traits, _Alloc>&) [with _CharT = char; _Traits = std::char_traits; _Alloc = std::allocator]’ - 26 | class TCPSession2 : public TCPSocket { - | ^~~~~~~~~~~ -In file included from ../ServerCore/includes:13, - from ../ServerCore/Command.h:4, - from SMTPCommand.h:4, - from __SMTP_RCPT.h:4, - from __SMTP_RCPT.cpp:1: -/usr/include/c++/11/sstream:1057:7: note: declared here - 1057 | basic_stringstream(const basic_stringstream&) = delete; - | ^~~~~~~~~~~~~~~~~~ -In file included from SendMail.h:6, - from SMTPServer.h:23, - from __SMTP_RCPT.cpp:2: -../ServerCore/TCPSession2.h:26:10: error: use of deleted function ‘std::mutex::mutex(const std::mutex&)’ - 26 | class TCPSession2 : public TCPSocket { - | ^~~~~~~~~~~ -In file included from /usr/include/c++/11/mutex:43, - from ../ServerCore/includes:17, - from ../ServerCore/Command.h:4, - from SMTPCommand.h:4, - from __SMTP_RCPT.h:4, - from __SMTP_RCPT.cpp:1: -/usr/include/c++/11/bits/std_mutex.h:94:5: note: declared here - 94 | mutex(const mutex&) = delete; - | ^~~~~ -In file included from SMTPServer.h:23, - from __SMTP_RCPT.cpp:2: -SendMail.h:14:10: error: use of deleted function ‘core::Timer::Timer(const core::Timer&)’ - 14 | class SendMail : public core::TCPSession2, private core::Timer { - | ^~~~~~~~ -In file included from ../ServerCore/TCPSession2.h:5, - from SendMail.h:6, - from SMTPServer.h:23, - from __SMTP_RCPT.cpp:2: -../ServerCore/Timer.h:18:10: note: ‘core::Timer::Timer(const core::Timer&)’ is implicitly deleted because the default definition would be ill-formed: - 18 | class Timer : Socket { - | ^~~~~ -../ServerCore/Timer.h:18:10: error: use of deleted function ‘core::Socket::Socket(const core::Socket&)’ -In file included from /usr/include/x86_64-linux-gnu/c++/11/bits/c++allocator.h:33, - from /usr/include/c++/11/bits/allocator.h:46, - from /usr/include/c++/11/string:41, - from /usr/include/c++/11/bits/locale_classes.h:40, - from /usr/include/c++/11/bits/ios_base.h:41, - from /usr/include/c++/11/ios:42, - from /usr/include/c++/11/ostream:38, - from /usr/include/c++/11/iostream:39, - from ../ServerCore/includes:1, - from ../ServerCore/Command.h:4, - from SMTPCommand.h:4, - from __SMTP_EXPN.h:4, - from __SMTP_EXPN.cpp:1: -/usr/include/c++/11/ext/new_allocator.h: In instantiation of ‘void __gnu_cxx::new_allocator<_Tp>::construct(_Up*, _Args&& ...) [with _Up = mail::SendMail; _Args = {mail::SendMail}; _Tp = mail::SendMail]’: -/usr/include/c++/11/bits/alloc_traits.h:516:17: required from ‘static void std::allocator_traits >::construct(std::allocator_traits >::allocator_type&, _Up*, _Args&& ...) [with _Up = mail::SendMail; _Args = {mail::SendMail}; _Tp = mail::SendMail; std::allocator_traits >::allocator_type = std::allocator]’ -/usr/include/c++/11/bits/vector.tcc:115:30: required from ‘std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::emplace_back(_Args&& ...) [with _Args = {mail::SendMail}; _Tp = mail::SendMail; _Alloc = std::allocator; std::vector<_Tp, _Alloc>::reference = mail::SendMail&]’ -SMTPServer.h:73:38: required from here -/usr/include/c++/11/ext/new_allocator.h:162:11: error: use of deleted function ‘mail::SendMail::SendMail(const mail::SendMail&)’ - 162 | { ::new((void *)__p) _Up(std::forward<_Args>(__args)...); } - | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -In file included from SMTPServer.h:23, - from __SMTP_EXPN.cpp:2: -SendMail.h:14:10: note: ‘mail::SendMail::SendMail(const mail::SendMail&)’ is implicitly deleted because the default definition would be ill-formed: - 14 | class SendMail : public core::TCPSession2, private core::Timer { - | ^~~~~~~~ -SendMail.h:14:10: error: use of deleted function ‘core::TCPSession2::TCPSession2(const core::TCPSession2&)’ -In file included from SendMail.h:6, - from SMTPServer.h:23, - from __SMTP_EXPN.cpp:2: -../ServerCore/TCPSession2.h:26:10: note: ‘core::TCPSession2::TCPSession2(const core::TCPSession2&)’ is implicitly deleted because the default definition would be ill-formed: - 26 | class TCPSession2 : public TCPSocket { - | ^~~~~~~~~~~ -../ServerCore/TCPSession2.h:26:10: error: use of deleted function ‘core::TCPSocket::TCPSocket(const core::TCPSocket&)’ -In file included from ../ServerCore/TCPSession.h:4, - from ../ServerCore/Command.h:6, - from SMTPCommand.h:4, - from __SMTP_EXPN.h:4, - from __SMTP_EXPN.cpp:1: -../ServerCore/TCPSocket.h:20:10: note: ‘core::TCPSocket::TCPSocket(const core::TCPSocket&)’ is implicitly deleted because the default definition would be ill-formed: - 20 | class TCPSocket : public Socket { - | ^~~~~~~~~ -../ServerCore/TCPSocket.h:20:10: error: use of deleted function ‘core::Socket::Socket(const core::Socket&)’ -In file included from ../ServerCore/TCPSocket.h:5, - from ../ServerCore/TCPSession.h:4, - from ../ServerCore/Command.h:6, - from SMTPCommand.h:4, - from __SMTP_EXPN.h:4, - from __SMTP_EXPN.cpp:1: -../ServerCore/Socket.h:34:10: note: ‘core::Socket::Socket(const core::Socket&)’ is implicitly deleted because the default definition would be ill-formed: - 34 | class Socket { - | ^~~~~~ -../ServerCore/Socket.h:34:10: error: use of deleted function ‘std::mutex::mutex(const std::mutex&)’ -In file included from /usr/include/c++/11/mutex:43, - from ../ServerCore/includes:17, - from ../ServerCore/Command.h:4, - from SMTPCommand.h:4, - from __SMTP_EXPN.h:4, - from __SMTP_EXPN.cpp:1: -/usr/include/c++/11/bits/std_mutex.h:94:5: note: declared here - 94 | mutex(const mutex&) = delete; - | ^~~~~ -In file included from ../ServerCore/TCPSocket.h:5, - from ../ServerCore/TCPSession.h:4, - from ../ServerCore/Command.h:6, - from SMTPCommand.h:4, - from __SMTP_EXPN.h:4, - from __SMTP_EXPN.cpp:1: -../ServerCore/Socket.h:34:10: error: use of deleted function ‘std::mutex::mutex(const std::mutex&)’ - 34 | class Socket { - | ^~~~~~ -In file included from /usr/include/c++/11/mutex:43, - from ../ServerCore/includes:17, - from ../ServerCore/Command.h:4, - from SMTPCommand.h:4, - from __SMTP_EXPN.h:4, - from __SMTP_EXPN.cpp:1: -/usr/include/c++/11/bits/std_mutex.h:94:5: note: declared here - 94 | mutex(const mutex&) = delete; - | ^~~~~ -In file included from SendMail.h:6, - from SMTPServer.h:23, - from __SMTP_EXPN.cpp:2: -../ServerCore/TCPSession2.h:26:10: error: use of deleted function ‘std::__cxx11::basic_stringstream<_CharT, _Traits, _Alloc>::basic_stringstream(const std::__cxx11::basic_stringstream<_CharT, _Traits, _Alloc>&) [with _CharT = char; _Traits = std::char_traits; _Alloc = std::allocator]’ - 26 | class TCPSession2 : public TCPSocket { - | ^~~~~~~~~~~ -In file included from ../ServerCore/includes:13, - from ../ServerCore/Command.h:4, - from SMTPCommand.h:4, - from __SMTP_EXPN.h:4, - from __SMTP_EXPN.cpp:1: -/usr/include/c++/11/sstream:1057:7: note: declared here - 1057 | basic_stringstream(const basic_stringstream&) = delete; - | ^~~~~~~~~~~~~~~~~~ -In file included from SendMail.h:6, - from SMTPServer.h:23, - from __SMTP_EXPN.cpp:2: -../ServerCore/TCPSession2.h:26:10: error: use of deleted function ‘std::mutex::mutex(const std::mutex&)’ - 26 | class TCPSession2 : public TCPSocket { - | ^~~~~~~~~~~ -In file included from /usr/include/c++/11/mutex:43, - from ../ServerCore/includes:17, - from ../ServerCore/Command.h:4, - from SMTPCommand.h:4, - from __SMTP_EXPN.h:4, - from __SMTP_EXPN.cpp:1: -/usr/include/c++/11/bits/std_mutex.h:94:5: note: declared here - 94 | mutex(const mutex&) = delete; - | ^~~~~ -In file included from SMTPServer.h:23, - from __SMTP_EXPN.cpp:2: -SendMail.h:14:10: error: use of deleted function ‘core::Timer::Timer(const core::Timer&)’ - 14 | class SendMail : public core::TCPSession2, private core::Timer { - | ^~~~~~~~ -In file included from ../ServerCore/TCPSession2.h:5, - from SendMail.h:6, - from SMTPServer.h:23, - from __SMTP_EXPN.cpp:2: -../ServerCore/Timer.h:18:10: note: ‘core::Timer::Timer(const core::Timer&)’ is implicitly deleted because the default definition would be ill-formed: - 18 | class Timer : Socket { - | ^~~~~ -../ServerCore/Timer.h:18:10: error: use of deleted function ‘core::Socket::Socket(const core::Socket&)’ -In file included from /usr/include/c++/11/vector:66, - from ../ServerCore/includes:2, - from ../ServerCore/Command.h:4, - from SMTPCommand.h:4, - from __SMTP_RCPT.h:4, - from __SMTP_RCPT.cpp:1: -/usr/include/c++/11/bits/stl_uninitialized.h: In instantiation of ‘_ForwardIterator std::uninitialized_copy(_InputIterator, _InputIterator, _ForwardIterator) [with _InputIterator = std::move_iterator; _ForwardIterator = mail::SendMail*]’: -/usr/include/c++/11/bits/stl_uninitialized.h:333:37: required from ‘_ForwardIterator std::__uninitialized_copy_a(_InputIterator, _InputIterator, _ForwardIterator, std::allocator<_Tp>&) [with _InputIterator = std::move_iterator; _ForwardIterator = mail::SendMail*; _Tp = mail::SendMail]’ -/usr/include/c++/11/bits/stl_uninitialized.h:355:2: required from ‘_ForwardIterator std::__uninitialized_move_if_noexcept_a(_InputIterator, _InputIterator, _ForwardIterator, _Allocator&) [with _InputIterator = mail::SendMail*; _ForwardIterator = mail::SendMail*; _Allocator = std::allocator]’ -/usr/include/c++/11/bits/vector.tcc:474:3: required from ‘void std::vector<_Tp, _Alloc>::_M_realloc_insert(std::vector<_Tp, _Alloc>::iterator, _Args&& ...) [with _Args = {mail::SendMail}; _Tp = mail::SendMail; _Alloc = std::allocator; std::vector<_Tp, _Alloc>::iterator = std::vector::iterator]’ -/usr/include/c++/11/bits/vector.tcc:121:21: required from ‘std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::emplace_back(_Args&& ...) [with _Args = {mail::SendMail}; _Tp = mail::SendMail; _Alloc = std::allocator; std::vector<_Tp, _Alloc>::reference = mail::SendMail&]’ -SMTPServer.h:73:38: required from here -/usr/include/c++/11/bits/stl_uninitialized.h:138:72: error: static assertion failed: result type must be constructible from value type of input range - 138 | static_assert(is_constructible<_ValueType2, decltype(*__first)>::value, - | ^~~~~ -/usr/include/c++/11/bits/stl_uninitialized.h:138:72: note: ‘std::integral_constant::value’ evaluates to false -In file included from /usr/include/c++/11/vector:66, - from ../ServerCore/includes:2, - from ../ServerCore/Command.h:4, - from SMTPCommand.h:4, - from __SMTP_EXPN.h:4, - from __SMTP_EXPN.cpp:1: -/usr/include/c++/11/bits/stl_uninitialized.h: In instantiation of ‘_ForwardIterator std::uninitialized_copy(_InputIterator, _InputIterator, _ForwardIterator) [with _InputIterator = std::move_iterator; _ForwardIterator = mail::SendMail*]’: -/usr/include/c++/11/bits/stl_uninitialized.h:333:37: required from ‘_ForwardIterator std::__uninitialized_copy_a(_InputIterator, _InputIterator, _ForwardIterator, std::allocator<_Tp>&) [with _InputIterator = std::move_iterator; _ForwardIterator = mail::SendMail*; _Tp = mail::SendMail]’ -/usr/include/c++/11/bits/stl_uninitialized.h:355:2: required from ‘_ForwardIterator std::__uninitialized_move_if_noexcept_a(_InputIterator, _InputIterator, _ForwardIterator, _Allocator&) [with _InputIterator = mail::SendMail*; _ForwardIterator = mail::SendMail*; _Allocator = std::allocator]’ -/usr/include/c++/11/bits/vector.tcc:474:3: required from ‘void std::vector<_Tp, _Alloc>::_M_realloc_insert(std::vector<_Tp, _Alloc>::iterator, _Args&& ...) [with _Args = {mail::SendMail}; _Tp = mail::SendMail; _Alloc = std::allocator; std::vector<_Tp, _Alloc>::iterator = std::vector::iterator]’ -/usr/include/c++/11/bits/vector.tcc:121:21: required from ‘std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::emplace_back(_Args&& ...) [with _Args = {mail::SendMail}; _Tp = mail::SendMail; _Alloc = std::allocator; std::vector<_Tp, _Alloc>::reference = mail::SendMail&]’ -SMTPServer.h:73:38: required from here -/usr/include/c++/11/bits/stl_uninitialized.h:138:72: error: static assertion failed: result type must be constructible from value type of input range - 138 | static_assert(is_constructible<_ValueType2, decltype(*__first)>::value, - | ^~~~~ -/usr/include/c++/11/bits/stl_uninitialized.h:138:72: note: ‘std::integral_constant::value’ evaluates to false -In file included from /usr/include/x86_64-linux-gnu/c++/11/bits/c++allocator.h:33, - from /usr/include/c++/11/bits/allocator.h:46, - from /usr/include/c++/11/string:41, - from /usr/include/c++/11/bits/locale_classes.h:40, - from /usr/include/c++/11/bits/ios_base.h:41, - from /usr/include/c++/11/ios:42, - from /usr/include/c++/11/ostream:38, - from /usr/include/c++/11/iostream:39, - from ../ServerCore/includes:1, - from ../ServerCore/Command.h:4, - from SMTPCommand.h:4, - from __SMTP_HELO.h:4, - from __SMTP_HELO.cpp:1: -/usr/include/c++/11/ext/new_allocator.h: In instantiation of ‘void __gnu_cxx::new_allocator<_Tp>::construct(_Up*, _Args&& ...) [with _Up = mail::SendMail; _Args = {mail::SendMail}; _Tp = mail::SendMail]’: -/usr/include/c++/11/bits/alloc_traits.h:516:17: required from ‘static void std::allocator_traits >::construct(std::allocator_traits >::allocator_type&, _Up*, _Args&& ...) [with _Up = mail::SendMail; _Args = {mail::SendMail}; _Tp = mail::SendMail; std::allocator_traits >::allocator_type = std::allocator]’ -/usr/include/c++/11/bits/vector.tcc:115:30: required from ‘std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::emplace_back(_Args&& ...) [with _Args = {mail::SendMail}; _Tp = mail::SendMail; _Alloc = std::allocator; std::vector<_Tp, _Alloc>::reference = mail::SendMail&]’ -SMTPServer.h:73:38: required from here -/usr/include/c++/11/ext/new_allocator.h:162:11: error: use of deleted function ‘mail::SendMail::SendMail(const mail::SendMail&)’ - 162 | { ::new((void *)__p) _Up(std::forward<_Args>(__args)...); } - | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -In file included from SMTPServer.h:23, - from __SMTP_HELO.cpp:2: -SendMail.h:14:10: note: ‘mail::SendMail::SendMail(const mail::SendMail&)’ is implicitly deleted because the default definition would be ill-formed: - 14 | class SendMail : public core::TCPSession2, private core::Timer { - | ^~~~~~~~ -SendMail.h:14:10: error: use of deleted function ‘core::TCPSession2::TCPSession2(const core::TCPSession2&)’ -In file included from SendMail.h:6, - from SMTPServer.h:23, - from __SMTP_HELO.cpp:2: -../ServerCore/TCPSession2.h:26:10: note: ‘core::TCPSession2::TCPSession2(const core::TCPSession2&)’ is implicitly deleted because the default definition would be ill-formed: - 26 | class TCPSession2 : public TCPSocket { - | ^~~~~~~~~~~ -../ServerCore/TCPSession2.h:26:10: error: use of deleted function ‘core::TCPSocket::TCPSocket(const core::TCPSocket&)’ -In file included from ../ServerCore/TCPSession.h:4, - from ../ServerCore/Command.h:6, - from SMTPCommand.h:4, - from __SMTP_HELO.h:4, - from __SMTP_HELO.cpp:1: -../ServerCore/TCPSocket.h:20:10: note: ‘core::TCPSocket::TCPSocket(const core::TCPSocket&)’ is implicitly deleted because the default definition would be ill-formed: - 20 | class TCPSocket : public Socket { - | ^~~~~~~~~ -../ServerCore/TCPSocket.h:20:10: error: use of deleted function ‘core::Socket::Socket(const core::Socket&)’ -In file included from ../ServerCore/TCPSocket.h:5, - from ../ServerCore/TCPSession.h:4, - from ../ServerCore/Command.h:6, - from SMTPCommand.h:4, - from __SMTP_HELO.h:4, - from __SMTP_HELO.cpp:1: -../ServerCore/Socket.h:34:10: note: ‘core::Socket::Socket(const core::Socket&)’ is implicitly deleted because the default definition would be ill-formed: - 34 | class Socket { - | ^~~~~~ -../ServerCore/Socket.h:34:10: error: use of deleted function ‘std::mutex::mutex(const std::mutex&)’ -In file included from /usr/include/c++/11/mutex:43, - from ../ServerCore/includes:17, - from ../ServerCore/Command.h:4, - from SMTPCommand.h:4, - from __SMTP_HELO.h:4, - from __SMTP_HELO.cpp:1: -/usr/include/c++/11/bits/std_mutex.h:94:5: note: declared here - 94 | mutex(const mutex&) = delete; - | ^~~~~ -In file included from ../ServerCore/TCPSocket.h:5, - from ../ServerCore/TCPSession.h:4, - from ../ServerCore/Command.h:6, - from SMTPCommand.h:4, - from __SMTP_HELO.h:4, - from __SMTP_HELO.cpp:1: -../ServerCore/Socket.h:34:10: error: use of deleted function ‘std::mutex::mutex(const std::mutex&)’ - 34 | class Socket { - | ^~~~~~ -In file included from /usr/include/c++/11/mutex:43, - from ../ServerCore/includes:17, - from ../ServerCore/Command.h:4, - from SMTPCommand.h:4, - from __SMTP_HELO.h:4, - from __SMTP_HELO.cpp:1: -/usr/include/c++/11/bits/std_mutex.h:94:5: note: declared here - 94 | mutex(const mutex&) = delete; - | ^~~~~ -In file included from SendMail.h:6, - from SMTPServer.h:23, - from __SMTP_HELO.cpp:2: -../ServerCore/TCPSession2.h:26:10: error: use of deleted function ‘std::__cxx11::basic_stringstream<_CharT, _Traits, _Alloc>::basic_stringstream(const std::__cxx11::basic_stringstream<_CharT, _Traits, _Alloc>&) [with _CharT = char; _Traits = std::char_traits; _Alloc = std::allocator]’ - 26 | class TCPSession2 : public TCPSocket { - | ^~~~~~~~~~~ -In file included from ../ServerCore/includes:13, - from ../ServerCore/Command.h:4, - from SMTPCommand.h:4, - from __SMTP_HELO.h:4, - from __SMTP_HELO.cpp:1: -/usr/include/c++/11/sstream:1057:7: note: declared here - 1057 | basic_stringstream(const basic_stringstream&) = delete; - | ^~~~~~~~~~~~~~~~~~ -In file included from SendMail.h:6, - from SMTPServer.h:23, - from __SMTP_HELO.cpp:2: -../ServerCore/TCPSession2.h:26:10: error: use of deleted function ‘std::mutex::mutex(const std::mutex&)’ - 26 | class TCPSession2 : public TCPSocket { - | ^~~~~~~~~~~ -In file included from /usr/include/c++/11/mutex:43, - from ../ServerCore/includes:17, - from ../ServerCore/Command.h:4, - from SMTPCommand.h:4, - from __SMTP_HELO.h:4, - from __SMTP_HELO.cpp:1: -/usr/include/c++/11/bits/std_mutex.h:94:5: note: declared here - 94 | mutex(const mutex&) = delete; - | ^~~~~ -In file included from SMTPServer.h:23, - from __SMTP_HELO.cpp:2: -SendMail.h:14:10: error: use of deleted function ‘core::Timer::Timer(const core::Timer&)’ - 14 | class SendMail : public core::TCPSession2, private core::Timer { - | ^~~~~~~~ -In file included from ../ServerCore/TCPSession2.h:5, - from SendMail.h:6, - from SMTPServer.h:23, - from __SMTP_HELO.cpp:2: -../ServerCore/Timer.h:18:10: note: ‘core::Timer::Timer(const core::Timer&)’ is implicitly deleted because the default definition would be ill-formed: - 18 | class Timer : Socket { - | ^~~~~ -../ServerCore/Timer.h:18:10: error: use of deleted function ‘core::Socket::Socket(const core::Socket&)’ -In file included from /usr/include/x86_64-linux-gnu/c++/11/bits/c++allocator.h:33, - from /usr/include/c++/11/bits/allocator.h:46, - from /usr/include/c++/11/string:41, - from /usr/include/c++/11/bits/locale_classes.h:40, - from /usr/include/c++/11/bits/ios_base.h:41, - from /usr/include/c++/11/ios:42, - from /usr/include/c++/11/ostream:38, - from /usr/include/c++/11/iostream:39, - from ../ServerCore/includes:1, - from ../ServerCore/Command.h:4, - from SMTPCommand.h:4, - from __SMTP_AUTH.h:4, - from __SMTP_AUTH.cpp:1: -/usr/include/c++/11/ext/new_allocator.h: In instantiation of ‘void __gnu_cxx::new_allocator<_Tp>::construct(_Up*, _Args&& ...) [with _Up = mail::SendMail; _Args = {mail::SendMail}; _Tp = mail::SendMail]’: -/usr/include/c++/11/bits/alloc_traits.h:516:17: required from ‘static void std::allocator_traits >::construct(std::allocator_traits >::allocator_type&, _Up*, _Args&& ...) [with _Up = mail::SendMail; _Args = {mail::SendMail}; _Tp = mail::SendMail; std::allocator_traits >::allocator_type = std::allocator]’ -/usr/include/c++/11/bits/vector.tcc:115:30: required from ‘std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::emplace_back(_Args&& ...) [with _Args = {mail::SendMail}; _Tp = mail::SendMail; _Alloc = std::allocator; std::vector<_Tp, _Alloc>::reference = mail::SendMail&]’ -SMTPServer.h:73:38: required from here -/usr/include/c++/11/ext/new_allocator.h:162:11: error: use of deleted function ‘mail::SendMail::SendMail(const mail::SendMail&)’ - 162 | { ::new((void *)__p) _Up(std::forward<_Args>(__args)...); } - | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -In file included from SMTPServer.h:23, - from __SMTP_AUTH.cpp:3: -SendMail.h:14:10: note: ‘mail::SendMail::SendMail(const mail::SendMail&)’ is implicitly deleted because the default definition would be ill-formed: - 14 | class SendMail : public core::TCPSession2, private core::Timer { - | ^~~~~~~~ -SendMail.h:14:10: error: use of deleted function ‘core::TCPSession2::TCPSession2(const core::TCPSession2&)’ -In file included from SendMail.h:6, - from SMTPServer.h:23, - from __SMTP_AUTH.cpp:3: -../ServerCore/TCPSession2.h:26:10: note: ‘core::TCPSession2::TCPSession2(const core::TCPSession2&)’ is implicitly deleted because the default definition would be ill-formed: - 26 | class TCPSession2 : public TCPSocket { - | ^~~~~~~~~~~ -../ServerCore/TCPSession2.h:26:10: error: use of deleted function ‘core::TCPSocket::TCPSocket(const core::TCPSocket&)’ -In file included from ../ServerCore/TCPSession.h:4, - from ../ServerCore/Command.h:6, - from SMTPCommand.h:4, - from __SMTP_AUTH.h:4, - from __SMTP_AUTH.cpp:1: -../ServerCore/TCPSocket.h:20:10: note: ‘core::TCPSocket::TCPSocket(const core::TCPSocket&)’ is implicitly deleted because the default definition would be ill-formed: - 20 | class TCPSocket : public Socket { - | ^~~~~~~~~ -../ServerCore/TCPSocket.h:20:10: error: use of deleted function ‘core::Socket::Socket(const core::Socket&)’ -In file included from ../ServerCore/TCPSocket.h:5, - from ../ServerCore/TCPSession.h:4, - from ../ServerCore/Command.h:6, - from SMTPCommand.h:4, - from __SMTP_AUTH.h:4, - from __SMTP_AUTH.cpp:1: -../ServerCore/Socket.h:34:10: note: ‘core::Socket::Socket(const core::Socket&)’ is implicitly deleted because the default definition would be ill-formed: - 34 | class Socket { - | ^~~~~~ -../ServerCore/Socket.h:34:10: error: use of deleted function ‘std::mutex::mutex(const std::mutex&)’ -In file included from /usr/include/c++/11/mutex:43, - from ../ServerCore/includes:17, - from ../ServerCore/Command.h:4, - from SMTPCommand.h:4, - from __SMTP_AUTH.h:4, - from __SMTP_AUTH.cpp:1: -/usr/include/c++/11/bits/std_mutex.h:94:5: note: declared here - 94 | mutex(const mutex&) = delete; - | ^~~~~ -In file included from ../ServerCore/TCPSocket.h:5, - from ../ServerCore/TCPSession.h:4, - from ../ServerCore/Command.h:6, - from SMTPCommand.h:4, - from __SMTP_AUTH.h:4, - from __SMTP_AUTH.cpp:1: -../ServerCore/Socket.h:34:10: error: use of deleted function ‘std::mutex::mutex(const std::mutex&)’ - 34 | class Socket { - | ^~~~~~ -In file included from /usr/include/c++/11/mutex:43, - from ../ServerCore/includes:17, - from ../ServerCore/Command.h:4, - from SMTPCommand.h:4, - from __SMTP_AUTH.h:4, - from __SMTP_AUTH.cpp:1: -/usr/include/c++/11/bits/std_mutex.h:94:5: note: declared here - 94 | mutex(const mutex&) = delete; - | ^~~~~ -In file included from SendMail.h:6, - from SMTPServer.h:23, - from __SMTP_AUTH.cpp:3: -../ServerCore/TCPSession2.h:26:10: error: use of deleted function ‘std::__cxx11::basic_stringstream<_CharT, _Traits, _Alloc>::basic_stringstream(const std::__cxx11::basic_stringstream<_CharT, _Traits, _Alloc>&) [with _CharT = char; _Traits = std::char_traits; _Alloc = std::allocator]’ - 26 | class TCPSession2 : public TCPSocket { - | ^~~~~~~~~~~ -In file included from ../ServerCore/includes:13, - from ../ServerCore/Command.h:4, - from SMTPCommand.h:4, - from __SMTP_AUTH.h:4, - from __SMTP_AUTH.cpp:1: -/usr/include/c++/11/sstream:1057:7: note: declared here - 1057 | basic_stringstream(const basic_stringstream&) = delete; - | ^~~~~~~~~~~~~~~~~~ -In file included from SendMail.h:6, - from SMTPServer.h:23, - from __SMTP_AUTH.cpp:3: -../ServerCore/TCPSession2.h:26:10: error: use of deleted function ‘std::mutex::mutex(const std::mutex&)’ - 26 | class TCPSession2 : public TCPSocket { - | ^~~~~~~~~~~ -In file included from /usr/include/c++/11/mutex:43, - from ../ServerCore/includes:17, - from ../ServerCore/Command.h:4, - from SMTPCommand.h:4, - from __SMTP_AUTH.h:4, - from __SMTP_AUTH.cpp:1: -/usr/include/c++/11/bits/std_mutex.h:94:5: note: declared here - 94 | mutex(const mutex&) = delete; - | ^~~~~ -In file included from SMTPServer.h:23, - from __SMTP_AUTH.cpp:3: -SendMail.h:14:10: error: use of deleted function ‘core::Timer::Timer(const core::Timer&)’ - 14 | class SendMail : public core::TCPSession2, private core::Timer { - | ^~~~~~~~ -In file included from ../ServerCore/TCPSession2.h:5, - from SendMail.h:6, - from SMTPServer.h:23, - from __SMTP_AUTH.cpp:3: -../ServerCore/Timer.h:18:10: note: ‘core::Timer::Timer(const core::Timer&)’ is implicitly deleted because the default definition would be ill-formed: - 18 | class Timer : Socket { - | ^~~~~ -../ServerCore/Timer.h:18:10: error: use of deleted function ‘core::Socket::Socket(const core::Socket&)’ -In file included from /usr/include/c++/11/vector:66, - from ../ServerCore/includes:2, - from ../ServerCore/Command.h:4, - from SMTPCommand.h:4, - from __SMTP_AUTH.h:4, - from __SMTP_AUTH.cpp:1: -/usr/include/c++/11/bits/stl_uninitialized.h: In instantiation of ‘_ForwardIterator std::uninitialized_copy(_InputIterator, _InputIterator, _ForwardIterator) [with _InputIterator = std::move_iterator; _ForwardIterator = mail::SendMail*]’: -/usr/include/c++/11/bits/stl_uninitialized.h:333:37: required from ‘_ForwardIterator std::__uninitialized_copy_a(_InputIterator, _InputIterator, _ForwardIterator, std::allocator<_Tp>&) [with _InputIterator = std::move_iterator; _ForwardIterator = mail::SendMail*; _Tp = mail::SendMail]’ -/usr/include/c++/11/bits/stl_uninitialized.h:355:2: required from ‘_ForwardIterator std::__uninitialized_move_if_noexcept_a(_InputIterator, _InputIterator, _ForwardIterator, _Allocator&) [with _InputIterator = mail::SendMail*; _ForwardIterator = mail::SendMail*; _Allocator = std::allocator]’ -/usr/include/c++/11/bits/vector.tcc:474:3: required from ‘void std::vector<_Tp, _Alloc>::_M_realloc_insert(std::vector<_Tp, _Alloc>::iterator, _Args&& ...) [with _Args = {mail::SendMail}; _Tp = mail::SendMail; _Alloc = std::allocator; std::vector<_Tp, _Alloc>::iterator = std::vector::iterator]’ -/usr/include/c++/11/bits/vector.tcc:121:21: required from ‘std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::emplace_back(_Args&& ...) [with _Args = {mail::SendMail}; _Tp = mail::SendMail; _Alloc = std::allocator; std::vector<_Tp, _Alloc>::reference = mail::SendMail&]’ -SMTPServer.h:73:38: required from here -/usr/include/c++/11/bits/stl_uninitialized.h:138:72: error: static assertion failed: result type must be constructible from value type of input range - 138 | static_assert(is_constructible<_ValueType2, decltype(*__first)>::value, - | ^~~~~ -/usr/include/c++/11/bits/stl_uninitialized.h:138:72: note: ‘std::integral_constant::value’ evaluates to false -In file included from /usr/include/c++/11/vector:66, - from ../ServerCore/includes:2, - from ../ServerCore/Command.h:4, - from SMTPCommand.h:4, - from __SMTP_HELO.h:4, - from __SMTP_HELO.cpp:1: -/usr/include/c++/11/bits/stl_uninitialized.h: In instantiation of ‘_ForwardIterator std::uninitialized_copy(_InputIterator, _InputIterator, _ForwardIterator) [with _InputIterator = std::move_iterator; _ForwardIterator = mail::SendMail*]’: -/usr/include/c++/11/bits/stl_uninitialized.h:333:37: required from ‘_ForwardIterator std::__uninitialized_copy_a(_InputIterator, _InputIterator, _ForwardIterator, std::allocator<_Tp>&) [with _InputIterator = std::move_iterator; _ForwardIterator = mail::SendMail*; _Tp = mail::SendMail]’ -/usr/include/c++/11/bits/stl_uninitialized.h:355:2: required from ‘_ForwardIterator std::__uninitialized_move_if_noexcept_a(_InputIterator, _InputIterator, _ForwardIterator, _Allocator&) [with _InputIterator = mail::SendMail*; _ForwardIterator = mail::SendMail*; _Allocator = std::allocator]’ -/usr/include/c++/11/bits/vector.tcc:474:3: required from ‘void std::vector<_Tp, _Alloc>::_M_realloc_insert(std::vector<_Tp, _Alloc>::iterator, _Args&& ...) [with _Args = {mail::SendMail}; _Tp = mail::SendMail; _Alloc = std::allocator; std::vector<_Tp, _Alloc>::iterator = std::vector::iterator]’ -/usr/include/c++/11/bits/vector.tcc:121:21: required from ‘std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::emplace_back(_Args&& ...) [with _Args = {mail::SendMail}; _Tp = mail::SendMail; _Alloc = std::allocator; std::vector<_Tp, _Alloc>::reference = mail::SendMail&]’ -SMTPServer.h:73:38: required from here -/usr/include/c++/11/bits/stl_uninitialized.h:138:72: error: static assertion failed: result type must be constructible from value type of input range - 138 | static_assert(is_constructible<_ValueType2, decltype(*__first)>::value, - | ^~~~~ -/usr/include/c++/11/bits/stl_uninitialized.h:138:72: note: ‘std::integral_constant::value’ evaluates to false -In file included from /usr/include/x86_64-linux-gnu/c++/11/bits/c++allocator.h:33, - from /usr/include/c++/11/bits/allocator.h:46, - from /usr/include/c++/11/string:41, - from /usr/include/c++/11/bits/locale_classes.h:40, - from /usr/include/c++/11/bits/ios_base.h:41, - from /usr/include/c++/11/ios:42, - from /usr/include/c++/11/ostream:38, - from /usr/include/c++/11/iostream:39, - from ../ServerCore/includes:1, - from ../ServerCore/Command.h:4, - from SMTPCommand.h:4, - from __SMTP_QUIT.h:4, - from __SMTP_QUIT.cpp:1: -/usr/include/c++/11/ext/new_allocator.h: In instantiation of ‘void __gnu_cxx::new_allocator<_Tp>::construct(_Up*, _Args&& ...) [with _Up = mail::SendMail; _Args = {mail::SendMail}; _Tp = mail::SendMail]’: -/usr/include/c++/11/bits/alloc_traits.h:516:17: required from ‘static void std::allocator_traits >::construct(std::allocator_traits >::allocator_type&, _Up*, _Args&& ...) [with _Up = mail::SendMail; _Args = {mail::SendMail}; _Tp = mail::SendMail; std::allocator_traits >::allocator_type = std::allocator]’ -/usr/include/c++/11/bits/vector.tcc:115:30: required from ‘std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::emplace_back(_Args&& ...) [with _Args = {mail::SendMail}; _Tp = mail::SendMail; _Alloc = std::allocator; std::vector<_Tp, _Alloc>::reference = mail::SendMail&]’ -SMTPServer.h:73:38: required from here -/usr/include/c++/11/ext/new_allocator.h:162:11: error: use of deleted function ‘mail::SendMail::SendMail(const mail::SendMail&)’ - 162 | { ::new((void *)__p) _Up(std::forward<_Args>(__args)...); } - | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -In file included from SMTPServer.h:23, - from __SMTP_QUIT.cpp:3: -SendMail.h:14:10: note: ‘mail::SendMail::SendMail(const mail::SendMail&)’ is implicitly deleted because the default definition would be ill-formed: - 14 | class SendMail : public core::TCPSession2, private core::Timer { - | ^~~~~~~~ -SendMail.h:14:10: error: use of deleted function ‘core::TCPSession2::TCPSession2(const core::TCPSession2&)’ -In file included from SendMail.h:6, - from SMTPServer.h:23, - from __SMTP_QUIT.cpp:3: -../ServerCore/TCPSession2.h:26:10: note: ‘core::TCPSession2::TCPSession2(const core::TCPSession2&)’ is implicitly deleted because the default definition would be ill-formed: - 26 | class TCPSession2 : public TCPSocket { - | ^~~~~~~~~~~ -../ServerCore/TCPSession2.h:26:10: error: use of deleted function ‘core::TCPSocket::TCPSocket(const core::TCPSocket&)’ -In file included from ../ServerCore/TCPSession.h:4, - from ../ServerCore/Command.h:6, - from SMTPCommand.h:4, - from __SMTP_QUIT.h:4, - from __SMTP_QUIT.cpp:1: -../ServerCore/TCPSocket.h:20:10: note: ‘core::TCPSocket::TCPSocket(const core::TCPSocket&)’ is implicitly deleted because the default definition would be ill-formed: - 20 | class TCPSocket : public Socket { - | ^~~~~~~~~ -../ServerCore/TCPSocket.h:20:10: error: use of deleted function ‘core::Socket::Socket(const core::Socket&)’ -In file included from ../ServerCore/TCPSocket.h:5, - from ../ServerCore/TCPSession.h:4, - from ../ServerCore/Command.h:6, - from SMTPCommand.h:4, - from __SMTP_QUIT.h:4, - from __SMTP_QUIT.cpp:1: -../ServerCore/Socket.h:34:10: note: ‘core::Socket::Socket(const core::Socket&)’ is implicitly deleted because the default definition would be ill-formed: - 34 | class Socket { - | ^~~~~~ -../ServerCore/Socket.h:34:10: error: use of deleted function ‘std::mutex::mutex(const std::mutex&)’ -In file included from /usr/include/c++/11/mutex:43, - from ../ServerCore/includes:17, - from ../ServerCore/Command.h:4, - from SMTPCommand.h:4, - from __SMTP_QUIT.h:4, - from __SMTP_QUIT.cpp:1: -/usr/include/c++/11/bits/std_mutex.h:94:5: note: declared here - 94 | mutex(const mutex&) = delete; - | ^~~~~ -In file included from ../ServerCore/TCPSocket.h:5, - from ../ServerCore/TCPSession.h:4, - from ../ServerCore/Command.h:6, - from SMTPCommand.h:4, - from __SMTP_QUIT.h:4, - from __SMTP_QUIT.cpp:1: -../ServerCore/Socket.h:34:10: error: use of deleted function ‘std::mutex::mutex(const std::mutex&)’ - 34 | class Socket { - | ^~~~~~ -In file included from /usr/include/c++/11/mutex:43, - from ../ServerCore/includes:17, - from ../ServerCore/Command.h:4, - from SMTPCommand.h:4, - from __SMTP_QUIT.h:4, - from __SMTP_QUIT.cpp:1: -/usr/include/c++/11/bits/std_mutex.h:94:5: note: declared here - 94 | mutex(const mutex&) = delete; - | ^~~~~ -In file included from SendMail.h:6, - from SMTPServer.h:23, - from __SMTP_QUIT.cpp:3: -../ServerCore/TCPSession2.h:26:10: error: use of deleted function ‘std::__cxx11::basic_stringstream<_CharT, _Traits, _Alloc>::basic_stringstream(const std::__cxx11::basic_stringstream<_CharT, _Traits, _Alloc>&) [with _CharT = char; _Traits = std::char_traits; _Alloc = std::allocator]’ - 26 | class TCPSession2 : public TCPSocket { - | ^~~~~~~~~~~ -In file included from ../ServerCore/includes:13, - from ../ServerCore/Command.h:4, - from SMTPCommand.h:4, - from __SMTP_QUIT.h:4, - from __SMTP_QUIT.cpp:1: -/usr/include/c++/11/sstream:1057:7: note: declared here - 1057 | basic_stringstream(const basic_stringstream&) = delete; - | ^~~~~~~~~~~~~~~~~~ -In file included from SendMail.h:6, - from SMTPServer.h:23, - from __SMTP_QUIT.cpp:3: -../ServerCore/TCPSession2.h:26:10: error: use of deleted function ‘std::mutex::mutex(const std::mutex&)’ - 26 | class TCPSession2 : public TCPSocket { - | ^~~~~~~~~~~ -In file included from /usr/include/c++/11/mutex:43, - from ../ServerCore/includes:17, - from ../ServerCore/Command.h:4, - from SMTPCommand.h:4, - from __SMTP_QUIT.h:4, - from __SMTP_QUIT.cpp:1: -/usr/include/c++/11/bits/std_mutex.h:94:5: note: declared here - 94 | mutex(const mutex&) = delete; - | ^~~~~ -In file included from SMTPServer.h:23, - from __SMTP_QUIT.cpp:3: -SendMail.h:14:10: error: use of deleted function ‘core::Timer::Timer(const core::Timer&)’ - 14 | class SendMail : public core::TCPSession2, private core::Timer { - | ^~~~~~~~ -In file included from ../ServerCore/TCPSession2.h:5, - from SendMail.h:6, - from SMTPServer.h:23, - from __SMTP_QUIT.cpp:3: -../ServerCore/Timer.h:18:10: note: ‘core::Timer::Timer(const core::Timer&)’ is implicitly deleted because the default definition would be ill-formed: - 18 | class Timer : Socket { - | ^~~~~ -../ServerCore/Timer.h:18:10: error: use of deleted function ‘core::Socket::Socket(const core::Socket&)’ -In file included from /usr/include/c++/11/vector:66, - from ../ServerCore/includes:2, - from ../ServerCore/Command.h:4, - from SMTPCommand.h:4, - from __SMTP_QUIT.h:4, - from __SMTP_QUIT.cpp:1: -/usr/include/c++/11/bits/stl_uninitialized.h: In instantiation of ‘_ForwardIterator std::uninitialized_copy(_InputIterator, _InputIterator, _ForwardIterator) [with _InputIterator = std::move_iterator; _ForwardIterator = mail::SendMail*]’: -/usr/include/c++/11/bits/stl_uninitialized.h:333:37: required from ‘_ForwardIterator std::__uninitialized_copy_a(_InputIterator, _InputIterator, _ForwardIterator, std::allocator<_Tp>&) [with _InputIterator = std::move_iterator; _ForwardIterator = mail::SendMail*; _Tp = mail::SendMail]’ -/usr/include/c++/11/bits/stl_uninitialized.h:355:2: required from ‘_ForwardIterator std::__uninitialized_move_if_noexcept_a(_InputIterator, _InputIterator, _ForwardIterator, _Allocator&) [with _InputIterator = mail::SendMail*; _ForwardIterator = mail::SendMail*; _Allocator = std::allocator]’ -/usr/include/c++/11/bits/vector.tcc:474:3: required from ‘void std::vector<_Tp, _Alloc>::_M_realloc_insert(std::vector<_Tp, _Alloc>::iterator, _Args&& ...) [with _Args = {mail::SendMail}; _Tp = mail::SendMail; _Alloc = std::allocator; std::vector<_Tp, _Alloc>::iterator = std::vector::iterator]’ -/usr/include/c++/11/bits/vector.tcc:121:21: required from ‘std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::emplace_back(_Args&& ...) [with _Args = {mail::SendMail}; _Tp = mail::SendMail; _Alloc = std::allocator; std::vector<_Tp, _Alloc>::reference = mail::SendMail&]’ -SMTPServer.h:73:38: required from here -/usr/include/c++/11/bits/stl_uninitialized.h:138:72: error: static assertion failed: result type must be constructible from value type of input range - 138 | static_assert(is_constructible<_ValueType2, decltype(*__first)>::value, - | ^~~~~ -/usr/include/c++/11/bits/stl_uninitialized.h:138:72: note: ‘std::integral_constant::value’ evaluates to false -In file included from /usr/include/x86_64-linux-gnu/c++/11/bits/c++allocator.h:33, - from /usr/include/c++/11/bits/allocator.h:46, - from /usr/include/c++/11/string:41, - from /usr/include/c++/11/bits/locale_classes.h:40, - from /usr/include/c++/11/bits/ios_base.h:41, - from /usr/include/c++/11/ios:42, - from /usr/include/c++/11/ostream:38, - from /usr/include/c++/11/iostream:39, - from ../ServerCore/includes:1, - from ../ServerCore/Command.h:4, - from SMTPCommand.h:4, - from __SMTP_EHLO.h:4, - from __SMTP_EHLO.cpp:1: -/usr/include/c++/11/ext/new_allocator.h: In instantiation of ‘void __gnu_cxx::new_allocator<_Tp>::construct(_Up*, _Args&& ...) [with _Up = mail::SendMail; _Args = {mail::SendMail}; _Tp = mail::SendMail]’: -/usr/include/c++/11/bits/alloc_traits.h:516:17: required from ‘static void std::allocator_traits >::construct(std::allocator_traits >::allocator_type&, _Up*, _Args&& ...) [with _Up = mail::SendMail; _Args = {mail::SendMail}; _Tp = mail::SendMail; std::allocator_traits >::allocator_type = std::allocator]’ -/usr/include/c++/11/bits/vector.tcc:115:30: required from ‘std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::emplace_back(_Args&& ...) [with _Args = {mail::SendMail}; _Tp = mail::SendMail; _Alloc = std::allocator; std::vector<_Tp, _Alloc>::reference = mail::SendMail&]’ -SMTPServer.h:73:38: required from here -/usr/include/c++/11/ext/new_allocator.h:162:11: error: use of deleted function ‘mail::SendMail::SendMail(const mail::SendMail&)’ - 162 | { ::new((void *)__p) _Up(std::forward<_Args>(__args)...); } - | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -In file included from SMTPServer.h:23, - from __SMTP_EHLO.cpp:2: -SendMail.h:14:10: note: ‘mail::SendMail::SendMail(const mail::SendMail&)’ is implicitly deleted because the default definition would be ill-formed: - 14 | class SendMail : public core::TCPSession2, private core::Timer { - | ^~~~~~~~ -SendMail.h:14:10: error: use of deleted function ‘core::TCPSession2::TCPSession2(const core::TCPSession2&)’ -In file included from SendMail.h:6, - from SMTPServer.h:23, - from __SMTP_EHLO.cpp:2: -../ServerCore/TCPSession2.h:26:10: note: ‘core::TCPSession2::TCPSession2(const core::TCPSession2&)’ is implicitly deleted because the default definition would be ill-formed: - 26 | class TCPSession2 : public TCPSocket { - | ^~~~~~~~~~~ -../ServerCore/TCPSession2.h:26:10: error: use of deleted function ‘core::TCPSocket::TCPSocket(const core::TCPSocket&)’ -In file included from ../ServerCore/TCPSession.h:4, - from ../ServerCore/Command.h:6, - from SMTPCommand.h:4, - from __SMTP_EHLO.h:4, - from __SMTP_EHLO.cpp:1: -../ServerCore/TCPSocket.h:20:10: note: ‘core::TCPSocket::TCPSocket(const core::TCPSocket&)’ is implicitly deleted because the default definition would be ill-formed: - 20 | class TCPSocket : public Socket { - | ^~~~~~~~~ -../ServerCore/TCPSocket.h:20:10: error: use of deleted function ‘core::Socket::Socket(const core::Socket&)’ -In file included from ../ServerCore/TCPSocket.h:5, - from ../ServerCore/TCPSession.h:4, - from ../ServerCore/Command.h:6, - from SMTPCommand.h:4, - from __SMTP_EHLO.h:4, - from __SMTP_EHLO.cpp:1: -../ServerCore/Socket.h:34:10: note: ‘core::Socket::Socket(const core::Socket&)’ is implicitly deleted because the default definition would be ill-formed: - 34 | class Socket { - | ^~~~~~ -../ServerCore/Socket.h:34:10: error: use of deleted function ‘std::mutex::mutex(const std::mutex&)’ -In file included from /usr/include/c++/11/mutex:43, - from ../ServerCore/includes:17, - from ../ServerCore/Command.h:4, - from SMTPCommand.h:4, - from __SMTP_EHLO.h:4, - from __SMTP_EHLO.cpp:1: -/usr/include/c++/11/bits/std_mutex.h:94:5: note: declared here - 94 | mutex(const mutex&) = delete; - | ^~~~~ -In file included from ../ServerCore/TCPSocket.h:5, - from ../ServerCore/TCPSession.h:4, - from ../ServerCore/Command.h:6, - from SMTPCommand.h:4, - from __SMTP_EHLO.h:4, - from __SMTP_EHLO.cpp:1: -../ServerCore/Socket.h:34:10: error: use of deleted function ‘std::mutex::mutex(const std::mutex&)’ - 34 | class Socket { - | ^~~~~~ -In file included from /usr/include/c++/11/mutex:43, - from ../ServerCore/includes:17, - from ../ServerCore/Command.h:4, - from SMTPCommand.h:4, - from __SMTP_EHLO.h:4, - from __SMTP_EHLO.cpp:1: -/usr/include/c++/11/bits/std_mutex.h:94:5: note: declared here - 94 | mutex(const mutex&) = delete; - | ^~~~~ -In file included from SendMail.h:6, - from SMTPServer.h:23, - from __SMTP_EHLO.cpp:2: -../ServerCore/TCPSession2.h:26:10: error: use of deleted function ‘std::__cxx11::basic_stringstream<_CharT, _Traits, _Alloc>::basic_stringstream(const std::__cxx11::basic_stringstream<_CharT, _Traits, _Alloc>&) [with _CharT = char; _Traits = std::char_traits; _Alloc = std::allocator]’ - 26 | class TCPSession2 : public TCPSocket { - | ^~~~~~~~~~~ -In file included from ../ServerCore/includes:13, - from ../ServerCore/Command.h:4, - from SMTPCommand.h:4, - from __SMTP_EHLO.h:4, - from __SMTP_EHLO.cpp:1: -/usr/include/c++/11/sstream:1057:7: note: declared here - 1057 | basic_stringstream(const basic_stringstream&) = delete; - | ^~~~~~~~~~~~~~~~~~ -In file included from SendMail.h:6, - from SMTPServer.h:23, - from __SMTP_EHLO.cpp:2: -../ServerCore/TCPSession2.h:26:10: error: use of deleted function ‘std::mutex::mutex(const std::mutex&)’ - 26 | class TCPSession2 : public TCPSocket { - | ^~~~~~~~~~~ -In file included from /usr/include/c++/11/mutex:43, - from ../ServerCore/includes:17, - from ../ServerCore/Command.h:4, - from SMTPCommand.h:4, - from __SMTP_EHLO.h:4, - from __SMTP_EHLO.cpp:1: -/usr/include/c++/11/bits/std_mutex.h:94:5: note: declared here - 94 | mutex(const mutex&) = delete; - | ^~~~~ -In file included from SMTPServer.h:23, - from __SMTP_EHLO.cpp:2: -SendMail.h:14:10: error: use of deleted function ‘core::Timer::Timer(const core::Timer&)’ - 14 | class SendMail : public core::TCPSession2, private core::Timer { - | ^~~~~~~~ -In file included from ../ServerCore/TCPSession2.h:5, - from SendMail.h:6, - from SMTPServer.h:23, - from __SMTP_EHLO.cpp:2: -../ServerCore/Timer.h:18:10: note: ‘core::Timer::Timer(const core::Timer&)’ is implicitly deleted because the default definition would be ill-formed: - 18 | class Timer : Socket { - | ^~~~~ -../ServerCore/Timer.h:18:10: error: use of deleted function ‘core::Socket::Socket(const core::Socket&)’ -In file included from /usr/include/c++/11/vector:66, - from ../ServerCore/includes:2, - from ../ServerCore/Command.h:4, - from SMTPCommand.h:4, - from __SMTP_EHLO.h:4, - from __SMTP_EHLO.cpp:1: -/usr/include/c++/11/bits/stl_uninitialized.h: In instantiation of ‘_ForwardIterator std::uninitialized_copy(_InputIterator, _InputIterator, _ForwardIterator) [with _InputIterator = std::move_iterator; _ForwardIterator = mail::SendMail*]’: -/usr/include/c++/11/bits/stl_uninitialized.h:333:37: required from ‘_ForwardIterator std::__uninitialized_copy_a(_InputIterator, _InputIterator, _ForwardIterator, std::allocator<_Tp>&) [with _InputIterator = std::move_iterator; _ForwardIterator = mail::SendMail*; _Tp = mail::SendMail]’ -/usr/include/c++/11/bits/stl_uninitialized.h:355:2: required from ‘_ForwardIterator std::__uninitialized_move_if_noexcept_a(_InputIterator, _InputIterator, _ForwardIterator, _Allocator&) [with _InputIterator = mail::SendMail*; _ForwardIterator = mail::SendMail*; _Allocator = std::allocator]’ -/usr/include/c++/11/bits/vector.tcc:474:3: required from ‘void std::vector<_Tp, _Alloc>::_M_realloc_insert(std::vector<_Tp, _Alloc>::iterator, _Args&& ...) [with _Args = {mail::SendMail}; _Tp = mail::SendMail; _Alloc = std::allocator; std::vector<_Tp, _Alloc>::iterator = std::vector::iterator]’ -/usr/include/c++/11/bits/vector.tcc:121:21: required from ‘std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::emplace_back(_Args&& ...) [with _Args = {mail::SendMail}; _Tp = mail::SendMail; _Alloc = std::allocator; std::vector<_Tp, _Alloc>::reference = mail::SendMail&]’ -SMTPServer.h:73:38: required from here -/usr/include/c++/11/bits/stl_uninitialized.h:138:72: error: static assertion failed: result type must be constructible from value type of input range - 138 | static_assert(is_constructible<_ValueType2, decltype(*__first)>::value, - | ^~~~~ -/usr/include/c++/11/bits/stl_uninitialized.h:138:72: note: ‘std::integral_constant::value’ evaluates to false -In file included from /usr/include/x86_64-linux-gnu/c++/11/bits/c++allocator.h:33, - from /usr/include/c++/11/bits/allocator.h:46, - from /usr/include/c++/11/string:41, - from main.cpp:1: -/usr/include/c++/11/ext/new_allocator.h: In instantiation of ‘void __gnu_cxx::new_allocator<_Tp>::construct(_Up*, _Args&& ...) [with _Up = mail::SendMail; _Args = {mail::SendMail}; _Tp = mail::SendMail]’: -/usr/include/c++/11/bits/alloc_traits.h:516:17: required from ‘static void std::allocator_traits >::construct(std::allocator_traits >::allocator_type&, _Up*, _Args&& ...) [with _Up = mail::SendMail; _Args = {mail::SendMail}; _Tp = mail::SendMail; std::allocator_traits >::allocator_type = std::allocator]’ -/usr/include/c++/11/bits/vector.tcc:115:30: required from ‘std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::emplace_back(_Args&& ...) [with _Args = {mail::SendMail}; _Tp = mail::SendMail; _Alloc = std::allocator; std::vector<_Tp, _Alloc>::reference = mail::SendMail&]’ -SMTPServer.h:73:38: required from here -/usr/include/c++/11/ext/new_allocator.h:162:11: error: use of deleted function ‘mail::SendMail::SendMail(const mail::SendMail&)’ - 162 | { ::new((void *)__p) _Up(std::forward<_Args>(__args)...); } - | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -In file included from SMTPServer.h:23, - from main.cpp:9: -SendMail.h:14:10: note: ‘mail::SendMail::SendMail(const mail::SendMail&)’ is implicitly deleted because the default definition would be ill-formed: - 14 | class SendMail : public core::TCPSession2, private core::Timer { - | ^~~~~~~~ -SendMail.h:14:10: error: use of deleted function ‘core::TCPSession2::TCPSession2(const core::TCPSession2&)’ -In file included from SendMail.h:6, - from SMTPServer.h:23, - from main.cpp:9: -../ServerCore/TCPSession2.h:26:10: note: ‘core::TCPSession2::TCPSession2(const core::TCPSession2&)’ is implicitly deleted because the default definition would be ill-formed: - 26 | class TCPSession2 : public TCPSocket { - | ^~~~~~~~~~~ -../ServerCore/TCPSession2.h:26:10: error: use of deleted function ‘core::TCPSocket::TCPSocket(const core::TCPSocket&)’ -In file included from ../ServerCore/TCPSession.h:4, - from ../ServerCore/Thread.h:7, - from ../ServerCore/EPoll.h:6, - from main.cpp:2: -../ServerCore/TCPSocket.h:20:10: note: ‘core::TCPSocket::TCPSocket(const core::TCPSocket&)’ is implicitly deleted because the default definition would be ill-formed: - 20 | class TCPSocket : public Socket { - | ^~~~~~~~~ -../ServerCore/TCPSocket.h:20:10: error: use of deleted function ‘core::Socket::Socket(const core::Socket&)’ -In file included from ../ServerCore/EPoll.h:5, - from main.cpp:2: -../ServerCore/Socket.h:34:10: note: ‘core::Socket::Socket(const core::Socket&)’ is implicitly deleted because the default definition would be ill-formed: - 34 | class Socket { - | ^~~~~~ -../ServerCore/Socket.h:34:10: error: use of deleted function ‘std::mutex::mutex(const std::mutex&)’ -In file included from /usr/include/c++/11/mutex:43, - from ../CoreUtils/Log.h:6, - from ../ServerCore/EPoll.h:4, - from main.cpp:2: -/usr/include/c++/11/bits/std_mutex.h:94:5: note: declared here - 94 | mutex(const mutex&) = delete; - | ^~~~~ -In file included from ../ServerCore/EPoll.h:5, - from main.cpp:2: -../ServerCore/Socket.h:34:10: error: use of deleted function ‘std::mutex::mutex(const std::mutex&)’ - 34 | class Socket { - | ^~~~~~ -In file included from /usr/include/c++/11/mutex:43, - from ../CoreUtils/Log.h:6, - from ../ServerCore/EPoll.h:4, - from main.cpp:2: -/usr/include/c++/11/bits/std_mutex.h:94:5: note: declared here - 94 | mutex(const mutex&) = delete; - | ^~~~~ -In file included from SendMail.h:6, - from SMTPServer.h:23, - from main.cpp:9: -../ServerCore/TCPSession2.h:26:10: error: use of deleted function ‘std::__cxx11::basic_stringstream<_CharT, _Traits, _Alloc>::basic_stringstream(const std::__cxx11::basic_stringstream<_CharT, _Traits, _Alloc>&) [with _CharT = char; _Traits = std::char_traits; _Alloc = std::allocator]’ - 26 | class TCPSession2 : public TCPSocket { - | ^~~~~~~~~~~ -In file included from ../CoreUtils/Log.h:8, - from ../ServerCore/EPoll.h:4, - from main.cpp:2: -/usr/include/c++/11/sstream:1057:7: note: declared here - 1057 | basic_stringstream(const basic_stringstream&) = delete; - | ^~~~~~~~~~~~~~~~~~ -In file included from SendMail.h:6, - from SMTPServer.h:23, - from main.cpp:9: -../ServerCore/TCPSession2.h:26:10: error: use of deleted function ‘std::mutex::mutex(const std::mutex&)’ - 26 | class TCPSession2 : public TCPSocket { - | ^~~~~~~~~~~ -In file included from /usr/include/c++/11/mutex:43, - from ../CoreUtils/Log.h:6, - from ../ServerCore/EPoll.h:4, - from main.cpp:2: -/usr/include/c++/11/bits/std_mutex.h:94:5: note: declared here - 94 | mutex(const mutex&) = delete; - | ^~~~~ -In file included from SMTPServer.h:23, - from main.cpp:9: -SendMail.h:14:10: error: use of deleted function ‘core::Timer::Timer(const core::Timer&)’ - 14 | class SendMail : public core::TCPSession2, private core::Timer { - | ^~~~~~~~ -In file included from ../ServerCore/TCPSession2.h:5, - from SendMail.h:6, - from SMTPServer.h:23, - from main.cpp:9: -../ServerCore/Timer.h:18:10: note: ‘core::Timer::Timer(const core::Timer&)’ is implicitly deleted because the default definition would be ill-formed: - 18 | class Timer : Socket { - | ^~~~~ -../ServerCore/Timer.h:18:10: error: use of deleted function ‘core::Socket::Socket(const core::Socket&)’ -In file included from /usr/include/c++/11/vector:66, - from ../CoreUtils/ZString.h:7, - from ../CoreUtils/File.h:6, - from ../CoreUtils/Log.h:4, - from ../ServerCore/EPoll.h:4, - from main.cpp:2: -/usr/include/c++/11/bits/stl_uninitialized.h: In instantiation of ‘_ForwardIterator std::uninitialized_copy(_InputIterator, _InputIterator, _ForwardIterator) [with _InputIterator = std::move_iterator; _ForwardIterator = mail::SendMail*]’: -/usr/include/c++/11/bits/stl_uninitialized.h:333:37: required from ‘_ForwardIterator std::__uninitialized_copy_a(_InputIterator, _InputIterator, _ForwardIterator, std::allocator<_Tp>&) [with _InputIterator = std::move_iterator; _ForwardIterator = mail::SendMail*; _Tp = mail::SendMail]’ -/usr/include/c++/11/bits/stl_uninitialized.h:355:2: required from ‘_ForwardIterator std::__uninitialized_move_if_noexcept_a(_InputIterator, _InputIterator, _ForwardIterator, _Allocator&) [with _InputIterator = mail::SendMail*; _ForwardIterator = mail::SendMail*; _Allocator = std::allocator]’ -/usr/include/c++/11/bits/vector.tcc:474:3: required from ‘void std::vector<_Tp, _Alloc>::_M_realloc_insert(std::vector<_Tp, _Alloc>::iterator, _Args&& ...) [with _Args = {mail::SendMail}; _Tp = mail::SendMail; _Alloc = std::allocator; std::vector<_Tp, _Alloc>::iterator = std::vector::iterator]’ -/usr/include/c++/11/bits/vector.tcc:121:21: required from ‘std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::emplace_back(_Args&& ...) [with _Args = {mail::SendMail}; _Tp = mail::SendMail; _Alloc = std::allocator; std::vector<_Tp, _Alloc>::reference = mail::SendMail&]’ -SMTPServer.h:73:38: required from here -/usr/include/c++/11/bits/stl_uninitialized.h:138:72: error: static assertion failed: result type must be constructible from value type of input range - 138 | static_assert(is_constructible<_ValueType2, decltype(*__first)>::value, - | ^~~~~ -/usr/include/c++/11/bits/stl_uninitialized.h:138:72: note: ‘std::integral_constant::value’ evaluates to false -In file included from /usr/include/x86_64-linux-gnu/c++/11/bits/c++allocator.h:33, - from /usr/include/c++/11/bits/allocator.h:46, - from /usr/include/c++/11/string:41, - from /usr/include/c++/11/bits/locale_classes.h:40, - from /usr/include/c++/11/bits/ios_base.h:41, - from /usr/include/c++/11/ios:42, - from /usr/include/c++/11/ostream:38, - from /usr/include/c++/11/iostream:39, - from ../ServerCore/includes:1, - from ../ServerCore/Command.h:4, - from SMTPCommand.h:4, - from __SMTP_HELP.h:4, - from __SMTP_HELP.cpp:1: -/usr/include/c++/11/ext/new_allocator.h: In instantiation of ‘void __gnu_cxx::new_allocator<_Tp>::construct(_Up*, _Args&& ...) [with _Up = mail::SendMail; _Args = {mail::SendMail}; _Tp = mail::SendMail]’: -/usr/include/c++/11/bits/alloc_traits.h:516:17: required from ‘static void std::allocator_traits >::construct(std::allocator_traits >::allocator_type&, _Up*, _Args&& ...) [with _Up = mail::SendMail; _Args = {mail::SendMail}; _Tp = mail::SendMail; std::allocator_traits >::allocator_type = std::allocator]’ -/usr/include/c++/11/bits/vector.tcc:115:30: required from ‘std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::emplace_back(_Args&& ...) [with _Args = {mail::SendMail}; _Tp = mail::SendMail; _Alloc = std::allocator; std::vector<_Tp, _Alloc>::reference = mail::SendMail&]’ -SMTPServer.h:73:38: required from here -/usr/include/c++/11/ext/new_allocator.h:162:11: error: use of deleted function ‘mail::SendMail::SendMail(const mail::SendMail&)’ - 162 | { ::new((void *)__p) _Up(std::forward<_Args>(__args)...); } - | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -In file included from SMTPServer.h:23, - from __SMTP_HELP.cpp:2: -SendMail.h:14:10: note: ‘mail::SendMail::SendMail(const mail::SendMail&)’ is implicitly deleted because the default definition would be ill-formed: - 14 | class SendMail : public core::TCPSession2, private core::Timer { - | ^~~~~~~~ -SendMail.h:14:10: error: use of deleted function ‘core::TCPSession2::TCPSession2(const core::TCPSession2&)’ -In file included from SendMail.h:6, - from SMTPServer.h:23, - from __SMTP_HELP.cpp:2: -../ServerCore/TCPSession2.h:26:10: note: ‘core::TCPSession2::TCPSession2(const core::TCPSession2&)’ is implicitly deleted because the default definition would be ill-formed: - 26 | class TCPSession2 : public TCPSocket { - | ^~~~~~~~~~~ -../ServerCore/TCPSession2.h:26:10: error: use of deleted function ‘core::TCPSocket::TCPSocket(const core::TCPSocket&)’ -In file included from ../ServerCore/TCPSession.h:4, - from ../ServerCore/Command.h:6, - from SMTPCommand.h:4, - from __SMTP_HELP.h:4, - from __SMTP_HELP.cpp:1: -../ServerCore/TCPSocket.h:20:10: note: ‘core::TCPSocket::TCPSocket(const core::TCPSocket&)’ is implicitly deleted because the default definition would be ill-formed: - 20 | class TCPSocket : public Socket { - | ^~~~~~~~~ -../ServerCore/TCPSocket.h:20:10: error: use of deleted function ‘core::Socket::Socket(const core::Socket&)’ -In file included from ../ServerCore/TCPSocket.h:5, - from ../ServerCore/TCPSession.h:4, - from ../ServerCore/Command.h:6, - from SMTPCommand.h:4, - from __SMTP_HELP.h:4, - from __SMTP_HELP.cpp:1: -../ServerCore/Socket.h:34:10: note: ‘core::Socket::Socket(const core::Socket&)’ is implicitly deleted because the default definition would be ill-formed: - 34 | class Socket { - | ^~~~~~ -../ServerCore/Socket.h:34:10: error: use of deleted function ‘std::mutex::mutex(const std::mutex&)’ -In file included from /usr/include/c++/11/mutex:43, - from ../ServerCore/includes:17, - from ../ServerCore/Command.h:4, - from SMTPCommand.h:4, - from __SMTP_HELP.h:4, - from __SMTP_HELP.cpp:1: -/usr/include/c++/11/bits/std_mutex.h:94:5: note: declared here - 94 | mutex(const mutex&) = delete; - | ^~~~~ -In file included from ../ServerCore/TCPSocket.h:5, - from ../ServerCore/TCPSession.h:4, - from ../ServerCore/Command.h:6, - from SMTPCommand.h:4, - from __SMTP_HELP.h:4, - from __SMTP_HELP.cpp:1: -../ServerCore/Socket.h:34:10: error: use of deleted function ‘std::mutex::mutex(const std::mutex&)’ - 34 | class Socket { - | ^~~~~~ -In file included from /usr/include/c++/11/mutex:43, - from ../ServerCore/includes:17, - from ../ServerCore/Command.h:4, - from SMTPCommand.h:4, - from __SMTP_HELP.h:4, - from __SMTP_HELP.cpp:1: -/usr/include/c++/11/bits/std_mutex.h:94:5: note: declared here - 94 | mutex(const mutex&) = delete; - | ^~~~~ -In file included from SendMail.h:6, - from SMTPServer.h:23, - from __SMTP_HELP.cpp:2: -../ServerCore/TCPSession2.h:26:10: error: use of deleted function ‘std::__cxx11::basic_stringstream<_CharT, _Traits, _Alloc>::basic_stringstream(const std::__cxx11::basic_stringstream<_CharT, _Traits, _Alloc>&) [with _CharT = char; _Traits = std::char_traits; _Alloc = std::allocator]’ - 26 | class TCPSession2 : public TCPSocket { - | ^~~~~~~~~~~ -In file included from ../ServerCore/includes:13, - from ../ServerCore/Command.h:4, - from SMTPCommand.h:4, - from __SMTP_HELP.h:4, - from __SMTP_HELP.cpp:1: -/usr/include/c++/11/sstream:1057:7: note: declared here - 1057 | basic_stringstream(const basic_stringstream&) = delete; - | ^~~~~~~~~~~~~~~~~~ -In file included from SendMail.h:6, - from SMTPServer.h:23, - from __SMTP_HELP.cpp:2: -../ServerCore/TCPSession2.h:26:10: error: use of deleted function ‘std::mutex::mutex(const std::mutex&)’ - 26 | class TCPSession2 : public TCPSocket { - | ^~~~~~~~~~~ -In file included from /usr/include/c++/11/mutex:43, - from ../ServerCore/includes:17, - from ../ServerCore/Command.h:4, - from SMTPCommand.h:4, - from __SMTP_HELP.h:4, - from __SMTP_HELP.cpp:1: -/usr/include/c++/11/bits/std_mutex.h:94:5: note: declared here - 94 | mutex(const mutex&) = delete; - | ^~~~~ -In file included from SMTPServer.h:23, - from __SMTP_HELP.cpp:2: -SendMail.h:14:10: error: use of deleted function ‘core::Timer::Timer(const core::Timer&)’ - 14 | class SendMail : public core::TCPSession2, private core::Timer { - | ^~~~~~~~ -In file included from ../ServerCore/TCPSession2.h:5, - from SendMail.h:6, - from SMTPServer.h:23, - from __SMTP_HELP.cpp:2: -../ServerCore/Timer.h:18:10: note: ‘core::Timer::Timer(const core::Timer&)’ is implicitly deleted because the default definition would be ill-formed: - 18 | class Timer : Socket { - | ^~~~~ -../ServerCore/Timer.h:18:10: error: use of deleted function ‘core::Socket::Socket(const core::Socket&)’ -In file included from /usr/include/c++/11/vector:66, - from ../ServerCore/includes:2, - from ../ServerCore/Command.h:4, - from SMTPCommand.h:4, - from __SMTP_HELP.h:4, - from __SMTP_HELP.cpp:1: -/usr/include/c++/11/bits/stl_uninitialized.h: In instantiation of ‘_ForwardIterator std::uninitialized_copy(_InputIterator, _InputIterator, _ForwardIterator) [with _InputIterator = std::move_iterator; _ForwardIterator = mail::SendMail*]’: -/usr/include/c++/11/bits/stl_uninitialized.h:333:37: required from ‘_ForwardIterator std::__uninitialized_copy_a(_InputIterator, _InputIterator, _ForwardIterator, std::allocator<_Tp>&) [with _InputIterator = std::move_iterator; _ForwardIterator = mail::SendMail*; _Tp = mail::SendMail]’ -/usr/include/c++/11/bits/stl_uninitialized.h:355:2: required from ‘_ForwardIterator std::__uninitialized_move_if_noexcept_a(_InputIterator, _InputIterator, _ForwardIterator, _Allocator&) [with _InputIterator = mail::SendMail*; _ForwardIterator = mail::SendMail*; _Allocator = std::allocator]’ -/usr/include/c++/11/bits/vector.tcc:474:3: required from ‘void std::vector<_Tp, _Alloc>::_M_realloc_insert(std::vector<_Tp, _Alloc>::iterator, _Args&& ...) [with _Args = {mail::SendMail}; _Tp = mail::SendMail; _Alloc = std::allocator; std::vector<_Tp, _Alloc>::iterator = std::vector::iterator]’ -/usr/include/c++/11/bits/vector.tcc:121:21: required from ‘std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::emplace_back(_Args&& ...) [with _Args = {mail::SendMail}; _Tp = mail::SendMail; _Alloc = std::allocator; std::vector<_Tp, _Alloc>::reference = mail::SendMail&]’ -SMTPServer.h:73:38: required from here -/usr/include/c++/11/bits/stl_uninitialized.h:138:72: error: static assertion failed: result type must be constructible from value type of input range - 138 | static_assert(is_constructible<_ValueType2, decltype(*__first)>::value, - | ^~~~~ -/usr/include/c++/11/bits/stl_uninitialized.h:138:72: note: ‘std::integral_constant::value’ evaluates to false -In file included from /usr/include/x86_64-linux-gnu/c++/11/bits/c++allocator.h:33, - from /usr/include/c++/11/bits/allocator.h:46, - from /usr/include/c++/11/string:41, - from /usr/include/c++/11/bits/locale_classes.h:40, - from /usr/include/c++/11/bits/ios_base.h:41, - from /usr/include/c++/11/ios:42, - from /usr/include/c++/11/ostream:38, - from /usr/include/c++/11/iostream:39, - from ../ServerCore/includes:1, - from ../ServerCore/Command.h:4, - from SMTPCommand.h:4, - from __SMTP_DATA.h:4, - from __SMTP_DATA.cpp:1: -/usr/include/c++/11/ext/new_allocator.h: In instantiation of ‘void __gnu_cxx::new_allocator<_Tp>::construct(_Up*, _Args&& ...) [with _Up = mail::SendMail; _Args = {mail::SendMail}; _Tp = mail::SendMail]’: -/usr/include/c++/11/bits/alloc_traits.h:516:17: required from ‘static void std::allocator_traits >::construct(std::allocator_traits >::allocator_type&, _Up*, _Args&& ...) [with _Up = mail::SendMail; _Args = {mail::SendMail}; _Tp = mail::SendMail; std::allocator_traits >::allocator_type = std::allocator]’ -/usr/include/c++/11/bits/vector.tcc:115:30: required from ‘std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::emplace_back(_Args&& ...) [with _Args = {mail::SendMail}; _Tp = mail::SendMail; _Alloc = std::allocator; std::vector<_Tp, _Alloc>::reference = mail::SendMail&]’ -SMTPServer.h:73:38: required from here -/usr/include/c++/11/ext/new_allocator.h:162:11: error: use of deleted function ‘mail::SendMail::SendMail(const mail::SendMail&)’ - 162 | { ::new((void *)__p) _Up(std::forward<_Args>(__args)...); } - | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -In file included from SMTPServer.h:23, - from __SMTP_DATA.cpp:2: -SendMail.h:14:10: note: ‘mail::SendMail::SendMail(const mail::SendMail&)’ is implicitly deleted because the default definition would be ill-formed: - 14 | class SendMail : public core::TCPSession2, private core::Timer { - | ^~~~~~~~ -SendMail.h:14:10: error: use of deleted function ‘core::TCPSession2::TCPSession2(const core::TCPSession2&)’ -In file included from SendMail.h:6, - from SMTPServer.h:23, - from __SMTP_DATA.cpp:2: -../ServerCore/TCPSession2.h:26:10: note: ‘core::TCPSession2::TCPSession2(const core::TCPSession2&)’ is implicitly deleted because the default definition would be ill-formed: - 26 | class TCPSession2 : public TCPSocket { - | ^~~~~~~~~~~ -../ServerCore/TCPSession2.h:26:10: error: use of deleted function ‘core::TCPSocket::TCPSocket(const core::TCPSocket&)’ -In file included from ../ServerCore/TCPSession.h:4, - from ../ServerCore/Command.h:6, - from SMTPCommand.h:4, - from __SMTP_DATA.h:4, - from __SMTP_DATA.cpp:1: -../ServerCore/TCPSocket.h:20:10: note: ‘core::TCPSocket::TCPSocket(const core::TCPSocket&)’ is implicitly deleted because the default definition would be ill-formed: - 20 | class TCPSocket : public Socket { - | ^~~~~~~~~ -../ServerCore/TCPSocket.h:20:10: error: use of deleted function ‘core::Socket::Socket(const core::Socket&)’ -In file included from ../ServerCore/TCPSocket.h:5, - from ../ServerCore/TCPSession.h:4, - from ../ServerCore/Command.h:6, - from SMTPCommand.h:4, - from __SMTP_DATA.h:4, - from __SMTP_DATA.cpp:1: -../ServerCore/Socket.h:34:10: note: ‘core::Socket::Socket(const core::Socket&)’ is implicitly deleted because the default definition would be ill-formed: - 34 | class Socket { - | ^~~~~~ -../ServerCore/Socket.h:34:10: error: use of deleted function ‘std::mutex::mutex(const std::mutex&)’ -In file included from /usr/include/c++/11/mutex:43, - from ../ServerCore/includes:17, - from ../ServerCore/Command.h:4, - from SMTPCommand.h:4, - from __SMTP_DATA.h:4, - from __SMTP_DATA.cpp:1: -/usr/include/c++/11/bits/std_mutex.h:94:5: note: declared here - 94 | mutex(const mutex&) = delete; - | ^~~~~ -In file included from ../ServerCore/TCPSocket.h:5, - from ../ServerCore/TCPSession.h:4, - from ../ServerCore/Command.h:6, - from SMTPCommand.h:4, - from __SMTP_DATA.h:4, - from __SMTP_DATA.cpp:1: -../ServerCore/Socket.h:34:10: error: use of deleted function ‘std::mutex::mutex(const std::mutex&)’ - 34 | class Socket { - | ^~~~~~ -In file included from /usr/include/c++/11/mutex:43, - from ../ServerCore/includes:17, - from ../ServerCore/Command.h:4, - from SMTPCommand.h:4, - from __SMTP_DATA.h:4, - from __SMTP_DATA.cpp:1: -/usr/include/c++/11/bits/std_mutex.h:94:5: note: declared here - 94 | mutex(const mutex&) = delete; - | ^~~~~ -In file included from SendMail.h:6, - from SMTPServer.h:23, - from __SMTP_DATA.cpp:2: -../ServerCore/TCPSession2.h:26:10: error: use of deleted function ‘std::__cxx11::basic_stringstream<_CharT, _Traits, _Alloc>::basic_stringstream(const std::__cxx11::basic_stringstream<_CharT, _Traits, _Alloc>&) [with _CharT = char; _Traits = std::char_traits; _Alloc = std::allocator]’ - 26 | class TCPSession2 : public TCPSocket { - | ^~~~~~~~~~~ -In file included from ../ServerCore/includes:13, - from ../ServerCore/Command.h:4, - from SMTPCommand.h:4, - from __SMTP_DATA.h:4, - from __SMTP_DATA.cpp:1: -/usr/include/c++/11/sstream:1057:7: note: declared here - 1057 | basic_stringstream(const basic_stringstream&) = delete; - | ^~~~~~~~~~~~~~~~~~ -In file included from SendMail.h:6, - from SMTPServer.h:23, - from __SMTP_DATA.cpp:2: -../ServerCore/TCPSession2.h:26:10: error: use of deleted function ‘std::mutex::mutex(const std::mutex&)’ - 26 | class TCPSession2 : public TCPSocket { - | ^~~~~~~~~~~ -In file included from /usr/include/c++/11/mutex:43, - from ../ServerCore/includes:17, - from ../ServerCore/Command.h:4, - from SMTPCommand.h:4, - from __SMTP_DATA.h:4, - from __SMTP_DATA.cpp:1: -/usr/include/c++/11/bits/std_mutex.h:94:5: note: declared here - 94 | mutex(const mutex&) = delete; - | ^~~~~ -In file included from SMTPServer.h:23, - from __SMTP_DATA.cpp:2: -SendMail.h:14:10: error: use of deleted function ‘core::Timer::Timer(const core::Timer&)’ - 14 | class SendMail : public core::TCPSession2, private core::Timer { - | ^~~~~~~~ -In file included from ../ServerCore/TCPSession2.h:5, - from SendMail.h:6, - from SMTPServer.h:23, - from __SMTP_DATA.cpp:2: -../ServerCore/Timer.h:18:10: note: ‘core::Timer::Timer(const core::Timer&)’ is implicitly deleted because the default definition would be ill-formed: - 18 | class Timer : Socket { - | ^~~~~ -../ServerCore/Timer.h:18:10: error: use of deleted function ‘core::Socket::Socket(const core::Socket&)’ -In file included from /usr/include/c++/11/vector:66, - from ../ServerCore/includes:2, - from ../ServerCore/Command.h:4, - from SMTPCommand.h:4, - from __SMTP_DATA.h:4, - from __SMTP_DATA.cpp:1: -/usr/include/c++/11/bits/stl_uninitialized.h: In instantiation of ‘_ForwardIterator std::uninitialized_copy(_InputIterator, _InputIterator, _ForwardIterator) [with _InputIterator = std::move_iterator; _ForwardIterator = mail::SendMail*]’: -/usr/include/c++/11/bits/stl_uninitialized.h:333:37: required from ‘_ForwardIterator std::__uninitialized_copy_a(_InputIterator, _InputIterator, _ForwardIterator, std::allocator<_Tp>&) [with _InputIterator = std::move_iterator; _ForwardIterator = mail::SendMail*; _Tp = mail::SendMail]’ -/usr/include/c++/11/bits/stl_uninitialized.h:355:2: required from ‘_ForwardIterator std::__uninitialized_move_if_noexcept_a(_InputIterator, _InputIterator, _ForwardIterator, _Allocator&) [with _InputIterator = mail::SendMail*; _ForwardIterator = mail::SendMail*; _Allocator = std::allocator]’ -/usr/include/c++/11/bits/vector.tcc:474:3: required from ‘void std::vector<_Tp, _Alloc>::_M_realloc_insert(std::vector<_Tp, _Alloc>::iterator, _Args&& ...) [with _Args = {mail::SendMail}; _Tp = mail::SendMail; _Alloc = std::allocator; std::vector<_Tp, _Alloc>::iterator = std::vector::iterator]’ -/usr/include/c++/11/bits/vector.tcc:121:21: required from ‘std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::emplace_back(_Args&& ...) [with _Args = {mail::SendMail}; _Tp = mail::SendMail; _Alloc = std::allocator; std::vector<_Tp, _Alloc>::reference = mail::SendMail&]’ -SMTPServer.h:73:38: required from here -/usr/include/c++/11/bits/stl_uninitialized.h:138:72: error: static assertion failed: result type must be constructible from value type of input range - 138 | static_assert(is_constructible<_ValueType2, decltype(*__first)>::value, - | ^~~~~ -/usr/include/c++/11/bits/stl_uninitialized.h:138:72: note: ‘std::integral_constant::value’ evaluates to false diff --git a/main.cpp b/main.cpp index 76f412e..020fc00 100644 --- a/main.cpp +++ b/main.cpp @@ -9,12 +9,41 @@ #include "SMTPServer.h" #include "POP3Server.h" #include "IMAPServer.h" +#include "SendMail2.h" +#include +#include int main(int argc, char **argv) { + coreutils::Log(new coreutils::File("/var/log/barantmail.log", O_WRONLY | O_APPEND | O_CREAT, 0644)); + coreutils::Log(coreutils::LOG_INFO) << "BMAMAIL called with link " << argv[0]; + std::string arg = argv[0]; + if(arg.substr(arg.find_last_of("\\/") + 1) == "sendmail2") { + try { + coreutils::Log(coreutils::LOG_INFO) << "Starting Mail Injector. Build " << __DATE__ << " " << __TIME__; + + char buffer[1000000]; + int index = 0; + int len = 0; + while((len = read(0, &buffer[index], 1000000)) > 0) + index += len; + coreutils::MString message(buffer, index); + coreutils::Log(coreutils::LOG_DEBUG_1) << "Number of bytes read: " << index; + core::EPoll ePoll; + ePoll.start(1, 1000); + mail::SendMail2 mail2(ePoll, argv[1], argv[2], message); + mail2.send(); + coreutils::Log(coreutils::LOG_DEBUG_1) << "waiting..."; + coreutils::MString rc(mail2.wait()); + coreutils::Log(coreutils::LOG_DEBUG_1) << "rc: " << rc; + std::cout << rc; + } + catch(coreutils::Exception exception) { + std::cout << exception.text << " Error reason is '" << strerror(exception.errorNumber) << "' in file " << exception.file << " at line " << exception.line << std::endl; + } + } else { try { - coreutils::Log(new coreutils::File("/var/log/mail.log", O_WRONLY | O_APPEND | O_CREAT, 0644)); coreutils::Log(coreutils::LOG_INFO) << "BMAMail Server starting. Build " << __DATE__ << " " << __TIME__; std::string hostName = "localhost"; @@ -42,5 +71,5 @@ int main(int argc, char **argv) { catch(coreutils::Exception exception) { std::cout << exception.text << " Error reason is '" << strerror(exception.errorNumber) << "' in file " << exception.file << " at line " << exception.line << std::endl; } - + } } diff --git a/main.hpp.gch b/main.hpp.gch new file mode 100644 index 0000000..7b61372 Binary files /dev/null and b/main.hpp.gch differ diff --git a/sendmail.cpp.x b/sendmail.cpp.x deleted file mode 100644 index 33dd7f9..0000000 --- a/sendmail.cpp.x +++ /dev/null @@ -1,11 +0,0 @@ -#include -#include - -int main(int argc, char **argv) { - - - - - - -} diff --git a/sendmail2 b/sendmail2 new file mode 120000 index 0000000..106ad7f --- /dev/null +++ b/sendmail2 @@ -0,0 +1 @@ +BMAMail \ No newline at end of file diff --git a/tests/testemail.email b/tests/testemail.email new file mode 100644 index 0000000..39eb655 --- /dev/null +++ b/tests/testemail.email @@ -0,0 +1,5 @@ +From: +To: +Subject: An email test + +This is a test diff --git a/tests/testsmtp b/tests/testsmtp index 6a154f5..19c921a 100755 --- a/tests/testsmtp +++ b/tests/testsmtp @@ -1,5 +1,3 @@ -#!/bin/bash -nc localhost 9025 > /dev/null << EOL EHLO barant.com MAIL FROM: RCPT TO: @@ -12,5 +10,3 @@ Subject: test email system This is a test . QUIT -EOL -