diff --git a/BMAMail b/BMAMail index e3871ae..3bf9f25 100755 Binary files a/BMAMail and b/BMAMail differ diff --git a/MailFileSystem.cpp b/MailFileSystem.cpp index 2991fea..c0ba553 100644 --- a/MailFileSystem.cpp +++ b/MailFileSystem.cpp @@ -1,15 +1,20 @@ #include "MailFileSystem.h" # include "INotify.h" +# include "Log.h" namespace mail { - MailFileSystem::MailFileSystem(coreutils::ZString &mailPath) : mailPath(mailPath) {} + MailFileSystem::MailFileSystem(coreutils::ZString &mailPath) : mailPath(mailPath) { + queuePath << mailPath << "/.queue/"; + } bool MailFileSystem::ifMailBoxExists(coreutils::ZString &mailbox) { + coreutils::Log(coreutils::LOG_DEBUG_2) << "if exists mailbox: " << mailbox << "."; if(stat(getMailBoxPath(mailbox).c_str(), &statbuf) != -1) if(S_ISDIR(statbuf.st_mode)) return true; + coreutils::Log(coreutils::LOG_DEBUG_2) << "doesnt exist mailbox: " << mailbox << "."; return false; } @@ -36,4 +41,8 @@ namespace mail { return mailPath; } + coreutils::ZString& MailFileSystem::getQueuePath() { + return queuePath; + } + } diff --git a/MailFileSystem.h b/MailFileSystem.h index 628e7c1..c4c3792 100644 --- a/MailFileSystem.h +++ b/MailFileSystem.h @@ -17,13 +17,17 @@ namespace mail { coreutils::MString getMailBoxPath(coreutils::ZString &mailbox); std::vector getAliasMailboxes(coreutils::ZString &alias); coreutils::ZString& getMailPath(); + coreutils::ZString& getQueuePath(); private: coreutils::ZString &mailPath; + coreutils::MString queuePath; struct stat statbuf; }; + + } #endif diff --git a/SMTPCommand.h b/SMTPCommand.h index e124336..88d5999 100644 --- a/SMTPCommand.h +++ b/SMTPCommand.h @@ -9,17 +9,17 @@ namespace mail { class SMTPServer; - + class SMTPCommand : public core::Command { - + public: virtual int processCommand(coreutils::ZString &request, core::TCPSession &session); virtual int processCommand(coreutils::ZString &request, SMTPSession &session, SMTPServer &server); void grabInput(SMTPSession &session); void clearGrab(SMTPSession &session); - + }; - + } #endif diff --git a/SMTPServer.h b/SMTPServer.h index 4f88293..cce282d 100644 --- a/SMTPServer.h +++ b/SMTPServer.h @@ -2,6 +2,8 @@ # define __SMTPServer_h__ # include +# include +# include # include "EPoll.h" # include "TCPServer.h" # include "SMTPSession.h" @@ -18,14 +20,15 @@ # include "__SMTP_VRFY.h" # include "INotify.h" # include "Log.h" +# include "SendMail.h" namespace mail { - + class SMTPServer : public core::TCPServer, public core::INotify { - + public: - SMTPServer(core::EPoll &ePoll, std::string hostName, MailFileSystem &mailFileSystem, core::IPAddress ipAddress) - : core::TCPServer(ePoll, ipAddress, " ", 1, "SMTP Server"), core::INotify(ePoll), hostName(hostName), mailFileSystem(mailFileSystem) { + SMTPServer(core::EPoll &ePoll, std::string hostName, MailFileSystem &mailFileSystem, core::IPAddress ipAddress) + : core::TCPServer(ePoll, ipAddress, " ", 1, "SMTP Server"), core::INotify(ePoll), ePoll(ePoll), hostName(hostName), mailFileSystem(mailFileSystem) { commands.add(_smtp_auth, "AUTH"); commands.add(_smtp_data, "DATA"); commands.add(_smtp_ehlo, "EHLO"); @@ -37,37 +40,41 @@ namespace mail { commands.add(_smtp_rset, "RSET"); commands.add(_smtp_vrfy, "VRFY"); processExisting(); - wd = addWatch(mailPath + "/.queue/"); - } - + wd = addWatch(mailFileSystem.getQueuePath()); + } + MailFileSystem &mailFileSystem; std::string hostName; - std::string mailPath; - - SMTPSession * getSocketAccept(core::EPoll &ePoll) override { + core::EPoll &ePoll; + + SMTPSession * getSocketAccept(core::EPoll &ePoll) override { return new SMTPSession(ePoll, *this); - } - - void sessionErrorHandler(std::string errorString, std::stringstream &out) { - out << "252 " << errorString << CRLF; } - + + void sessionErrorHandler(std::string errorString, std::stringstream &out) { + out << "252 " << errorString << CRLF; + } + protected: - void inCreate(std::string name) { - int pos = name.find(".") + 10; - std::string mail = name.substr(0, pos); - coreutils::ZString recipient = name.substr(pos); - if(recipient != "") { - coreutils::MString fileName; - fileName << mailPath << "/.queue/" << name; - coreutils::MString path; - path << mailFileSystem.getMailBoxPath(recipient) << "/Inbox/" << mail; - int rc = link(fileName.c_str(), path.c_str()); - rc = unlink(fileName.c_str()); - coreutils::Log(coreutils::LOG_INFO) << "Message " << mail << " delivered to " << recipient << "."; - } + void inCreate(coreutils::ZString &name) { + coreutils::Log(coreutils::LOG_DEBUG_2) << "inCreate; [" << name << "]"; + name.split("|"); + if(name.getList().size() > 1) { + bool exists = mailFileSystem.ifMailBoxExists(name[1]); + coreutils::MString path; + path << mailFileSystem.getMailBoxPath(name[1]) << "/Inbox/" << name[0]; + coreutils::MString from; + from << mailFileSystem.getQueuePath() << "/" << name; + if(exists) { + int rc = link(from.c_str(), path.c_str()); + rc = unlink(from.c_str()); + coreutils::Log(coreutils::LOG_INFO) << "Message " << name[0] << " delivered to recipient " << name[1] << "."; + } else { + mailQueue.emplace_back(SendMail(ePoll, name[1].str(), name[1].str(), from.str())); + } + } } - + private: __SMTP_AUTH _smtp_auth; __SMTP_DATA _smtp_data; @@ -80,11 +87,16 @@ namespace mail { __SMTP_RSET _smtp_rset; __SMTP_VRFY _smtp_vrfy; int wd; - + std::vector mailQueue; + void processExisting() { - + for (const auto & entry : std::filesystem::directory_iterator(mailFileSystem.getQueuePath().str())) { + std::string temp(entry.path().filename().string()); + coreutils::ZString temp2(temp); + inCreate(temp2); + } } - + }; } diff --git a/SMTPSession.cpp b/SMTPSession.cpp index 55913d9..e73a148 100644 --- a/SMTPSession.cpp +++ b/SMTPSession.cpp @@ -1,12 +1,14 @@ # include "SMTPSession.h" +# include "Log.h" namespace mail { - - SMTPSession::SMTPSession(core::EPoll &ePoll, core::TCPServer &server) + + SMTPSession::SMTPSession(core::EPoll &ePoll, core::TCPServer &server) : TCPSession(ePoll, server, "SMTP Client Session") {} void SMTPSession::onConnected() { + coreutils::Log(coreutils::LOG_DEBUG_2) << "onConnected -> sending 220"; out << "220 localhost BMAMail" << CRLF; } - + } diff --git a/SMTPSession.h b/SMTPSession.h index 654a4fa..93e0aa6 100644 --- a/SMTPSession.h +++ b/SMTPSession.h @@ -8,31 +8,31 @@ # define CRLF "\r\n" namespace mail { - - enum State {CONNECT, READY, MAIL, RCPT, DATA}; + + enum State {CONNECT, READY, READYX, MAIL, RCPT, DATA, SENT}; enum AuthState {USER_UNKNOWN, USER_QUERY, USER_SECRET_QUERY, USER_KNOWN}; enum Mode {WAIT_FOR_DATA, RECEIVE_DATA}; - + class SMTPSession : public core::TCPSession { - - public: - SMTPSession(core::EPoll &ePoll, core::TCPServer &server); - + + public: + SMTPSession(core::EPoll &ePoll, core::TCPServer &server); + void onConnected() override; - + coreutils::MString clientDomainName; coreutils::MString userName; - coreutils::MString password; - std::stringstream mailData; + coreutils::MString password; + coreutils::MString mailData; State state = CONNECT; - AuthState authState = USER_UNKNOWN; + AuthState authState = USER_UNKNOWN; Mode mode = WAIT_FOR_DATA; - bool relay = false; - coreutils::MString sender; + bool relay = true; + coreutils::MString from; std::vector recipientList; - + }; - + } #endif diff --git a/SendMail.cpp b/SendMail.cpp new file mode 100644 index 0000000..67a3baf --- /dev/null +++ b/SendMail.cpp @@ -0,0 +1,100 @@ +#include "SendMail.h" +#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), + mailData(mailFileName), Timer(ePoll, 0.00f), ePoll(ePoll) { + + core::IPAddress mxAddress("127.0.0.1", 9025); + + connect(mxAddress); + ePoll.registerSocket((TCPSession2 *)(this)); + + coreutils::Log(coreutils::LOG_DEBUG_1) << "SendMail initiated..."; + + } + + 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 " << from << 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 new file mode 100644 index 0000000..9fd0b75 --- /dev/null +++ b/SendMail.h @@ -0,0 +1,43 @@ +#ifndef __SendMail_h__ +#define __SendMail_h__ + +#include "EPoll.h" +#include "SMTPSession.h" +#include "TCPSession2.h" +#include "MString.h" +#include "Timer.h" + +#define CRLF "\r\n" + +namespace mail { + + class SendMail : public core::TCPSession2, private core::Timer { + + public: + SendMail(core::EPoll &ePoll, std::string from, std::string recipient, std::string mailFileName); + ~SendMail(); + coreutils::MString& send(); + + void protocol(coreutils::ZString &data) override; + + private: + std::vector& extractRecipientList(); + void onTimeout() override; + + core::EPoll &ePoll; + + coreutils::File mailData; + coreutils::MString from; + coreutils::MString recipient; + coreutils::MString mailFileName; + coreutils::MString buffer; + std::vector recipientList; + + State state = CONNECT; + State stateOnTimeout = CONNECT; + + }; + +} + +#endif diff --git a/__SMTP_AUTH.cpp b/__SMTP_AUTH.cpp index 540ef63..4e2b590 100644 --- a/__SMTP_AUTH.cpp +++ b/__SMTP_AUTH.cpp @@ -3,55 +3,55 @@ #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; + if(request[1].equals("LOGIN")) { + session.out << "334 VXNlcm5hbWU6" << CRLF; // setTimer(10.0f); - session.authState = USER_QUERY; - grabInput(session); - } - else { - session.out << "504 AUTH method not supported." << CRLF; - } - return 1; - + session.authState = USER_QUERY; + grabInput(session); + } + else { + session.out << "504 AUTH method not supported." << CRLF; + } + return 1; + case USER_QUERY: - session.userName = request[0]; + session.userName = request[0]; // setTimer(0.0f); - session.out << "334 UGFzc3dvcmQ6" << CRLF; + session.out << "334 UGFzc3dvcmQ6" << CRLF; // setTimer(10.0f); - session.authState = USER_SECRET_QUERY; - return 1; - + session.authState = USER_SECRET_QUERY; + return 1; + case USER_SECRET_QUERY: - session.password = request[0]; + session.password = request[0]; // setTimer(0.0f); - coreutils::Base64 base64; - if(authLogin(session.userName, session.password, server)) { - session.out << "235 2.7.0 Authentication successful" << CRLF; - session.relay = true; - session.authState = USER_KNOWN; - clearGrab(session); - } - else { - session.out << "530 Login was unsuccessful." << CRLF; - } - return 1; + coreutils::Base64 base64; + if(authLogin(session.userName, session.password, server)) { + session.out << "235 2.7.0 Authentication successful" << CRLF; + session.relay = true; + session.authState = USER_KNOWN; + clearGrab(session); + } + else { + session.out << "530 Login was unsuccessful." << CRLF; + } + return 1; } return 0; } - + bool __SMTP_AUTH::authLogin(coreutils::ZString &userName, coreutils::ZString &password, SMTPServer &server) { coreutils::MString secretPath; - secretPath << server.mailFileSystem.getMailBoxPath(userName) << "/.password"; + secretPath << server.mailFileSystem.getMailBoxPath(userName) << "/.password"; coreutils::File secret(secretPath); secret.read(); return password == secret.asString(); } - + } diff --git a/__SMTP_DATA.cpp b/__SMTP_DATA.cpp index c2b83a3..947b593 100644 --- a/__SMTP_DATA.cpp +++ b/__SMTP_DATA.cpp @@ -16,7 +16,7 @@ namespace mail { case RCPT: session.out << "354 Enter the mail message terminated by ." << CRLF; - session.mailData.str(""); + session.mailData = ""; session.mode = RECEIVE_DATA; grabInput(session); // session.setTimer(120.0f); @@ -34,16 +34,17 @@ namespace mail { break; case RECEIVE_DATA: - if(request != ".") + if(request != ".") { session.mailData << request << CRLF; + } else { session.mode = WAIT_FOR_DATA; session.state = READY; clearGrab(session); // if(filterMessage(session.mailData)) { if(session.recipientList.size() > 0) { - if(session.mailData.str().size() > 0) { - coreutils::MString ID = queueMail(server, session.sender, session.recipientList, session.mailData); + if(session.mailData.getLength() > 0) { + coreutils::MString ID = queueMail(server, session.from, session.recipientList, session.mailData); if(ID != "") { coreutils::Log(coreutils::LOG_INFO) << "Queued message " << ID << "."; session.out << "250 OK Queued message " << ID << CRLF; @@ -57,7 +58,7 @@ namespace mail { // } else // data << "550 Message is probably spam" << CRLF; } - break; + break; } return 1; } @@ -73,15 +74,16 @@ namespace mail { coreutils::MString __SMTP_DATA::queueMail(SMTPServer &server, coreutils::MString &sender, std::vector &recipientList, - std::stringstream &mailData) { + coreutils::MString &mailData) { coreutils::MString fileName; - fileName << server.mailFileSystem.getMailPath() << "/.queue/" << generateMailFileName(); + fileName << server.mailFileSystem.getMailPath() << "/.queue/" << generateMailFileName(); coreutils::File mailFile(fileName, O_CREAT | O_WRONLY, 0660); - mailFile.write(mailData.str()); + mailFile.write(mailData); for(coreutils::MString recipient: recipientList) { - coreutils::MString newName(fileName.write(recipient)); - link(fileName.c_str(), newName.c_str()); + coreutils::MString newName; + newName << fileName << "|" << recipient; + link(fileName.c_str(), newName.c_str()); } unlink(fileName.c_str()); diff --git a/__SMTP_DATA.h b/__SMTP_DATA.h index 4c15964..b02a1d8 100644 --- a/__SMTP_DATA.h +++ b/__SMTP_DATA.h @@ -13,7 +13,7 @@ namespace mail { int processCommand(coreutils::ZString &request, SMTPSession &session, SMTPServer &server) override; coreutils::MString generateMailFileName(); - coreutils::MString queueMail(SMTPServer &server, coreutils::MString &sender, std::vector &recipientList, std::stringstream &mailData); + coreutils::MString queueMail(SMTPServer &server, coreutils::MString &sender, std::vector &recipientList, coreutils::MString &mailData); }; diff --git a/__SMTP_EHLO.cpp b/__SMTP_EHLO.cpp index 91e9f4c..b73e0c7 100644 --- a/__SMTP_EHLO.cpp +++ b/__SMTP_EHLO.cpp @@ -2,11 +2,11 @@ #include "SMTPServer.h" namespace mail { - + int __SMTP_EHLO::processCommand(coreutils::ZString &request, SMTPSession &session, SMTPServer &server) { session.clientDomainName = request[1]; - std::cout << "{" << session.clientDomainName << "}" << std::endl; +// std::cout << "{" << session.clientDomainName << "}" << std::endl; session.out << "250-" << server.hostName << CRLF; // cout << "250-STARTTLS" << CRLF; // cout << "250-PIPELINING" << CRLF; @@ -16,5 +16,5 @@ namespace mail { session.state = READY; return 1; } - + } diff --git a/__SMTP_MAIL.cpp b/__SMTP_MAIL.cpp index 656fe83..fd3a461 100644 --- a/__SMTP_MAIL.cpp +++ b/__SMTP_MAIL.cpp @@ -7,7 +7,7 @@ namespace mail { if(request[1].ifNext("FROM:")) { request[1].skipWhitespace(); if(request[1].ifNext("<")) { - session.sender = request[1].getTokenExclude(">"); + session.from = request[1].getTokenExclude(">"); if(session.authState = USER_KNOWN) { session.out << "250 OK" << CRLF; session.recipientList.clear(); @@ -20,11 +20,11 @@ namespace mail { return 1; } - std::string domainOnly(std::string email) { - coreutils::ZString split(email); - split.split("@"); - return split[1].str(); - } +// std::string domainOnly(std::string email) { +// coreutils::ZString split(email); +// split.split("@"); +// return split[1].str(); +// } } diff --git a/__SMTP_RCPT.cpp b/__SMTP_RCPT.cpp index dee9282..eb654f8 100644 --- a/__SMTP_RCPT.cpp +++ b/__SMTP_RCPT.cpp @@ -2,39 +2,30 @@ # include "SMTPServer.h" namespace mail { - - int __SMTP_RCPT::processCommand(coreutils::ZString &request, SMTPSession &session, SMTPServer &server) { - std::cout << "001" << std::endl; + + int __SMTP_RCPT::processCommand(coreutils::ZString &request, SMTPSession &session, SMTPServer &server) { if((session.state == MAIL) || (session.state == RCPT)) { - std::cout << "002" << std::endl; - if(request[1].ifNext("TO:")) { - std::cout << "003" << std::endl; + if(request[1].ifNext("TO:")) { request[1].skipWhitespace(); if(request[1].ifNext("<")) { - std::cout << "004" << std::endl; coreutils::MString recipient(request[1].getTokenExclude(">")); - if(server.mailFileSystem.ifMailBoxExists(recipient)) { - std::cout << "005" << std::endl; - session.recipientList.push_back(recipient); - std::cout << "006" << std::endl; - session.out << "250 OK" << CRLF; - std::cout << "007" << std::endl; - session.state = RCPT; - std::cout << "008" << std::endl; - } else if(session.relay) { + if(server.mailFileSystem.ifMailBoxExists(recipient)) { session.recipientList.push_back(recipient); session.out << "250 OK" << CRLF; - session.state = RCPT; - } else - session.out << "550 Mailbox does not exist" << CRLF; + session.state = RCPT; + } else if(session.relay) { + session.recipientList.push_back(recipient); + session.out << "250 OK" << CRLF; + session.state = RCPT; + } else + session.out << "550 Mailbox does not exist" << CRLF; } else session.out << "550 Usage: RCPT TO:" << CRLF; } else - session.out << "550 Usage: RCPT TO:" << CRLF; - } else + session.out << "550 Usage: RCPT TO:" << CRLF; + } else session.out << "503 Please use MAIL first" << CRLF; - std::cout << "009" << std::endl; return 1; } - + } diff --git a/compile b/compile index 387b4b8..0de8114 100755 --- a/compile +++ b/compile @@ -5,7 +5,7 @@ do filename="${file%.*}" list="$list $filename.o" echo -n "Compiling $filename..." - g++ -g -c -std=c++17 -I../CoreUtils -I../ServerCore $file + g++ -g -c -std=c++17 -I../CoreUtils -I../ServerCore $file & if [ $? = '0' ] then echo "OK" diff --git a/error.log b/error.log new file mode 100644 index 0000000..4b22b31 --- /dev/null +++ b/error.log @@ -0,0 +1,1207 @@ +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 94be211..3001834 100644 --- a/main.cpp +++ b/main.cpp @@ -24,15 +24,16 @@ int main(int argc, char **argv) { mail::MailFileSystem mailFileSystem(mailPath); core::EPoll ePoll; + ePoll.start(2, 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"); - ePoll.start(2, 1000); + consoleServer.commands.add(smtpServer.commands, "smtp"); while(true) - sleep(300); + sleep(3600); ePoll.stop(); diff --git a/scripts/makemaildir b/scripts/makemaildir new file mode 100755 index 0000000..1b2b221 --- /dev/null +++ b/scripts/makemaildir @@ -0,0 +1,17 @@ +#!/bin/bash +cd /var/mail +mkdir .queue +mkdir barant.com +cd barant.com +mkdir barant +mkdir brad.arant +cd barant +mkdir Inbox +mkdir Sent +mdkdir Trash +mkdir Spam +cd ../brad.arant +mkdir Inbox +mkdir Sent +mdkdir Trash +mkdir Spam diff --git a/tests/submitmailtest b/tests/submitmailtest index 020dc49..dccc7a5 100755 --- a/tests/submitmailtest +++ b/tests/submitmailtest @@ -3,14 +3,10 @@ rm -rf /var/mail/.queue/* rm -rf /var/mail/barant.com/brad.arant/Inbox/* rm -rf /var/mail/barant.com/barant/Inbox/* -./testsmtp & -./testsmtp & -./testsmtp & -./testsmtp & -./testsmtp & -./testsmtp & -./testsmtp & -./testsmtp & -./testsmtp & -./testsmtp & +for count in {1..256}; +do + echo $count + ./testsmtp & +sleep .005 +done wait diff --git a/tests/testsmtp b/tests/testsmtp index 1d4f06b..6a154f5 100755 --- a/tests/testsmtp +++ b/tests/testsmtp @@ -1,17 +1,16 @@ #!/bin/bash -nc localhost 9025 > /dev/null << EOL +nc localhost 9025 > /dev/null << EOL EHLO barant.com MAIL FROM: -RCPT TO: +RCPT TO: +RCPT TO: DATA From: barant@barant.com To: barant@barant.com Subject: test email system This is a test - . - QUIT EOL