Skip to content

Commit

Permalink
Merge pull request #1783 from ddpbsd/sendmail
Browse files Browse the repository at this point in the history
Fix using a program to send mail
  • Loading branch information
atomicturtle authored Oct 22, 2019
2 parents a789a7b + 3306036 commit a973a7e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/os_maild/sendmail.c
Original file line number Diff line number Diff line change
Expand Up @@ -158,11 +158,10 @@ int OS_Sendmail(MailConfig *mail, struct tm *p)
}

event_dispatch();
}

if (os_sock <= 0) {
ErrorExit("ossec-maild: ERROR: No socket.");
}
if (os_sock <= 0) {
ErrorExit("ossec-maild: ERROR: No socket.");
}

/* Receive the banner */
msg = OS_RecvTCP(os_sock, OS_SIZE_1024);
Expand Down Expand Up @@ -305,6 +304,7 @@ int OS_Sendmail(MailConfig *mail, struct tm *p)
}
MAIL_DEBUG("DEBUG: Sent '%s', received: '%s'", DATAMSG, msg);
free(msg);
}

/* Building "From" and "To" in the e-mail header */
memset(snd_msg, '\0', 128);
Expand Down

0 comments on commit a973a7e

Please sign in to comment.