Rev 3444 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 3444 | Rev 4139 | ||
---|---|---|---|
Line 8... | Line 8... | ||
8 | #include "..\lib\dll.h" |
8 | #include "..\lib\dll.h" |
9 | #include "..\lib\encoding.h" |
9 | #include "..\lib\encoding.h" |
10 | #include "..\lib\figures.h" |
10 | #include "..\lib\figures.h" |
11 | #include "..\lib\file_system.h" |
11 | #include "..\lib\file_system.h" |
12 | #include "..\lib\list_box.h" |
12 | #include "..\lib\list_box.h" |
13 | #include "..\lib\socket.h" |
13 | #include "..\lib\socket_new.h" |
14 | //*.obj libraries |
14 | //*.obj libraries |
15 | #include "..\lib\lib.obj\box_lib.h" |
15 | #include "..\lib\lib.obj\box_lib.h" |
16 | #include "..\lib\lib.obj\network.h" |
16 | #include "..\lib\lib.obj\network.h" |
17 | #include "..\lib\lib.obj\libio_lib.h" |
17 | #include "..\lib\lib.obj\libio_lib.h" |
18 | #include "..\lib\lib.obj\libimg_lib.h" |
18 | #include "..\lib\lib.obj\libimg_lib.h" |
Line 22... | Line 22... | ||
22 | byte in_out_mail[18*36] = FROM "in_out_mail.raw"; |
22 | byte in_out_mail[18*36] = FROM "in_out_mail.raw"; |
Line 23... | Line 23... | ||
23 | 23 | ||
24 | //connection algorithm |
24 | //connection algorithm |
25 | enum { |
25 | enum { |
26 | STOP, |
- | |
27 | GET_PORT, |
- | |
28 | GET_SERVER_IP, |
26 | STOP, |
29 | GET_SOCKET, |
27 | RESOLVE, |
30 | CONNECT, |
28 | OPEN_CONNECTION, |
31 | GET_ANSWER_CONNECT, |
29 | GET_ANSWER_CONNECT, |
32 | SEND_USER, |
30 | SEND_USER, |
33 | GET_ANSWER_USER, |
31 | GET_ANSWER_USER, |
34 | SEND_PASS, |
32 | SEND_PASS, |
35 | GET_ANSWER_PASS, |
33 | GET_ANSWER_PASS, |
36 | SEND_NLIST, |
34 | SEND_NLIST, |
37 | GET_ANSWER_NLIST, |
35 | GET_ANSWER_NLIST, |
38 | SEND_NSTAT, |
36 | SEND_NSTAT, |
39 | GET_ANSWER_NSTAT, |
37 | GET_ANSWER_NSTAT, |
40 | SEND_RETR, |
38 | SEND_RETR, |
- | 39 | GET_ANSWER_RETR, |
|
41 | GET_ANSWER_RETR |
40 | FAILED |
Line 42... | Line 41... | ||
42 | }; |
41 | }; |
43 | 42 | ||
44 | //WindowDefinitions |
43 | //WindowDefinitions |
45 | #define WIN_W 600 |
44 | #define WIN_W 600 |
46 | #define WIN_H 440 |
45 | #define WIN_H 440 |
47 | #define WIN_MIN_W 500 |
46 | #define WIN_MIN_W 500 |
48 | #define WIN_MIN_H 380 |
47 | #define WIN_MIN_H 380 |
49 | #define LOGIN_HEADER "Login - Email client Liza 0.8a" |
48 | #define LOGIN_HEADER "Login - Email client Liza 0.9" |
- | 49 | #define OPTIONS_HEADER "Options - Email client Liza 0.9" |
|
50 | #define OPTIONS_HEADER "Options - Email client Liza 0.8a" |
50 | #define MAILBOX_HEADER "Mail Box - Email client Liza 0.9" |
51 | #define MAILBOX_HEADER "Mail Box - Email client Liza 0.8a" |
51 | #define BUFFERSIZE 512 |
52 | proc_info Form; |
52 | proc_info Form; |
Line 53... | Line 53... | ||
53 | system_colors sc; |
53 | system_colors sc; |
54 | #define LBUMP 0xFFFfff |
54 | #define LBUMP 0xFFFfff |
55 | 55 | ||
Line 56... | Line 56... | ||
56 | //progress_bar definitions |
56 | //progress_bar definitions |
57 | char cur_st_percent; |
57 | char cur_st_percent; |
58 | dword cur_st_text; |
- | |
59 | 58 | dword cur_st_text; |
|
60 | //connection data |
- | |
61 | #define DEFAULT_POP_PORT 110; |
59 | |
62 | dword local_port=1000; |
60 | //connection data |
63 | char POP_server_path[128]; |
61 | #define DEFAULT_POP_PORT 110; |
64 | dword POP_server_IP; |
62 | char POP_server_path[128]; |
65 | dword POP_server_port; |
63 | dword POP_server_port; |
66 | char login[128]; |
64 | char login[128]; |
- | 65 | char request[256+22]; |
|
- | 66 | int request_len; |
|
Line 67... | Line 67... | ||
67 | char request[256+22]; |
67 | char connection_status; |
68 | int request_len; |
68 | dword socketnum; |
Line 69... | Line -... | ||
69 | char connection_status; |
- | |
70 | dword socket; |
69 | |
71 | - | ||
72 | int aim; |
- | |
73 | int ticks; |
- | |
74 | - | ||
75 | //global data for server response |
- | |
76 | char immbuffer[512]; |
- | |
77 | int immpointer; |
- | |
78 | - | ||
79 | void immfree(){ |
- | |
80 | immpointer=0; |
- | |
81 | immbuffer[immpointer]='\0'; |
- | |
82 | } |
- | |
83 | - | ||
Line 84... | Line 70... | ||
84 | void immputc(char agot_char){ |
70 | sockaddr_in sockaddr; |
85 | immbuffer[immpointer]=agot_char; |
71 | |
86 | immpointer++; |
72 | int aim; |
87 | immbuffer[immpointer]='\0'; |
73 | int ticks; |
Line 125... | Line 111... | ||
125 | { |
111 | { |
126 | char read_data[512], pass_b64[256]; |
112 | char read_data[512], pass_b64[256]; |
127 | ReadFile(0, 512, #read_data, "/sys/network/mail.dat"); |
113 | ReadFile(0, 512, #read_data, "/sys/network/mail.dat"); |
128 | if (!read_data) |
114 | if (!read_data) |
129 | { |
115 | { |
130 | //strcpy(#email_text, "eiroglif@yandex.ru"); //temporarily, for testing |
- | |
131 | strcpy(#email_text, "example@mail.com"); |
116 | strcpy(#email_text, "example@mail.com"); |
132 | //strcpy(#pass_text, "rostov"); |
- | |
133 | } |
117 | } |
134 | else |
118 | else |
135 | { |
119 | { |
136 | strcpy(#pass_b64, #read_data+strchr(#read_data, '\n')+1); |
120 | strcpy(#pass_b64, #read_data+strchr(#read_data, '\n')+1); |
137 | base64_decode stdcall (#pass_b64, #pass_text, strlen(#pass_b64)); |
121 | base64_decode stdcall (#pass_b64, #pass_text, strlen(#pass_b64)); |
Line 145... | Line 129... | ||
145 | 129 | ||
146 | 130 | ||
147 | void SaveAndExit() |
131 | void SaveAndExit() |
148 | { |
132 | { |
149 | char write_data[512], pass_b64[256]; |
133 | char write_data[512], pass_b64[256]; |
150 | CloseSocket(socket); |
134 | Close(socketnum); |
151 | strcpy(#write_data, #email_text); |
135 | strcpy(#write_data, #email_text); |
152 | strcat(#write_data, "\n"); |
136 | strcat(#write_data, "\n"); |
153 | base64_encode stdcall (#pass_text, #pass_b64, strlen(#pass_text)); |
137 | base64_encode stdcall (#pass_text, #pass_b64, strlen(#pass_text)); |