diff --git a/BMAMail b/BMAMail index 1153a68..e3871ae 100755 Binary files a/BMAMail and b/BMAMail differ diff --git a/__SMTP_DATA.cpp b/__SMTP_DATA.cpp index cd0d41a..c2b83a3 100644 --- a/__SMTP_DATA.cpp +++ b/__SMTP_DATA.cpp @@ -70,7 +70,10 @@ namespace mail { return coreutils::MString(temp.str()); } - coreutils::MString __SMTP_DATA::queueMail(SMTPServer &server, coreutils::MString &sender, std::vector &recipientList, std::stringstream &mailData) { + coreutils::MString __SMTP_DATA::queueMail(SMTPServer &server, + coreutils::MString &sender, + std::vector &recipientList, + std::stringstream &mailData) { coreutils::MString fileName; fileName << server.mailFileSystem.getMailPath() << "/.queue/" << generateMailFileName(); coreutils::File mailFile(fileName, O_CREAT | O_WRONLY, 0660); diff --git a/main.cpp b/main.cpp index cc59fb6..94be211 100644 --- a/main.cpp +++ b/main.cpp @@ -11,9 +11,9 @@ #include "IMAPServer.h" int main(int argc, char **argv) { - + try { - + coreutils::Log(new coreutils::File("/var/log/mail.log", O_WRONLY | O_APPEND | O_CREAT, 0644)); coreutils::Log(coreutils::LOG_INFO) << "BMAMail Server starting. Build " << __DATE__ << " " << __TIME__; @@ -22,24 +22,24 @@ int main(int argc, char **argv) { coreutils::ZString mailPath("/var/mail"); mail::MailFileSystem mailFileSystem(mailPath); - - core::EPoll ePoll; - mail::SMTPServer smtpServer(ePoll, hostName, mailFileSystem, core::IPAddress(ipAddress, 25)); - mail::POP3Server pop3Server(ePoll, hostName, mailFileSystem, core::IPAddress(ipAddress, 110)); - mail::IMAPServer imapServer(ePoll, hostName, mailFileSystem, core::IPAddress(ipAddress, 143)); + + core::EPoll ePoll; + 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); - + while(true) sleep(300); - + ePoll.stop(); - + } - + catch(coreutils::Exception exception) { std::cout << exception.text << " Error reason is '" << strerror(exception.errorNumber) << "' in file " << exception.file << " at line " << exception.line << std::endl; } - + } diff --git a/tests/testsmtp b/tests/testsmtp index 7c90566..1d4f06b 100755 --- a/tests/testsmtp +++ b/tests/testsmtp @@ -1,8 +1,17 @@ #!/bin/bash -nc localhost 25 > /dev/null << EOL +nc localhost 9025 > /dev/null << EOL EHLO barant.com MAIL FROM: RCPT TO: +DATA +From: barant@barant.com +To: barant@barant.com +Subject: test email system + +This is a test + +. + QUIT EOL