X-Git-Url: http://ftp.carnet.hr/carnet-debian/scm?p=ossec-hids.git;a=blobdiff_plain;f=src%2Fos_maild%2Fsendcustomemail.c;h=a597fcc631ca16227d939bc799c3ba204af5076a;hp=ea2b203cbf70b736725ed07638957e3bd3da39eb;hb=6ef2f786c6c8ead94841b5f93baf9f43421f08c8;hpb=301048b51990573e58a30dc4a5bb4ec285cad554 diff --git a/src/os_maild/sendcustomemail.c b/src/os_maild/sendcustomemail.c index ea2b203..a597fcc 100755 --- a/src/os_maild/sendcustomemail.c +++ b/src/os_maild/sendcustomemail.c @@ -1,11 +1,12 @@ -/* @(#) $Id$ */ +/* @(#) $Id: ./src/os_maild/sendcustomemail.c, 2011/09/08 dcid Exp $ + */ /* Copyright (C) 2009 Trend Micro Inc. * All rights reserved. * * This program is a free software; you can redistribute it * and/or modify it under the terms of the GNU General Public - * License (version 2) as published by the FSF - Free Software + * License (version 2) as published by the FSF - Free Software * Foundation */ @@ -67,7 +68,7 @@ int OS_SendCustomEmail(char **to, char *subject, char *smtpserver, char *from, F /* Connecting to the smtp server */ - socket = OS_ConnectTCP(SMTP_DEFAULT_PORT, smtpserver); + socket = OS_ConnectTCP(SMTP_DEFAULT_PORT, smtpserver, 0); if(socket < 0) { return(socket); @@ -112,7 +113,7 @@ int OS_SendCustomEmail(char **to, char *subject, char *smtpserver, char *from, F if(msg) free(msg); close(socket); - return(OS_INVALID); + return(OS_INVALID); } } else @@ -209,7 +210,7 @@ int OS_SendCustomEmail(char **to, char *subject, char *smtpserver, char *from, F { break; } - + memset(snd_msg,'\0',128); snprintf(snd_msg,127, TO, to[i]); OS_SendTCP(socket,snd_msg); @@ -229,7 +230,7 @@ int OS_SendCustomEmail(char **to, char *subject, char *smtpserver, char *from, F #else strftime(snd_msg, 127, "Date: %a, %d %b %Y %T %z\r\n",p); #endif - + OS_SendTCP(socket,snd_msg); @@ -246,7 +247,7 @@ int OS_SendCustomEmail(char **to, char *subject, char *smtpserver, char *from, F while(fgets(buffer, 2048, fp) != NULL) { OS_SendTCP(socket,buffer); - } + } /* Sending end of data \r\n.\r\n */