summaryrefslogtreecommitdiff
path: root/src/tools/smtp.h
diff options
context:
space:
mode:
authortrystan trystan@31f1291d-b8d6-0310-a050-a5561fc1590b <trystan trystan@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>2005-01-20 05:37:46 +0000
committertrystan trystan@31f1291d-b8d6-0310-a050-a5561fc1590b <trystan trystan@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>2005-01-20 05:37:46 +0000
commit278a99ca2d54104ea880149657b960be26aa4ca0 (patch)
tree0da20f241cd3eec04608579f2fbc283249e678cf /src/tools/smtp.h
parent1ef4a60c466c3be777863af32375f4a0489e6f79 (diff)
BUILD : 1.7.7 (550) BUGS : N/A NOTES : Anope SMTP client
git-svn-id: svn://svn.anope.org/anope/trunk@550 31f1291d-b8d6-0310-a050-a5561fc1590b git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@403 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src/tools/smtp.h')
-rw-r--r--src/tools/smtp.h94
1 files changed, 94 insertions, 0 deletions
diff --git a/src/tools/smtp.h b/src/tools/smtp.h
new file mode 100644
index 000000000..0dc0a0cbb
--- /dev/null
+++ b/src/tools/smtp.h
@@ -0,0 +1,94 @@
+/*
+ *
+ * (C) 2003 Anope Team
+ * Contact us at info@anope.org
+ *
+ * Please read COPYING and README for furhter details.
+ *
+ * Based on the original code of Epona by Lara.
+ * Based on the original code of Services by Andy Church.
+ *
+ *
+ */
+
+#ifndef SMTP_H
+#define SMTP_H
+
+/*************************************************************************/
+
+/* Some Linux boxes (or maybe glibc includes) require this for the
+ * prototype of strsignal(). */
+#define _GNU_SOURCE
+
+#include <stdarg.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <signal.h>
+#include <time.h>
+#include <errno.h>
+#include <grp.h>
+#include <limits.h>
+#include <netdb.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <sys/socket.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <sys/time.h>
+#include <fcntl.h>
+#include <ctype.h>
+
+#ifdef _AIX
+extern int strcasecmp(const char *, const char *);
+extern int strncasecmp(const char *, const char *, size_t);
+# if 0 /* These break on some AIX boxes (4.3.1 reported). */
+extern int socket(int, int, int);
+extern int connect(int, struct sockaddr *, int);
+# endif
+#endif /* _AIX */
+
+
+/*************************************************************************/
+
+#ifdef _WIN32
+#include <winsock.h>
+typedef SOCKET ano_socket_t;
+#define ano_sockclose(fd) closesocket(fd)
+#define ano_sockread(fd, buf, len) recv(fd, buf, len, 0)
+#define ano_sockwrite(fd, buf, len) send(fd, buf, len, 0)
+#else
+typedef int ano_socket_t;
+#define ano_sockclose(fd) close(fd)
+#define ano_sockread(fd, buf, len) read(fd, buf, len)
+#define ano_sockwrite(fd, buf, len) write(fd, buf, len)
+#define SOCKET_ERROR -1
+#endif
+
+
+/* Data structures */
+struct smtp_header {
+ char *header;
+ struct smtp_header *next;
+};
+
+struct smtp_body_line {
+ char *line;
+ struct smtp_body_line *next;
+};
+
+struct smtp_message {
+ struct smtp_header *smtp_headers, *smtp_headers_tail;
+ struct smtp_body_line *smtp_body, *smtp_body_tail;
+ char *from;
+ char *to;
+ ano_socket_t sock;
+};
+
+struct smtp_message mail;
+
+/* set this to 1 if you want to get a log otherwise it runs silent */
+int smtp_debug = 0;
+
+#endif /* SMTP_H */