/[monit]/monit/sendmail.c
ViewVC logotype

Diff of /monit/sendmail.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.38 by martinp, Sat Nov 5 14:09:01 2005 UTC revision 1.39 by martinp, Sun Nov 27 22:40:56 2005 UTC
# Line 105  int sendmail(Mail_T mail) { Line 105  int sendmail(Mail_T mail) {
105    Mail_T m;    Mail_T m;
106    SendMail_T S;    SendMail_T S;
107    char now[STRLEN];    char now[STRLEN];
108    int rv = TRUE;    int rv = FALSE;
109        
110    ASSERT(mail);    ASSERT(mail);
111        
112    if(sigsetjmp(S.error, TRUE)) {    if(sigsetjmp(S.error, TRUE)) {
     rv = FALSE;  
113      goto exit;      goto exit;
114    }    }
115    open_server(&S);    open_server(&S);
# Line 118  int sendmail(Mail_T mail) { Line 117  int sendmail(Mail_T mail) {
117    if(gethostname(S.localhost, sizeof(S.localhost)) < 0) {    if(gethostname(S.localhost, sizeof(S.localhost)) < 0) {
118      snprintf(S.localhost, sizeof(S.localhost), "%s", LOCALHOST);      snprintf(S.localhost, sizeof(S.localhost), "%s", LOCALHOST);
119    }    }
   /*  
    * FIXME: Implement this as a small state machine and handle server  
    * returned status codes as transition points.  
    */  
120    do_status(&S);    do_status(&S);
121    do_send(&S, "HELO %s\r\n", S.localhost);    do_send(&S, "HELO %s\r\n", S.localhost);
122    do_status(&S);    do_status(&S);
# Line 149  int sendmail(Mail_T mail) { Line 144  int sendmail(Mail_T mail) {
144      do_status(&S);      do_status(&S);
145    }    }
146    do_send(&S, "QUIT\r\n");    do_send(&S, "QUIT\r\n");
147      rv = TRUE;
148  exit:  exit:
149    if(S.socket) {    if(S.socket) {
150      socket_free(&S.socket);      socket_free(&S.socket);

Legend:
Removed from v.1.38  
changed lines
  Added in v.1.39

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26