Mercurial > masqmail
annotate src/smtp_out.h @ 434:f2a7271746d1 default tip
Removes Freshmeat.net from the docs
The site, which was later renamed to freecode.com, is no longer
maintained (contains only a static copy).
author | markus schnalke <meillo@marmaro.de> |
---|---|
date | Sat, 07 Feb 2015 11:45:07 +0100 |
parents | 9bc3e47b0222 |
children |
rev | line source |
---|---|
367
b27f66555ba8
Reformated multiline comments to have leading asterisks on each line
markus schnalke <meillo@marmaro.de>
parents:
366
diff
changeset
|
1 /* |
b27f66555ba8
Reformated multiline comments to have leading asterisks on each line
markus schnalke <meillo@marmaro.de>
parents:
366
diff
changeset
|
2 ** smtp_out.h |
b27f66555ba8
Reformated multiline comments to have leading asterisks on each line
markus schnalke <meillo@marmaro.de>
parents:
366
diff
changeset
|
3 ** Copyright (C) Oliver Kurth, |
b27f66555ba8
Reformated multiline comments to have leading asterisks on each line
markus schnalke <meillo@marmaro.de>
parents:
366
diff
changeset
|
4 ** |
b27f66555ba8
Reformated multiline comments to have leading asterisks on each line
markus schnalke <meillo@marmaro.de>
parents:
366
diff
changeset
|
5 ** This program is free software; you can redistribute it and/or modify |
b27f66555ba8
Reformated multiline comments to have leading asterisks on each line
markus schnalke <meillo@marmaro.de>
parents:
366
diff
changeset
|
6 ** it under the terms of the GNU General Public License as published by |
b27f66555ba8
Reformated multiline comments to have leading asterisks on each line
markus schnalke <meillo@marmaro.de>
parents:
366
diff
changeset
|
7 ** the Free Software Foundation; either version 2 of the License, or |
b27f66555ba8
Reformated multiline comments to have leading asterisks on each line
markus schnalke <meillo@marmaro.de>
parents:
366
diff
changeset
|
8 ** (at your option) any later version. |
b27f66555ba8
Reformated multiline comments to have leading asterisks on each line
markus schnalke <meillo@marmaro.de>
parents:
366
diff
changeset
|
9 ** |
b27f66555ba8
Reformated multiline comments to have leading asterisks on each line
markus schnalke <meillo@marmaro.de>
parents:
366
diff
changeset
|
10 ** This program is distributed in the hope that it will be useful, |
b27f66555ba8
Reformated multiline comments to have leading asterisks on each line
markus schnalke <meillo@marmaro.de>
parents:
366
diff
changeset
|
11 ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
b27f66555ba8
Reformated multiline comments to have leading asterisks on each line
markus schnalke <meillo@marmaro.de>
parents:
366
diff
changeset
|
12 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
b27f66555ba8
Reformated multiline comments to have leading asterisks on each line
markus schnalke <meillo@marmaro.de>
parents:
366
diff
changeset
|
13 ** GNU General Public License for more details. |
b27f66555ba8
Reformated multiline comments to have leading asterisks on each line
markus schnalke <meillo@marmaro.de>
parents:
366
diff
changeset
|
14 ** |
b27f66555ba8
Reformated multiline comments to have leading asterisks on each line
markus schnalke <meillo@marmaro.de>
parents:
366
diff
changeset
|
15 ** You should have received a copy of the GNU General Public License |
b27f66555ba8
Reformated multiline comments to have leading asterisks on each line
markus schnalke <meillo@marmaro.de>
parents:
366
diff
changeset
|
16 ** along with this program; if not, write to the Free Software |
b27f66555ba8
Reformated multiline comments to have leading asterisks on each line
markus schnalke <meillo@marmaro.de>
parents:
366
diff
changeset
|
17 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
b27f66555ba8
Reformated multiline comments to have leading asterisks on each line
markus schnalke <meillo@marmaro.de>
parents:
366
diff
changeset
|
18 */ |
0 | 19 |
20 #include <unistd.h> | |
21 #include <sys/types.h> | |
22 #include <sys/socket.h> | |
23 #include <sys/time.h> | |
24 #include <netinet/in.h> | |
25 #include <netdb.h> | |
26 | |
27 #define SMTP_BUF_LEN 1024 | |
119
1e2fd87d58ea
some annotations related to mail sending with SMTP SIZE
meillo@marmaro.de
parents:
10
diff
changeset
|
28 #define SMTP_SIZE_ADD 1024 /* add to the size of a message */ |
0 | 29 |
30 #define SMTP_INITIAL_TIMEOUT 5*60 | |
31 #define SMTP_CMD_TIMEOUT 5*60 | |
32 #define SMTP_DATA_TIMEOUT 5*60 | |
33 #define SMTP_FINAL_TIMEOUT 10*60 | |
34 | |
10
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
35 typedef enum _smtp_error { |
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
36 smtp_ok = 0, /* mail was delivered to at least one recpient */ |
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
37 smtp_trylater, /* server responded with 4xx */ |
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
38 smtp_fail, /* server responded with 5xx */ |
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
39 smtp_timeout, /* connection timed out */ |
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
40 smtp_eof, /* got unexpected EOF */ |
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
41 smtp_syntax, /* unexpected response */ |
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
42 smtp_cancel /* we gave up (eg. size) */ |
0 | 43 } smtp_error; |
44 | |
45 | |
10
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
46 typedef struct _smtp_base { |
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
47 FILE *in; |
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
48 FILE *out; |
0 | 49 |
10
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
50 gint sock; |
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
51 gint dup_sock; |
0 | 52 |
10
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
53 gchar *remote_host; |
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
54 gchar *helo_name; |
0 | 55 |
10
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
56 gchar *buffer; |
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
57 gint last_code; |
0 | 58 |
10
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
59 gboolean use_size; |
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
60 gboolean use_pipelining; |
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
61 gboolean use_auth; |
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
62 |
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
63 gint max_size; |
0 | 64 |
10
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
65 gchar **auth_names; |
0 | 66 |
10
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
67 gchar *auth_name; |
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
68 gchar *auth_login; |
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
69 gchar *auth_secret; |
0 | 70 |
10
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
71 smtp_error error; |
0 | 72 |
73 } smtp_base; | |
74 | |
366
41958685480d
Switched to `type *name' style
markus schnalke <meillo@marmaro.de>
parents:
321
diff
changeset
|
75 gchar *set_heloname(smtp_base *psb, gchar *default_name, gboolean do_correct); |
41958685480d
Switched to `type *name' style
markus schnalke <meillo@marmaro.de>
parents:
321
diff
changeset
|
76 gboolean set_auth(smtp_base *psb, gchar *name, gchar *login, gchar *secret); |
41958685480d
Switched to `type *name' style
markus schnalke <meillo@marmaro.de>
parents:
321
diff
changeset
|
77 void destroy_smtpbase(smtp_base *psb); |
41958685480d
Switched to `type *name' style
markus schnalke <meillo@marmaro.de>
parents:
321
diff
changeset
|
78 smtp_base *smtp_out_open(gchar *host, gint port, GList *resolve_list); |
372
b0708fac99dd
Fixed a problem with psb->remote_host, introduced in changeset 412385b57dc4
markus schnalke <meillo@marmaro.de>
parents:
367
diff
changeset
|
79 smtp_base *smtp_out_open_child(gchar *cmd); |
366
41958685480d
Switched to `type *name' style
markus schnalke <meillo@marmaro.de>
parents:
321
diff
changeset
|
80 gboolean smtp_out_rset(smtp_base *psb); |
41958685480d
Switched to `type *name' style
markus schnalke <meillo@marmaro.de>
parents:
321
diff
changeset
|
81 gboolean smtp_out_init(smtp_base *psb, gboolean instant_helo); |
41958685480d
Switched to `type *name' style
markus schnalke <meillo@marmaro.de>
parents:
321
diff
changeset
|
82 gint smtp_out_msg(smtp_base *psb, message *msg, address *return_path, GList *rcpt_list, GList *hdr_list); |
41958685480d
Switched to `type *name' style
markus schnalke <meillo@marmaro.de>
parents:
321
diff
changeset
|
83 gboolean smtp_out_quit(smtp_base *psb); |
377
9bc3e47b0222
Various cleanups to remove compiler warnings.
markus schnalke <meillo@marmaro.de>
parents:
372
diff
changeset
|
84 void smtp_out_mark_rcpts(smtp_base *psb, GList *rcpt_list); |
0 | 85 |
366
41958685480d
Switched to `type *name' style
markus schnalke <meillo@marmaro.de>
parents:
321
diff
changeset
|
86 gint smtp_deliver(gchar *host, gint port, GList *resolve_list, message *msg, address *return_path, GList *rcpt_list); |