276 |
*******************/ |
*******************/ |
277 |
|
|
278 |
void |
void |
279 |
smtp_session() |
smtp_session_transparent() |
280 |
{ |
{ |
281 |
char command[LINEBUFFER+1]; |
char command[LINEBUFFER+1]; |
282 |
MESSAGE msg; |
MESSAGE msg; |
318 |
|
|
319 |
message_init(&msg); |
message_init(&msg); |
320 |
while (recvline(SERVER, remote_client, command, sizeof(command) - 1)) { |
while (recvline(SERVER, remote_client, command, sizeof(command) - 1)) { |
321 |
|
if (process_command(&msg, command)) |
322 |
|
continue; |
323 |
|
|
324 |
|
if (topt & T_ERROR) |
325 |
|
break; |
326 |
|
|
327 |
|
if (transfer_command(&msg, command) == 0) |
328 |
|
break; |
329 |
|
} |
330 |
|
|
331 |
|
message_free(&msg); |
332 |
|
return; |
333 |
|
} |
334 |
|
|
335 |
|
void |
336 |
|
smtp_begin () |
337 |
|
{ |
338 |
|
char command[LINEBUFFER+1]; |
339 |
|
|
340 |
|
get_response_smtp(CLIENT, remote_server, command, sizeof(command) - 1); |
341 |
|
snprintf(command, sizeof command, "EHLO %s" CRLF, get_localdomain()); |
342 |
|
swrite(CLIENT, remote_server, command); |
343 |
|
/* FIXME: Eventually start TLS and/or authenticate to the |
344 |
|
remote */ |
345 |
|
get_response_smtp(CLIENT, remote_server, command, sizeof(command) - 1); |
346 |
|
} |
347 |
|
|
348 |
|
void |
349 |
|
smtp_session() |
350 |
|
{ |
351 |
|
char command[LINEBUFFER+1]; |
352 |
|
MESSAGE msg; |
353 |
|
|
354 |
|
info(VERBOSE, _("Starting SMTP session...")); |
355 |
|
smtp_begin (); |
356 |
|
info(VERBOSE, _("Transferring message(s)...")); |
357 |
|
|
358 |
|
message_init(&msg); |
359 |
|
while (recvline(SERVER, remote_client, command, sizeof(command) - 1)) { |
360 |
if (process_command(&msg, command)) |
if (process_command(&msg, command)) |
361 |
continue; |
continue; |
362 |
|
|