From 04977e4a8df1ca6993d749f914c94980708e0217 Mon Sep 17 00:00:00 2001 From: Pixel Date: Thu, 9 Oct 2008 14:54:32 -0700 Subject: Finishing creating the first version of LuaSmtp and the associate MailServer classes. --- include/LuaSmtp.h | 37 +++++++++++++++++++++++++++++++++++++ include/MailServer.h | 14 +++++++++----- 2 files changed, 46 insertions(+), 5 deletions(-) create mode 100644 include/LuaSmtp.h (limited to 'include') diff --git a/include/LuaSmtp.h b/include/LuaSmtp.h new file mode 100644 index 0000000..93a9435 --- /dev/null +++ b/include/LuaSmtp.h @@ -0,0 +1,37 @@ +/* + * Baltisot + * Copyright (C) 1999-2008 Nicolas "Pixel" Noble + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef __LUASMTP_H__ +#define __LUASMTP_H__ + +#include + +class LuaMailHandler; + +class LuaLuaMailHandler : public LuaObject { + public: + static void pushstatics(Lua *) throw (GeneralException); + LuaLuaMailHandler(LuaMailHandler *); + protected: + virtual void pushmembers(Lua *); + LuaMailHandler * mh; +}; + + +#endif diff --git a/include/MailServer.h b/include/MailServer.h index e39ad93..296ba50 100644 --- a/include/MailServer.h +++ b/include/MailServer.h @@ -30,14 +30,19 @@ class MailHandler : public Base { public: - MailHandler() {} - virtual ~MailHandler() {} - virtual void ProcessMail(Handle * in, const String & from, std::vector tos) = 0; + MailHandler(); + virtual ~MailHandler(); + virtual bool doProcessMail(Handle * in, const String & from, std::vector tos) = 0; + static bool ProcessMail(Handle * in, const String & from, std::vector tos); + void OnTop(); + private: + static MailHandler * head; + MailHandler * next, * prev; }; class MailServer : public Task { public: - MailServer(MailHandler *, int = 2500, const String & = String("GruiK Server v0.2")) throw (GeneralException); + MailServer(int = 2500, const String & = String("GruiK Server v0.2")) throw (GeneralException); virtual ~MailServer(); virtual String GetName(); @@ -48,7 +53,6 @@ class MailServer : public Task { Socket Listener; String name; int localport; - MailHandler * handler; }; #endif -- cgit v1.2.3