Logo Search packages:      
Sourcecode: nbsmtp version File versions  Download package

smtp.c File Reference

Detailed Description

This file has SMTP related code.

Fernando J. Pereda <ferdy@ferdyx.org>

Ricardo Cervera Navarro <ricardo@zonasiete.org>

This is part of nbsmtp. nbsmtp is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

nbsmtp is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with nbsmtp; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

See COPYING for details.

Definition in file smtp.c.

#include <stdio.h>
#include <syslog.h>
#include <stdlib.h>
#include <string.h>
#include "fdutil.h"
#include "smtp.h"
#include "util.h"

Go to the source code of this file.


void smtp_exit (void)
 Cleans up the smtp module.
char * smtp_last_message ()
 Returns the last message from the server.
int smtp_okay (servinfo_t *serverinfo)
 Gets a line using smtp_read and if it returns 2 we return 1 (borrowed from sSMTP).
int smtp_read (servinfo_t *serverinfo, char *response)
 Gets a line from a socket an returns its first digit ( borrowed from sSMTP ).
ssize_t smtp_write (servinfo_t *serverinfo, char *str)
 Calls fd_puts appending CR LF.
int smtp_write_data (servinfo_t *serverinfo, char *msg, int length)
 Writes data to the socket (actually it writes the message body and headers).


char * smtp_stored_message
 Las message from the server.

Generated by  Doxygen 1.6.0   Back to index