File: INSTALL

package info (click to toggle)
dhis-mx-sendmail-engine 5.0-4
  • links: PTS
  • area: main
  • in suites: bookworm
  • size: 60 kB
  • sloc: ansic: 215; makefile: 22
file content (138 lines) | stat: -rw-r--r-- 3,665 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
Install instructions for DHIS R5 server module dhis-mx-sendmail-engine
======================================================================

This package contains a dynamic MX service module to be used
with dhisd release 5 or above and the dynamic DNS module.

While the DHIS server dhisd retrieves dynamic IP addresses
from clients, this module allows the server to deliver messages
that were previously queued for the newly online host.

In order to install dhis-mx-sendmail-engine-5.0:

	A domain under which dynamic hosts will be updated must be
	available. 

	The machine must be permanently connected to the internet
	with a static IP address.

	The machine which will act as a server should be running
	a distribution of UNIX or similar system.

	A DHIS R5 server dhisd must be running on the same machine.
	
	This module must be included in the server's service database.


1. Compile Stage
================

	If your system is System V based, edit the Makefile and add
	-lsocket -lnsl to the LIBS section. These are required 
	for TCP/IP operation.

	Being in the source directory type "make".

	You may need to edit dhis-mx-sendmail-engine.c and update the 
	sendmail path of sendmail.

	It should build the dhisd binary.

2. Install stage
================

	You will need to have dhisd installed in your system.

	Move the newly compiled module dhis-mx-sendmail-engine to
	/etc/dhis/bin

	Edit /etc/dhis/db/services.db and add a line in the form:

	mx	5	/etc/dhis/bin/dhis-mx-sendmail-engine

	In here dns identifies the service type, 5 is the number
	of processes to serve mail relay (may differ depending on 
	resources and load requirements) and the command
	is the child process for dhisd to fork into.

	Edit /etc/dhis/db/dhis.db

	For each client that is to have dynamic mail relay support
	add a line such as:
		
		Service		mx

	Terminate your current DHIS server if running with SIGTERM

	Execute your DHIS server with something like /etc/dhis/bin/dhisd 
	
	The module in installed

3. DNS stage
============

	The final stage is to configure DNS, i.e. BIND 8, to allow
	mail relaying.

	Assuming BIND is already running from the dynamic DNS module
	and configured:

	For each host in dhis.db with the mx service perform a one
	time nsupdate as follows:

	execute nsupdate

	Type in:

        >update add dyn.example.com. 86400 in mx 0 dyn4.example.com.
        >update add dyn.example.com. 86400 in mx 10 relay.example.com.

        And press return twice.


        This adds a DNS MX record for host dyn.example.com with a lower
	preference to the dynamic address and a backup relay server.

	relay.example.com must be a valid static hostname of this
	server providing mail relaying.


4. Adding mail relay to clients
===============================

	To add mail relay to clients simply:

	1) Edit dhis.db and add "service mx" to the client
	2) Add that client MX records to DNS as above
	3) Reload dhisd with -HUP


5. Setting up the mail relay agent (MTA)
========================================

	This module is based on sendmail residing on /usr/sbin/sendmail
	
	To change the location of sendmail edit dhis-mx-sendmail-engine.c
	and change the appropriate path before compiling.

	
	You will need to configure the MTA to relay messages for
	your domain (example.com). 

	All this engine does is basically receiving requests and
	issuing sendmail to deliver mail for the appropriate host.

	In sendmail:

	Add a DNS A record for relay.example.com with the server's IP
	address.

	Edit sendmail.cw and add relay.example.com

	Edit relay-domains and add example.com

	Restart sendmail

 
And that's it. The DHIS MX module is installed.