File: smtp.c

package info (click to toggle)
echoping 6.0.2-10
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid, stretch
  • size: 9,296 kB
  • ctags: 515
  • sloc: sh: 8,951; ansic: 3,352; makefile: 170
file content (34 lines) | stat: -rw-r--r-- 547 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/* Code contributed by Samuel Tardieu <sam@inf.enst.fr>
 *
 * $Id: smtp.c 377 2007-03-12 20:48:05Z bortz $
 *
 */

#include "echoping.h"

#ifdef SMTP

char            big_recvline[MAXTOREAD];

int
smtp_read_response_from_server(FILE * fs)
{
	int             nr;
	int             i;

	for (i = 0; i < MAXSMTPLINES; i++) {
		nr = readline(fs, big_recvline, MAXTOREAD, TRUE);
		if (nr <= 4) {
			return -1;
		}
		if (big_recvline[3] == ' ') {
			return nr;
		}
		if (big_recvline[3] != '-') {
			return -1;
		}
	}
	return -1;
}

#endif				/* SMTP */