masqmail

view docs/simple-relay-setup @ 262:fc1c6425c024

s/EXIT_SUCCESS/0/ && s/EXIT_FAILURE/1/ The constants are all to bulky. We should have different, meaningful exit codes anyway.
author markus schnalke <meillo@marmaro.de>
date Thu, 02 Dec 2010 17:11:25 -0300
parents 3dff59a4e764
children f10a56dc7481
line source
1 Simple Setup
2 ============
4 You want
5 --------
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
12 This is like the simple-local-setup plus the forwarding.
15 Set up
16 ------
18 Follow the description in INSTALL.
20 A common configure call would be:
22 ./configure --enable-auth --enable-ident
25 Configuration
26 -------------
28 You need a config file like this one:
30 host_name = "foo.example.org"
31 online_routes.default = /etc/masqmail/default.route
33 (Substitute a real hostname, of course.)
35 Addionally you need to create the route config file like:
37 protocol = smtp
39 # where to relay to; the address and port of the smart host
40 mail_host = "mail.gmx.net:25"
41 # use a wrapper to enable encryption
42 # for STARTTLS on port 25:
43 #instant_helo=true
44 #wrapper="/usr/bin/openssl s_client -quiet -starttls smtp -connect mail.gmx.net:25 2>/dev/null"
45 # for SMTP over SSL on port 465:
46 #wrapper = "/usr/bin/openssl s_client -quiet -connect mail.gmx.net:465 2>/dev/null"
48 do_correct_helo = true
50 # rewrite the From addresses to ones visible from the outside
51 map_return_path_addresses = "meillo: schnalke4@gmx.de"
52 map_h_from_addresses = "meillo: markus schnalke <schnalke4@gmx.de>"
54 # it's good to use "login" only if the connection is encrypted
55 auth_name = "login"
56 #auth_name = "cram-md5"
57 auth_login = "UID_OR_EMAIL_ADDRESS"
58 auth_secret = "PASSWORD"
62 Starting the daemon
63 -------------------
65 Listening for SMTP connections on a port requires masqmail to run as
66 daemon. You probably want to start masqmail as daemon each time the
67 system comes up. How you have to do that is system dependent.
68 /etc/rc.local is a good try to add the daemon call, because this file
69 seems to be frequently available.
71 /usr/local/sbin/masqmail -bd -q10m
73 This starts masqmail in daemon mode and does a queue run every ten
74 minutes.
77 Check the setup
78 ---------------
80 Like in simple-local-setup plus ...
82 Send a mail to a remote location:
84 $ echo "some text" | mail foo@somewhereelse.example.org
86 Check if it is queued:
88 $ masqmail -bp
90 Deliver it with:
92 $ masqmail -qo default
94 Check the queue contents again.
96 You need to do such queue runs for online routes explicitely. For
97 instance by cron.
100 Automatic queue runs
101 --------------------
103 You can also tell masqmail to send queued mails through a route each
104 time the daemon does a queue run. Therefor you need to tell masqmail
105 that it is online and can use the default route to deliver mail.
107 Add this to masqmail.conf:
109 online_detect = "pipe"
110 online_pipe = "/bin/echo default"
112 Now masqmail will send online mail automatically through the default
113 route, each time it does a queue run (every ten minutes).
116 In case of problems
117 -------------------
119 Have a look at the log file: /var/log/masqmail/masqmail.log
121 Set the debug level in masqmail.conf, restart the daemon, redo the
122 test, and look at the debug file: /var/log/masqmail/debug.log
124 If you use a wrapper, test it manually and interactively on the
125 command line.
127 Ask on the mailing list: <masqmail@marmaro.de>
131 meillo