|
|
#endif | #endif |
#include <stdio.h> | #include <stdio.h> |
#include <stdlib.h> | #include <stdlib.h> |
|
#include <sysexits.h> |
| |
#include "client.h" | #include "client.h" |
#include "dspam.h" | #include "dspam.h" |
|
|
code = client_getcode(&TTX, err, sizeof(err)); | code = client_getcode(&TTX, err, sizeof(err)); |
if (code < 200 || code >= 300) { | if (code < 200 || code >= 300) { |
LOG(LOG_ERR, ERR_CLIENT_RESPONSE, code, "message data", err); | LOG(LOG_ERR, ERR_CLIENT_RESPONSE, code, "message data", err); |
|
if (code >= 400 && code < 500) |
|
exitcode = EX_TEMPFAIL; |
if (code >= 500) | if (code >= 500) |
exitcode = EINVAL; | exitcode = EINVAL; |
chomp(err); | chomp(err); |
|
|
QUIT: | QUIT: |
send_socket(&TTX, "QUIT"); | send_socket(&TTX, "QUIT"); |
client_getcode(&TTX, err, sizeof(err)); | client_getcode(&TTX, err, sizeof(err)); |
|
buffer_destroy(TTX.packet_buffer); |
|
close(TTX.sockfd); |
|
return exitcode; |
| |
BAIL: | BAIL: |
LOG(LOG_ERR, ERR_CLIENT_DELIVERY_FAILED); | LOG(LOG_ERR, ERR_CLIENT_DELIVERY_FAILED); |