Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix codewarnings #54

Merged
merged 2 commits into from
Jul 17, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 14 additions & 11 deletions smf-spf.c
Original file line number Diff line number Diff line change
Expand Up @@ -793,7 +793,7 @@ static sfsistat smf_envfrom(SMFICTX *ctx, char **args) {
if ((status == SPF_RESULT_NONE) || (status == SPF_RESULT_INVALID)) {
if (conf.refuse_none && !strstr(context->from, "<>")) {
char reject[2 * MAXLINE];
snprintf(reject, sizeof(reject), "Sorry, we only accept mail from SPF enabled domains", context->sender);
snprintf(reject, sizeof(reject), "Sorry %s, we only accept mail from SPF enabled domains.", context->sender);
if (spf_response) SPF_response_free(spf_response);
if (spf_request) SPF_request_free(spf_request);
if (spf_server) SPF_server_free(spf_server);
Expand All @@ -802,7 +802,7 @@ static sfsistat smf_envfrom(SMFICTX *ctx, char **args) {
}
if (conf.refuse_none_helo && strstr(context->from, "<>")) {
char reject[2 * MAXLINE];
snprintf(reject, sizeof(reject), "Sorry, we only accept empty senders from enabled servers (HELO identity)", context->sender);
snprintf(reject, sizeof(reject), "Sorry %s, we only accept empty senders from enabled servers (HELO identity)", context->sender);
if (spf_response) SPF_response_free(spf_response);
if (spf_request) SPF_request_free(spf_request);
if (spf_server) SPF_server_free(spf_server);
Expand Down Expand Up @@ -836,15 +836,18 @@ static sfsistat smf_envfrom(SMFICTX *ctx, char **args) {
break;
}
if (status == SPF_RESULT_TEMPERROR && !conf.accept_temperror) {
char reject[2 * MAXLINE];

snprintf(reject, sizeof(reject), "Found a problem processing SFP for %s. Error: %s", context->sender, SPF_strreason(spf_response->reason));
if (spf_response) SPF_response_free(spf_response);
if (spf_request) SPF_request_free(spf_request);
if (spf_server) SPF_server_free(spf_server);
smfi_setreply(ctx, "451" , "4.4.3", reject);
return SMFIS_TEMPFAIL;
}
char reject[2 * MAXLINE];
if (spf_response) {
snprintf(reject, sizeof(reject), "Found a problem processing SFP for %s. Error: (no reason)", context->sender);
} else {
snprintf(reject, sizeof(reject), "Found a problem processing SFP for %s. Error: %s", context->sender, SPF_strreason(spf_response->reason));
}
if (spf_response) SPF_response_free(spf_response);
if (spf_request) SPF_request_free(spf_request);
if (spf_server) SPF_server_free(spf_server);
smfi_setreply(ctx, "451" , "4.4.3", reject);
return SMFIS_TEMPFAIL;
}
if (status == SPF_RESULT_FAIL && conf.refuse_fail && !conf.tos) {
char reject[2 * MAXLINE];

Expand Down