1Simple Setup
2============
3
4You 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
12This is like the simple-local-setup plus the forwarding.
13
14
15Set up
16------
17
18Follow the description in INSTALL.
19
20Most times it's simply:
21
22    ./configure
23
24
25Configuration
26-------------
27
28You need a config file like this one:
29
30    host_name = "foo.example.org"
31    query_routes.default = /etc/masqmail/default.route
32
33(Substitute a real hostname, of course.)
34
35Addionally 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"
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"
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
60Starting the daemon
61-------------------
62
63Listening for SMTP connections on a port requires masqmail to run as
64daemon. You probably want to start masqmail as daemon each time the
65system 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
67seems to be frequently available.
68
69    /usr/local/sbin/masqmail -bd -q10m
70
71This starts masqmail in daemon mode and does a queue run every ten
72minutes.
73
74
75Check the setup
76---------------
77
78Like in simple-local-setup plus ...
79
80Send a mail to a remote location:
81
82    $ echo "some text" | mail foo@somewhereelse.example.org
83
84Check if it is queued:
85
86    $ masqmail -bp
87
88Deliver it with:
89
90    $ masqmail -qo default
91
92Check the queue contents again.
93
94You need to do such queue runs for online routes explicitely. For
95instance by cron.
96
97
98Automatic queue runs
99--------------------
100
101You can also tell masqmail to send queued mails through a route each
102time the daemon does a queue run. Therefor you need to tell masqmail
103that it is online and can use the default route to deliver mail.
104
105Add this to masqmail.conf:
106
107    online_query = "/bin/echo default"
108
109Now masqmail will send online mail automatically through the default
110route, each time it does a queue run (every ten minutes).
111
112
113In case of problems
114-------------------
115
116Have a look at the log file: /var/log/masqmail/masqmail.log
117
118Set the debug level in masqmail.conf, restart the daemon, redo the
119test, and look at the debug file: /var/log/masqmail/debug.log
120
121If you use a wrapper, test it manually and interactively on the
122command line.
123
124Ask on the mailing list: <masqmail@marmaro.de>
125
126
127
128meillo
129