masqmail

view docs/simple-relay-setup @ 310:f10a56dc7481

reworked online_detect to the simpler online_query Only pipe is supported now. Use online_query="/bin/cat /path/to/file" instead of online_detect=file online_file=/path/to/file and online_query="/path/to/some/script foo" instead of online_detect=pipe online_pipe="/path/to/some/script foo" See man page masqmail.conf(5) and admin/config-transition.
author meillo@marmaro.de
date Sun, 24 Apr 2011 19:14:38 +0200
parents 9814e75de61c
children e230bcd0f1c6
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_query = "/bin/echo default"
111 Now masqmail will send online mail automatically through the default
112 route, each time it does a queue run (every ten minutes).
115 In case of problems
116 -------------------
118 Have a look at the log file: /var/log/masqmail/masqmail.log
120 Set the debug level in masqmail.conf, restart the daemon, redo the
121 test, and look at the debug file: /var/log/masqmail/debug.log
123 If you use a wrapper, test it manually and interactively on the
124 command line.
126 Ask on the mailing list: <masqmail@marmaro.de>
130 meillo