Mercurial > masqmail
comparison src/smtp_out.h @ 10:26e34ae9a3e3
changed indention and line wrapping to a more consistent style
author | meillo@marmaro.de |
---|---|
date | Mon, 27 Oct 2008 16:23:10 +0100 |
parents | 08114f7dcc23 |
children | 1e2fd87d58ea |
comparison
equal
deleted
inserted
replaced
9:31cc8a89cb74 | 10:26e34ae9a3e3 |
---|---|
2 * | 2 * |
3 * This program is free software; you can redistribute it and/or modify | 3 * This program is free software; you can redistribute it and/or modify |
4 * it under the terms of the GNU General Public License as published by | 4 * it under the terms of the GNU General Public License as published by |
5 * the Free Software Foundation; either version 2 of the License, or | 5 * the Free Software Foundation; either version 2 of the License, or |
6 * (at your option) any later version. | 6 * (at your option) any later version. |
7 * | 7 * |
8 * This program is distributed in the hope that it will be useful, | 8 * This program is distributed in the hope that it will be useful, |
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 9 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
11 * GNU General Public License for more details. | 11 * GNU General Public License for more details. |
12 * | 12 * |
28 #define SMTP_INITIAL_TIMEOUT 5*60 | 28 #define SMTP_INITIAL_TIMEOUT 5*60 |
29 #define SMTP_CMD_TIMEOUT 5*60 | 29 #define SMTP_CMD_TIMEOUT 5*60 |
30 #define SMTP_DATA_TIMEOUT 5*60 | 30 #define SMTP_DATA_TIMEOUT 5*60 |
31 #define SMTP_FINAL_TIMEOUT 10*60 | 31 #define SMTP_FINAL_TIMEOUT 10*60 |
32 | 32 |
33 typedef | 33 typedef enum _smtp_error { |
34 enum _smtp_error{ | 34 smtp_ok = 0, /* mail was delivered to at least one recpient */ |
35 smtp_ok = 0, /* mail was delivered to at least one recpient */ | 35 smtp_trylater, /* server responded with 4xx */ |
36 smtp_trylater, /* server responded with 4xx */ | 36 smtp_fail, /* server responded with 5xx */ |
37 smtp_fail, /* server responded with 5xx */ | 37 smtp_timeout, /* connection timed out */ |
38 smtp_timeout, /* connection timed out */ | 38 smtp_eof, /* got unexpected EOF */ |
39 smtp_eof, /* got unexpected EOF */ | 39 smtp_syntax, /* unexpected response */ |
40 smtp_syntax, /* unexpected response */ | 40 smtp_cancel /* we gave up (eg. size) */ |
41 smtp_cancel /* we gave up (eg. size) */ | |
42 } smtp_error; | 41 } smtp_error; |
43 | 42 |
44 | 43 |
45 typedef | 44 typedef struct _smtp_base { |
46 struct _smtp_base{ | 45 FILE *in; |
47 FILE *in; | 46 FILE *out; |
48 FILE *out; | |
49 | 47 |
50 gint sock; | 48 gint sock; |
51 gint dup_sock; | 49 gint dup_sock; |
52 | 50 |
53 gchar *remote_host; | 51 gchar *remote_host; |
54 gchar *helo_name; | 52 gchar *helo_name; |
55 | 53 |
56 gchar *buffer; | 54 gchar *buffer; |
57 gint last_code; | 55 gint last_code; |
58 | 56 |
59 gboolean use_esmtp; | 57 gboolean use_esmtp; |
60 gboolean use_size; | 58 gboolean use_size; |
61 gboolean use_pipelining; | 59 gboolean use_pipelining; |
62 gboolean use_auth; | 60 gboolean use_auth; |
63 | |
64 gint max_size; | |
65 | 61 |
66 gchar **auth_names; | 62 gint max_size; |
67 | 63 |
68 gchar *auth_name; | 64 gchar **auth_names; |
69 gchar *auth_login; | |
70 gchar *auth_secret; | |
71 | 65 |
72 smtp_error error; | 66 gchar *auth_name; |
67 gchar *auth_login; | |
68 gchar *auth_secret; | |
69 | |
70 smtp_error error; | |
73 | 71 |
74 } smtp_base; | 72 } smtp_base; |
75 | 73 |
76 gchar *set_heloname(smtp_base *psb, gchar *default_name, gboolean do_correct); | 74 gchar *set_heloname(smtp_base * psb, gchar * default_name, gboolean do_correct); |
77 gboolean set_auth(smtp_base *psb, gchar *name, gchar *login, gchar *secret); | 75 gboolean set_auth(smtp_base * psb, gchar * name, gchar * login, gchar * secret); |
78 void destroy_smtpbase(smtp_base *psb); | 76 void destroy_smtpbase(smtp_base * psb); |
79 smtp_base *smtp_out_open(gchar *host, gint port, GList *resolve_list); | 77 smtp_base *smtp_out_open(gchar * host, gint port, GList * resolve_list); |
80 smtp_base *smtp_out_open_child(gchar *cmd); | 78 smtp_base *smtp_out_open_child(gchar * cmd); |
81 gboolean smtp_out_rset(smtp_base *psb); | 79 gboolean smtp_out_rset(smtp_base * psb); |
82 gboolean smtp_out_init(smtp_base *psb); | 80 gboolean smtp_out_init(smtp_base * psb); |
83 gint smtp_out_msg(smtp_base *psb, | 81 gint smtp_out_msg(smtp_base * psb, message * msg, address * return_path, GList * rcpt_list, GList * hdr_list); |
84 message *msg, address *return_path, | 82 gboolean smtp_out_quit(smtp_base * psb); |
85 GList *rcpt_list, GList *hdr_list); | |
86 gboolean smtp_out_quit(smtp_base *psb); | |
87 | 83 |
88 gint smtp_deliver(gchar *host, gint port, GList *resolve_list, | 84 gint smtp_deliver(gchar * host, gint port, GList * resolve_list, message * msg, address * return_path, GList * rcpt_list); |
89 message *msg, | |
90 address *return_path, | |
91 GList *rcpt_list); |