Mercurial > masqmail
annotate docs/simple-relay-setup @ 386:13c9e0969054
Ignore pointer sign warnings.
author | markus schnalke <meillo@marmaro.de> |
---|---|
date | Sat, 18 Feb 2012 11:43:06 +0100 |
parents | 5781ba87df95 |
children |
rev | line source |
---|---|
186 | 1 Simple Setup |
2 ============ | |
3 | |
4 You want | |
5 -------- | |
6 | |
7 - submit mail on stdin by calling masqmail on the commandline | |
8 - submit mail with SMTP from the local machine | |
9 - let masqmail deliver mail locally to the system mailboxes /var/mail/* | |
10 - let masqmail forward non-local mail through a smart host | |
11 | |
12 This is like the simple-local-setup plus the forwarding. | |
13 | |
14 | |
15 Set up | |
16 ------ | |
17 | |
18 Follow the description in INSTALL. | |
19 | |
378
5781ba87df95
Removed ident. This had been discussed on the mailing list in Oct 2011.
markus schnalke <meillo@marmaro.de>
parents:
364
diff
changeset
|
20 Most times it's simply: |
186 | 21 |
378
5781ba87df95
Removed ident. This had been discussed on the mailing list in Oct 2011.
markus schnalke <meillo@marmaro.de>
parents:
364
diff
changeset
|
22 ./configure |
186 | 23 |
24 | |
25 Configuration | |
26 ------------- | |
27 | |
28 You need a config file like this one: | |
29 | |
30 host_name = "foo.example.org" | |
354
08932c629849
reworked the route concept; removed the idea of the localnet
markus schnalke <meillo@marmaro.de>
parents:
311
diff
changeset
|
31 query_routes.default = /etc/masqmail/default.route |
186 | 32 |
33 (Substitute a real hostname, of course.) | |
34 | |
35 Addionally you need to create the route config file like: | |
36 | |
37 # where to relay to; the address and port of the smart host | |
38 mail_host = "mail.gmx.net:25" | |
223 | 39 # use a wrapper to enable encryption |
40 # for STARTTLS on port 25: | |
41 #instant_helo=true | |
42 #wrapper="/usr/bin/openssl s_client -quiet -starttls smtp -connect mail.gmx.net:25 2>/dev/null" | |
43 # for SMTP over SSL on port 465: | |
44 #wrapper = "/usr/bin/openssl s_client -quiet -connect mail.gmx.net:465 2>/dev/null" | |
186 | 45 |
46 do_correct_helo = true | |
47 | |
48 # rewrite the From addresses to ones visible from the outside | |
49 map_return_path_addresses = "meillo: schnalke4@gmx.de" | |
50 map_h_from_addresses = "meillo: markus schnalke <schnalke4@gmx.de>" | |
51 | |
52 # it's good to use "login" only if the connection is encrypted | |
53 auth_name = "login" | |
54 #auth_name = "cram-md5" | |
55 auth_login = "UID_OR_EMAIL_ADDRESS" | |
56 auth_secret = "PASSWORD" | |
57 | |
58 | |
59 | |
60 Starting the daemon | |
61 ------------------- | |
62 | |
63 Listening for SMTP connections on a port requires masqmail to run as | |
64 daemon. You probably want to start masqmail as daemon each time the | |
65 system comes up. How you have to do that is system dependent. | |
66 /etc/rc.local is a good try to add the daemon call, because this file | |
67 seems to be frequently available. | |
68 | |
69 /usr/local/sbin/masqmail -bd -q10m | |
70 | |
71 This starts masqmail in daemon mode and does a queue run every ten | |
72 minutes. | |
73 | |
74 | |
75 Check the setup | |
76 --------------- | |
77 | |
78 Like in simple-local-setup plus ... | |
79 | |
80 Send a mail to a remote location: | |
81 | |
82 $ echo "some text" | mail foo@somewhereelse.example.org | |
83 | |
84 Check if it is queued: | |
85 | |
86 $ masqmail -bp | |
87 | |
88 Deliver it with: | |
89 | |
90 $ masqmail -qo default | |
91 | |
92 Check the queue contents again. | |
93 | |
94 You need to do such queue runs for online routes explicitely. For | |
95 instance by cron. | |
96 | |
97 | |
98 Automatic queue runs | |
99 -------------------- | |
100 | |
101 You can also tell masqmail to send queued mails through a route each | |
102 time the daemon does a queue run. Therefor you need to tell masqmail | |
103 that it is online and can use the default route to deliver mail. | |
104 | |
105 Add this to masqmail.conf: | |
106 | |
310
f10a56dc7481
reworked online_detect to the simpler online_query
meillo@marmaro.de
parents:
223
diff
changeset
|
107 online_query = "/bin/echo default" |
186 | 108 |
109 Now masqmail will send online mail automatically through the default | |
110 route, each time it does a queue run (every ten minutes). | |
111 | |
112 | |
113 In case of problems | |
114 ------------------- | |
115 | |
116 Have a look at the log file: /var/log/masqmail/masqmail.log | |
117 | |
118 Set the debug level in masqmail.conf, restart the daemon, redo the | |
119 test, and look at the debug file: /var/log/masqmail/debug.log | |
120 | |
121 If you use a wrapper, test it manually and interactively on the | |
122 command line. | |
123 | |
124 Ask on the mailing list: <masqmail@marmaro.de> | |
125 | |
126 | |
127 | |
128 meillo |