]> git.donarmstrong.com Git - debbugs.git/blob - debian/README.mail
[project @ 2002-10-18 02:20:16 by cjwatson]
[debbugs.git] / debian / README.mail
1 Setting up MTAs for Debbugs
2 ===========================
3
4 Config
5 ------
6 Be sure to set the $gMailer variable correctly in /etc/debbugs/config.
7 The options are (all lower case) exim, qmail and sendmail.
8
9 Exim
10 ----
11 I've seen two types of setting up Exim used.
12
13  1) If the machine is dedicated and all e-mail goes to the debbugs script,
14     add this in the transport section:
15
16 debbugs_pipe:
17   driver = pipe
18   user = <some non-root user>
19   group = <some non-root group>
20   command = /usr/lib/debbugs/receive
21   return_output
22
23     Do not use root user/group, it is very unsafe. You could even add a new
24     (locked) account "debbugs", and use that. Either user or group needs
25     write access.
26
27     And AT THE TOP of the directors section, add this:
28
29 debbugs:
30   driver = smartuser
31   transport = debbugs_pipe
32   local_parts = submit:bugs:maintonly:quiet:forwarded:done:close:request:submitter:control:^\\d+
33
34  2) If the domain is a virtual host on a machine that needs it, there are
35     many ways of handling it.  I think the neatest was:
36
37 debbugs:
38   driver = aliasfile
39   domains = <domain name>
40   file = /usr/lib/debbugs/receive
41   user = <some user>
42   group = <some group>
43   current_directory = /var/lib/debbugs/spool
44   home_directory = /var/lib/debbugs/spool
45
46 Qmail
47 -----
48 From Tommi Virtanen (tv@debian.org), amended by Daniel Ruoso
49 (daniel@ruoso.com):
50
51 Here's my suggestion for safe & secure installation under qmail:
52         
53 Create a separate user for the debbugs system.
54         # adduser --system --group --home /home/misc/debbugs debbugs
55 Give control of a virtual domain to that user
56         # echo bugs.example.com:debbugs >>/etc/qmail/virtualdomains
57 Give the user access to the bug databases
58         # chown -R debbugs:debbugs /var/lib/debbugs/*
59 Set the BTS owner address
60         # echo '&me@my.example.com' >~debbugs/.qmail-owner
61 Make the BTS handle it's mail
62         # echo '|/usr/lib/debbugs/receive' >~debbugs/.qmail-default
63 Reload the virtualdomains config file
64         # /etc/init.d/qmail reload
65 That's it!
66         
67 Sendmail
68 --------
69 From Wichert Akkerman (wakkerma@debian.org):
70
71 First of all make sure that debbugs is configured for sendmail: look
72 at /etc/debbugs/config for the $gMailer variable and make sure it is
73 set to 'sendmail'.
74
75 Next make sure that your DNS is configured properly. For sendmail
76 this means you cannot use a CNAME for the debbugs-domain, since that
77 gets remapped to the canonical name and thus bypasses the mailertable
78 we need. This is an example of a working DNS entry:
79
80         bugs            IN      192.168.2.100
81                                 0 MX mailgate.mors.net
82                                 HINFO "PC Pentium" "Debbugs 2.0"
83
84 Now that that is finished it is time to configure sendmail itself. First
85 make sure that sendmail does not consider the debbugs-domain as local by
86 making sure it is not listed in /etc/mail/sendmail.cw . Now start your
87 favourite editor and load /etc/mail/sendmail.mc . We need to make two
88 changes
89 there: add a mailertable and define the debbugs delivery agent.  The
90 mailertable is needed to tell sendmail to use the debbugs to deliver mail
91 destined for your debbugs server.
92
93 To enable the mailertable put the following line in your sendmail.mc file:
94
95         FEATURE(mailertable, `text -o /etc/mail/mailertable')dnl
96
97 This tells sendmail to use the textfile /etc/mail/mailertable as the
98 database containing the table. You can also use a db database if you
99 want to add a lot of entries in there since that is faster. If you
100 want to do that use the following line instead:
101
102         FEATURE(mailertable, `hash -o /etc/mail/mailertable.db')dnl
103
104 You can create the database using the following command:
105
106         makemap hash mailertable.db < mailertable
107
108 Where mailertable is the textfile containing the data.
109
110 The next thing we need to do is tell sendmail about the debbugs delivery
111 agent. To do this add the following two lines to your sendmail.mc file,
112 preferably just after the MAILER commands:
113
114 Mdebbugs,       P=/usr/lib/debbugs/receive, F=SDFMlhudb80, U=<uid>:<gid>,
115                 S=10/30, R=20/30, D=/tmp, T=DNS/RFC822/X-Unix, A=receive $u
116
117 Where <uid> and <gid> should be replaced with the user and group you
118 use for debbugs.
119
120 Okay, we are now done with sendmail.mc and are ready to add the entry
121 in your mailertable. Save sendmail.mc and load /etc/mail/mailertable in
122 your editor. Put a single line in there just like this one:
123
124         bugs.your.net           debbugs:yournet
125
126 (please note there are tabs between those words). This tells sendmail that
127 mail destined for the host bugs.your.net should be handled by the debbugs
128 delivery agent using yournet as the hostname. If you decided to use a db
129 database instead of the plain textfile don't forget to run makemap now!
130
131 Now the final step: run sendmailconfig to regenerate sendmail.cf and
132 restart sendmail with the new configuration. Your system should now
133 be up and running. Congratulations!
134
135 Postfix
136 -------
137 It seems Bdale isn't around currently, so I'll just mail this
138 here directly. This is a short description of how to get debbugs
139 working with postfix. If someone can verify this and give me some
140 feedback if would be appreciated.
141
142 Lets assume that you are going to install bugs.domain.net, and you
143 are going to run it on the machine master.domain.net.
144
145 DNS setup: point the MX to the machine running debbugs:
146
147         bugs.domain.net         MX      50      master.domain.net.
148
149 In /etc/postfix/main.cf enable the transport maps by inserting the
150 following line:
151
152         transport_maps = hash:/etc/postfix/transport
153
154 Now create /etc/postfix/transport and insert:
155
156         bugs.domain.net        debbugs:
157
158 This tells postfix to use the debbugs transport agent to deliver any
159 mail send to bugs.domain.net. Now we need to make a database from that
160 that postfix can use:
161
162         # makemap hash transport
163
164 Now we need to teach postfix what the debbugs transport agent is. Edit
165 /etc/postfix/master.cf and add:
166
167         debbugs   unix  -       n       n       -       -       pipe
168                 flags=F user=debbugs argv=/usr/lib/debbugs/receive $recipient
169
170 This assumes that you are running debbugs with uid debbugs (the package
171 doesn't do that by default, but I generally chown /var/lib/debbugs/*
172 to a new debbugs account just to be safe).
173
174 Finally add bugs.domain.net to mydestination in main.cf:
175
176         mydestination = $myhostname localhost.$mydomain bugs.domain.org
177
178 Now that all this is done, restart postfix and it should be working..
179
180 Wichert.