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