00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
#ifdef _WIN32
00021
#pragma warning(disable:4786)
00022
#endif
00023
00024
00025
#ifdef _WIN32
00026
#define strcasecmp stricmp
00027
#endif
00028
00029
#include "socket_include.h"
00030
#include "SocketHandler.h"
00031
#include "Parse.h"
00032
#include "SMTPSocket.h"
00033
#include "FwdSocket.h"
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049 #define DEB(x)
00050
00051
00052 FwdSocket::FwdSocket(SocketHandler& h)
00053 :TcpSocket(h)
00054 ,m_remote(NULL)
00055 {
00056 SetLineProtocol();
00057 }
00058
00059
00060 FwdSocket::~FwdSocket()
00061 {
00062
if (
m_remote && Handler().Valid(
m_remote) )
00063 {
00064
00065 }
00066 }
00067
00068
00069 void FwdSocket::OnLine(
const std::string& line)
00070 {
00071 Parse pa(line,
"-");
00072
long status = pa.getvalue();
00073
if (status == 550)
00074 {
00075
if (
m_remote && Handler().Valid(
m_remote) )
00076 {
00077
m_remote -> SetFake();
00078 }
00079
m_remote -> Send(
"250 Ok\r\n");
00080 SetCloseAndDelete();
00081 }
00082
else
00083
if (status != 250)
00084 {
00085 printf(
"<%s\n",line.c_str());
00086 }
00087
if (
m_remote && Handler().Valid(
m_remote) )
00088 {
00089
m_remote -> Send(line +
"\r\n");
00090 }
00091 }
00092
00093
00094 void FwdSocket::OnDelete()
00095 {
00096
if (
m_remote && Handler().Valid(
m_remote) )
00097 {
00098
00099 }
00100 }
00101
00102