Annotation of parser3/src/classes/smtp/smtp.h, revision 1.11.2.4

1.1       paf         1: /** @file
                      2:        Parser: SMTP sender decl.
                      3: 
1.11.2.1  paf         4:        Copyright (c) 2001-2003 ArtLebedev Group (http://www.artlebedev.com)
1.8       paf         5:        Author: Alexandr Petrosian <paf@design.ru> (http://paf.design.ru)
1.9       paf         6: */
1.1       paf         7: 
1.11.2.4! paf         8: static const char* IDENT_SMTP_H="$Date: 2003/02/06 16:05:23 $";
1.1       paf         9: 
                     10: #include "pa_pool.h"
                     11: #include "pa_string.h"
1.6       paf        12: 
                     13: #include <winsock.h>
1.1       paf        14: 
                     15: //////////////////////////////////////////////////////////////////////////////
                     16: 
                     17: #define SOCKET_BUFFER_SIZE     512
                     18: 
                     19: #define ERR_SENDING_DATA               4002
                     20: #define ERR_NOT_A_SOCKET               4010
                     21: #define ERR_CLOSING                    4012
                     22: #define WAIT_A_BIT                     4013
                     23: 
                     24: #define MAXOUTLINE 255
                     25: 
                     26: //////////////////////////////////////////////////////////////////////////////
                     27: 
1.3       paf        28: /// SIMPLE MAIL TRANSPORT PROTOCOL Win32 realization
1.11.2.2  paf        29: class SMTP: public PA_Object {
1.1       paf        30:     char            *in_buffer;
                     31:     char            *out_buffer;
                     32:     unsigned int       in_index;
                     33:     unsigned int       out_index;
                     34:     unsigned int       in_buffer_total;
                     35:     unsigned int       out_buffer_total;
                     36:     unsigned int       last_winsock_error;
                     37:     fd_set             fds;
                     38:     struct timeval     timeout;
                     39: 
                     40:     SOCKET     the_socket;
                     41: 
                     42:        char    my_hostname[1024];
                     43: 
                     44:     CHAR    ServerProtocol[100];
                     45:     CHAR    RemoteAddress[100];
                     46:     CHAR    RemoteHost[100];
                     47:     CHAR    RemoteUser[100];
                     48:     CHAR    HttpAccept[100];
                     49:     CHAR    HttpUserAgent[256];
                     50: 
                     51:     CHAR    FirstName[100];
                     52:     CHAR    LastName[100];
                     53:     CHAR    WebUse[100];
                     54:     CHAR    EMail[100];
                     55:     CHAR    HomePage[100];
                     56:     CHAR    text[500];
                     57: 
1.11.2.2  paf        58:        StringPtr origin_string;
1.1       paf        59: 
                     60: public:
1.11.2.2  paf        61:        SMTP(StringPtr aorigin_string);
1.11.2.4! paf        62:        override ~SMTP();
1.1       paf        63: 
                     64:     // smtp.C
1.11.2.1  paf        65:        void    Send(const char* , const char* , const char* ,  char *, char *);
1.1       paf        66:        BOOL    MakeSmtpHeader(char *, char *, char *, char *);
1.11.2.1  paf        67:        void    prepare_message(char *, char *,  const char* , const char* );
                     68:        void    open_socket(const char* , const char* );
1.1       paf        69:        int             get_line(void);
1.11.2.1  paf        70:        void    SendSmtpError(const char* );
                     71:        void    transform_and_send_edit_data(const char* );
                     72:        void    send_data(const char* );
                     73:        void    ConnectToHost(const char* , const char* );
1.1       paf        74:        int             GetBuffer(int);
                     75:        int             GetChar(int, char *);
1.11.2.1  paf        76:        void    SendLine(const char* , unsigned long);
                     77:        void    SendBuffer(const char* , unsigned long);
1.1       paf        78:        void    FlushBuffer();
                     79:        BOOL    CloseConnect();
                     80: 
                     81:     // comms.C
1.11.2.1  paf        82:     int      IsAddressARawIpaddress(const char* );
                     83:     int      ResolveService(const char* , int *);
                     84:     int      ResolveHostname(const char* , struct sockaddr_in *);
1.1       paf        85:     int      GetAndSetTheSocket(SOCKET *);
                     86:     int      GetConnection(SOCKET, struct sockaddr_in *);
                     87:     void     MiscSocketSetup(SOCKET, fd_set *, struct timeval *);
                     88: };
                     89: 
1.11.2.3  paf        90: DECLARE_OBJECT_PTR(SMTP);

E-mail: