annotate docs/simple-relay-setup @ 246:4cff8638dd9b

SMTP client: tries EHLO now always first Changed the behavior of the SMTP client. Now always an EHLO greeting is sent, no matter what kind of greeting text the server had sent. If the EHLO failed, an HELO greeting is tried as fall back. This is the behavior RFC 2821 requires (section 3.2). This change will fix setups that were not possible to sent to a server because that requires AUTH but hadn't said ``ESMTP'' in its greeting message. See also: Debian bug #349211 Thanks to Steffen (inne)
author markus schnalke <meillo@marmaro.de>
date Thu, 28 Oct 2010 16:40:02 -0300
parents 9814e75de61c
children f10a56dc7481
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
186
3dff59a4e764 added two setup guides
meillo@marmaro.de
parents:
diff changeset
1 Simple Setup
3dff59a4e764 added two setup guides
meillo@marmaro.de
parents:
diff changeset
2 ============
3dff59a4e764 added two setup guides
meillo@marmaro.de
parents:
diff changeset
3
3dff59a4e764 added two setup guides
meillo@marmaro.de
parents:
diff changeset
4 You want
3dff59a4e764 added two setup guides
meillo@marmaro.de
parents:
diff changeset
5 --------
3dff59a4e764 added two setup guides
meillo@marmaro.de
parents:
diff changeset
6
3dff59a4e764 added two setup guides
meillo@marmaro.de
parents:
diff changeset
7 - submit mail on stdin by calling masqmail on the commandline
3dff59a4e764 added two setup guides
meillo@marmaro.de
parents:
diff changeset
8 - submit mail with SMTP from the local machine
3dff59a4e764 added two setup guides
meillo@marmaro.de
parents:
diff changeset
9 - let masqmail deliver mail locally to the system mailboxes /var/mail/*
3dff59a4e764 added two setup guides
meillo@marmaro.de
parents:
diff changeset
10 - let masqmail forward non-local mail through a smart host
3dff59a4e764 added two setup guides
meillo@marmaro.de
parents:
diff changeset
11
3dff59a4e764 added two setup guides
meillo@marmaro.de
parents:
diff changeset
12 This is like the simple-local-setup plus the forwarding.
3dff59a4e764 added two setup guides
meillo@marmaro.de
parents:
diff changeset
13
3dff59a4e764 added two setup guides
meillo@marmaro.de
parents:
diff changeset
14
3dff59a4e764 added two setup guides
meillo@marmaro.de
parents:
diff changeset
15 Set up
3dff59a4e764 added two setup guides
meillo@marmaro.de
parents:
diff changeset
16 ------
3dff59a4e764 added two setup guides
meillo@marmaro.de
parents:
diff changeset
17
3dff59a4e764 added two setup guides
meillo@marmaro.de
parents:
diff changeset
18 Follow the description in INSTALL.
3dff59a4e764 added two setup guides
meillo@marmaro.de
parents:
diff changeset
19
3dff59a4e764 added two setup guides
meillo@marmaro.de
parents:
diff changeset
20 A common configure call would be:
3dff59a4e764 added two setup guides
meillo@marmaro.de
parents:
diff changeset
21
3dff59a4e764 added two setup guides
meillo@marmaro.de
parents:
diff changeset
22 ./configure --enable-auth --enable-ident
3dff59a4e764 added two setup guides
meillo@marmaro.de
parents:
diff changeset
23
3dff59a4e764 added two setup guides
meillo@marmaro.de
parents:
diff changeset
24
3dff59a4e764 added two setup guides
meillo@marmaro.de
parents:
diff changeset
25 Configuration
3dff59a4e764 added two setup guides
meillo@marmaro.de
parents:
diff changeset
26 -------------
3dff59a4e764 added two setup guides
meillo@marmaro.de
parents:
diff changeset
27
3dff59a4e764 added two setup guides
meillo@marmaro.de
parents:
diff changeset
28 You need a config file like this one:
3dff59a4e764 added two setup guides
meillo@marmaro.de
parents:
diff changeset
29
3dff59a4e764 added two setup guides
meillo@marmaro.de
parents:
diff changeset
30 host_name = "foo.example.org"
3dff59a4e764 added two setup guides
meillo@marmaro.de
parents:
diff changeset
31 online_routes.default = /etc/masqmail/default.route
3dff59a4e764 added two setup guides
meillo@marmaro.de
parents:
diff changeset
32
3dff59a4e764 added two setup guides
meillo@marmaro.de
parents:
diff changeset
33 (Substitute a real hostname, of course.)
3dff59a4e764 added two setup guides
meillo@marmaro.de
parents:
diff changeset
34
3dff59a4e764 added two setup guides
meillo@marmaro.de
parents:
diff changeset
35 Addionally you need to create the route config file like:
3dff59a4e764 added two setup guides
meillo@marmaro.de
parents:
diff changeset
36
3dff59a4e764 added two setup guides
meillo@marmaro.de
parents:
diff changeset
37 protocol = smtp
3dff59a4e764 added two setup guides
meillo@marmaro.de
parents:
diff changeset
38
3dff59a4e764 added two setup guides
meillo@marmaro.de
parents:
diff changeset
39 # where to relay to; the address and port of the smart host
3dff59a4e764 added two setup guides
meillo@marmaro.de
parents:
diff changeset
40 mail_host = "mail.gmx.net:25"
223
9814e75de61c updated docs to STARTTLS wrappers
meillo@marmaro.de
parents: 186
diff changeset
41 # use a wrapper to enable encryption
9814e75de61c updated docs to STARTTLS wrappers
meillo@marmaro.de
parents: 186
diff changeset
42 # for STARTTLS on port 25:
9814e75de61c updated docs to STARTTLS wrappers
meillo@marmaro.de
parents: 186
diff changeset
43 #instant_helo=true
9814e75de61c updated docs to STARTTLS wrappers
meillo@marmaro.de
parents: 186
diff changeset
44 #wrapper="/usr/bin/openssl s_client -quiet -starttls smtp -connect mail.gmx.net:25 2>/dev/null"
9814e75de61c updated docs to STARTTLS wrappers
meillo@marmaro.de
parents: 186
diff changeset
45 # for SMTP over SSL on port 465:
9814e75de61c updated docs to STARTTLS wrappers
meillo@marmaro.de
parents: 186
diff changeset
46 #wrapper = "/usr/bin/openssl s_client -quiet -connect mail.gmx.net:465 2>/dev/null"
186
3dff59a4e764 added two setup guides
meillo@marmaro.de
parents:
diff changeset
47
3dff59a4e764 added two setup guides
meillo@marmaro.de
parents:
diff changeset
48 do_correct_helo = true
3dff59a4e764 added two setup guides
meillo@marmaro.de
parents:
diff changeset
49
3dff59a4e764 added two setup guides
meillo@marmaro.de
parents:
diff changeset
50 # rewrite the From addresses to ones visible from the outside
3dff59a4e764 added two setup guides
meillo@marmaro.de
parents:
diff changeset
51 map_return_path_addresses = "meillo: schnalke4@gmx.de"
3dff59a4e764 added two setup guides
meillo@marmaro.de
parents:
diff changeset
52 map_h_from_addresses = "meillo: markus schnalke <schnalke4@gmx.de>"
3dff59a4e764 added two setup guides
meillo@marmaro.de
parents:
diff changeset
53
3dff59a4e764 added two setup guides
meillo@marmaro.de
parents:
diff changeset
54 # it's good to use "login" only if the connection is encrypted
3dff59a4e764 added two setup guides
meillo@marmaro.de
parents:
diff changeset
55 auth_name = "login"
3dff59a4e764 added two setup guides
meillo@marmaro.de
parents:
diff changeset
56 #auth_name = "cram-md5"
3dff59a4e764 added two setup guides
meillo@marmaro.de
parents:
diff changeset
57 auth_login = "UID_OR_EMAIL_ADDRESS"
3dff59a4e764 added two setup guides
meillo@marmaro.de
parents:
diff changeset
58 auth_secret = "PASSWORD"
3dff59a4e764 added two setup guides
meillo@marmaro.de
parents:
diff changeset
59
3dff59a4e764 added two setup guides
meillo@marmaro.de
parents:
diff changeset
60
3dff59a4e764 added two setup guides
meillo@marmaro.de
parents:
diff changeset
61
3dff59a4e764 added two setup guides
meillo@marmaro.de
parents:
diff changeset
62 Starting the daemon
3dff59a4e764 added two setup guides
meillo@marmaro.de
parents:
diff changeset
63 -------------------
3dff59a4e764 added two setup guides
meillo@marmaro.de
parents:
diff changeset
64
3dff59a4e764 added two setup guides
meillo@marmaro.de
parents:
diff changeset
65 Listening for SMTP connections on a port requires masqmail to run as
3dff59a4e764 added two setup guides
meillo@marmaro.de
parents:
diff changeset
66 daemon. You probably want to start masqmail as daemon each time the
3dff59a4e764 added two setup guides
meillo@marmaro.de
parents:
diff changeset
67 system comes up. How you have to do that is system dependent.
3dff59a4e764 added two setup guides
meillo@marmaro.de
parents:
diff changeset
68 /etc/rc.local is a good try to add the daemon call, because this file
3dff59a4e764 added two setup guides
meillo@marmaro.de
parents:
diff changeset
69 seems to be frequently available.
3dff59a4e764 added two setup guides
meillo@marmaro.de
parents:
diff changeset
70
3dff59a4e764 added two setup guides
meillo@marmaro.de
parents:
diff changeset
71 /usr/local/sbin/masqmail -bd -q10m
3dff59a4e764 added two setup guides
meillo@marmaro.de
parents:
diff changeset
72
3dff59a4e764 added two setup guides
meillo@marmaro.de
parents:
diff changeset
73 This starts masqmail in daemon mode and does a queue run every ten
3dff59a4e764 added two setup guides
meillo@marmaro.de
parents:
diff changeset
74 minutes.
3dff59a4e764 added two setup guides
meillo@marmaro.de
parents:
diff changeset
75
3dff59a4e764 added two setup guides
meillo@marmaro.de
parents:
diff changeset
76
3dff59a4e764 added two setup guides
meillo@marmaro.de
parents:
diff changeset
77 Check the setup
3dff59a4e764 added two setup guides
meillo@marmaro.de
parents:
diff changeset
78 ---------------
3dff59a4e764 added two setup guides
meillo@marmaro.de
parents:
diff changeset
79
3dff59a4e764 added two setup guides
meillo@marmaro.de
parents:
diff changeset
80 Like in simple-local-setup plus ...
3dff59a4e764 added two setup guides
meillo@marmaro.de
parents:
diff changeset
81
3dff59a4e764 added two setup guides
meillo@marmaro.de
parents:
diff changeset
82 Send a mail to a remote location:
3dff59a4e764 added two setup guides
meillo@marmaro.de
parents:
diff changeset
83
3dff59a4e764 added two setup guides
meillo@marmaro.de
parents:
diff changeset
84 $ echo "some text" | mail foo@somewhereelse.example.org
3dff59a4e764 added two setup guides
meillo@marmaro.de
parents:
diff changeset
85
3dff59a4e764 added two setup guides
meillo@marmaro.de
parents:
diff changeset
86 Check if it is queued:
3dff59a4e764 added two setup guides
meillo@marmaro.de
parents:
diff changeset
87
3dff59a4e764 added two setup guides
meillo@marmaro.de
parents:
diff changeset
88 $ masqmail -bp
3dff59a4e764 added two setup guides
meillo@marmaro.de
parents:
diff changeset
89
3dff59a4e764 added two setup guides
meillo@marmaro.de
parents:
diff changeset
90 Deliver it with:
3dff59a4e764 added two setup guides
meillo@marmaro.de
parents:
diff changeset
91
3dff59a4e764 added two setup guides
meillo@marmaro.de
parents:
diff changeset
92 $ masqmail -qo default
3dff59a4e764 added two setup guides
meillo@marmaro.de
parents:
diff changeset
93
3dff59a4e764 added two setup guides
meillo@marmaro.de
parents:
diff changeset
94 Check the queue contents again.
3dff59a4e764 added two setup guides
meillo@marmaro.de
parents:
diff changeset
95
3dff59a4e764 added two setup guides
meillo@marmaro.de
parents:
diff changeset
96 You need to do such queue runs for online routes explicitely. For
3dff59a4e764 added two setup guides
meillo@marmaro.de
parents:
diff changeset
97 instance by cron.
3dff59a4e764 added two setup guides
meillo@marmaro.de
parents:
diff changeset
98
3dff59a4e764 added two setup guides
meillo@marmaro.de
parents:
diff changeset
99
3dff59a4e764 added two setup guides
meillo@marmaro.de
parents:
diff changeset
100 Automatic queue runs
3dff59a4e764 added two setup guides
meillo@marmaro.de
parents:
diff changeset
101 --------------------
3dff59a4e764 added two setup guides
meillo@marmaro.de
parents:
diff changeset
102
3dff59a4e764 added two setup guides
meillo@marmaro.de
parents:
diff changeset
103 You can also tell masqmail to send queued mails through a route each
3dff59a4e764 added two setup guides
meillo@marmaro.de
parents:
diff changeset
104 time the daemon does a queue run. Therefor you need to tell masqmail
3dff59a4e764 added two setup guides
meillo@marmaro.de
parents:
diff changeset
105 that it is online and can use the default route to deliver mail.
3dff59a4e764 added two setup guides
meillo@marmaro.de
parents:
diff changeset
106
3dff59a4e764 added two setup guides
meillo@marmaro.de
parents:
diff changeset
107 Add this to masqmail.conf:
3dff59a4e764 added two setup guides
meillo@marmaro.de
parents:
diff changeset
108
3dff59a4e764 added two setup guides
meillo@marmaro.de
parents:
diff changeset
109 online_detect = "pipe"
3dff59a4e764 added two setup guides
meillo@marmaro.de
parents:
diff changeset
110 online_pipe = "/bin/echo default"
3dff59a4e764 added two setup guides
meillo@marmaro.de
parents:
diff changeset
111
3dff59a4e764 added two setup guides
meillo@marmaro.de
parents:
diff changeset
112 Now masqmail will send online mail automatically through the default
3dff59a4e764 added two setup guides
meillo@marmaro.de
parents:
diff changeset
113 route, each time it does a queue run (every ten minutes).
3dff59a4e764 added two setup guides
meillo@marmaro.de
parents:
diff changeset
114
3dff59a4e764 added two setup guides
meillo@marmaro.de
parents:
diff changeset
115
3dff59a4e764 added two setup guides
meillo@marmaro.de
parents:
diff changeset
116 In case of problems
3dff59a4e764 added two setup guides
meillo@marmaro.de
parents:
diff changeset
117 -------------------
3dff59a4e764 added two setup guides
meillo@marmaro.de
parents:
diff changeset
118
3dff59a4e764 added two setup guides
meillo@marmaro.de
parents:
diff changeset
119 Have a look at the log file: /var/log/masqmail/masqmail.log
3dff59a4e764 added two setup guides
meillo@marmaro.de
parents:
diff changeset
120
3dff59a4e764 added two setup guides
meillo@marmaro.de
parents:
diff changeset
121 Set the debug level in masqmail.conf, restart the daemon, redo the
3dff59a4e764 added two setup guides
meillo@marmaro.de
parents:
diff changeset
122 test, and look at the debug file: /var/log/masqmail/debug.log
3dff59a4e764 added two setup guides
meillo@marmaro.de
parents:
diff changeset
123
3dff59a4e764 added two setup guides
meillo@marmaro.de
parents:
diff changeset
124 If you use a wrapper, test it manually and interactively on the
3dff59a4e764 added two setup guides
meillo@marmaro.de
parents:
diff changeset
125 command line.
3dff59a4e764 added two setup guides
meillo@marmaro.de
parents:
diff changeset
126
3dff59a4e764 added two setup guides
meillo@marmaro.de
parents:
diff changeset
127 Ask on the mailing list: <masqmail@marmaro.de>
3dff59a4e764 added two setup guides
meillo@marmaro.de
parents:
diff changeset
128
3dff59a4e764 added two setup guides
meillo@marmaro.de
parents:
diff changeset
129
3dff59a4e764 added two setup guides
meillo@marmaro.de
parents:
diff changeset
130
3dff59a4e764 added two setup guides
meillo@marmaro.de
parents:
diff changeset
131 meillo