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 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206
|
Setting up MTAs for Debbugs
===========================
Config
------
Be sure to set the $gMailer variable correctly in /etc/debbugs/config.
The options are (all lower case) exim, qmail and sendmail.
Exim
----
I've seen two types of setting up Exim used.
1) If the machine is dedicated and all e-mail goes to the debbugs script,
add this in the transport section:
debbugs_pipe:
driver = pipe
user = <some non-root user>
group = <some non-root group>
command = /usr/lib/debbugs/receive
return_output
Do not use root user/group, it is very unsafe. You could even add a new
(locked) account "debbugs", and use that. Either user or group needs
write access.
And AT THE TOP of the directors section, add this:
debbugs:
driver = smartuser
transport = debbugs_pipe
local_parts = submit:bugs:maintonly:quiet:forwarded:done:close:request:submitter:control:^\\d+
2) If the domain is a virtual host on a machine that needs it, there are
many ways of handling it. I think the neatest was to use the above
transport and director, except to add the following line to the
director's options:
domains = <domain name>
Alternatively, Chad Miller <cmiller@surfsouth.com> suggests:
The method I discovered involved adding at the top of the routers section:
debbugs_router:
driver = domainlist
transport = debbugs_transport
route_list = "bugs.foo.bar;bugs.baz.quux"
where bugs.foo.bar and bugs.baz.quux are mail-domains for which I want to
receive bug requests only.
Next, add anywhere in the transports section:
debbugs_transport:
driver = pipe
command = /usr/lib/debbugs/receive
user = <some non-root user>
group = <some non-root group>
current_directory = /etc/debbugs
home_directory = /var/lib/debbugs/spool
(current_directory may need to be /var/lib/debbugs/spool, depending on
your setup.)
Next, the mail domains MUST NOT be in the "local_domains" list!
Instead, we MUST put them in the "relay_domains" list.
Essentially, this tells exim that we agree ("relay_domains") to relay
mail for those zones ("debbugs_router") and "send" the mail using a pipe
("debbugs_transport").
Qmail
-----
From Tommi Virtanen (tv@debian.org), amended by Daniel Ruoso
(daniel@ruoso.com):
Here's my suggestion for safe & secure installation under qmail:
Create a separate user for the debbugs system.
# adduser --system --group --home /home/misc/debbugs debbugs
Give control of a virtual domain to that user
# echo bugs.example.com:debbugs >>/etc/qmail/virtualdomains
Give the user access to the bug databases
# chown -R debbugs:debbugs /var/lib/debbugs/*
Set the BTS owner address
# echo '&me@my.example.com' >~debbugs/.qmail-owner
Make the BTS handle it's mail
# echo '|/usr/lib/debbugs/receive' >~debbugs/.qmail-default
Reload the virtualdomains config file
# /etc/init.d/qmail reload
That's it!
Sendmail
--------
From Wichert Akkerman (wakkerma@debian.org):
First of all make sure that debbugs is configured for sendmail: look
at /etc/debbugs/config for the $gMailer variable and make sure it is
set to 'sendmail'.
Next make sure that your DNS is configured properly. For sendmail
this means you cannot use a CNAME for the debbugs-domain, since that
gets remapped to the canonical name and thus bypasses the mailertable
we need. This is an example of a working DNS entry:
bugs IN 192.168.2.100
0 MX mailgate.mors.net
HINFO "PC Pentium" "Debbugs 2.0"
Now that that is finished it is time to configure sendmail itself. First
make sure that sendmail does not consider the debbugs-domain as local by
making sure it is not listed in /etc/mail/sendmail.cw . Now start your
favourite editor and load /etc/mail/sendmail.mc . We need to make two
changes
there: add a mailertable and define the debbugs delivery agent. The
mailertable is needed to tell sendmail to use the debbugs to deliver mail
destined for your debbugs server.
To enable the mailertable put the following line in your sendmail.mc file:
FEATURE(mailertable, `text -o /etc/mail/mailertable')dnl
This tells sendmail to use the textfile /etc/mail/mailertable as the
database containing the table. You can also use a db database if you
want to add a lot of entries in there since that is faster. If you
want to do that use the following line instead:
FEATURE(mailertable, `hash -o /etc/mail/mailertable.db')dnl
You can create the database using the following command:
makemap hash mailertable.db < mailertable
Where mailertable is the textfile containing the data.
The next thing we need to do is tell sendmail about the debbugs delivery
agent. To do this add the following two lines to your sendmail.mc file,
preferably just after the MAILER commands:
Mdebbugs, P=/usr/lib/debbugs/receive, F=SDFMlhudb80, U=<uid>:<gid>,
S=10/30, R=20/30, D=/tmp, T=DNS/RFC822/X-Unix, A=receive $u
Where <uid> and <gid> should be replaced with the user and group you
use for debbugs.
Okay, we are now done with sendmail.mc and are ready to add the entry
in your mailertable. Save sendmail.mc and load /etc/mail/mailertable in
your editor. Put a single line in there just like this one:
bugs.your.net debbugs:yournet
(please note there are tabs between those words). This tells sendmail that
mail destined for the host bugs.your.net should be handled by the debbugs
delivery agent using yournet as the hostname. If you decided to use a db
database instead of the plain textfile don't forget to run makemap now!
Now the final step: run sendmailconfig to regenerate sendmail.cf and
restart sendmail with the new configuration. Your system should now
be up and running. Congratulations!
Postfix
-------
It seems Bdale isn't around currently, so I'll just mail this
here directly. This is a short description of how to get debbugs
working with postfix. If someone can verify this and give me some
feedback if would be appreciated.
Lets assume that you are going to install bugs.domain.net, and you
are going to run it on the machine master.domain.net.
DNS setup: point the MX to the machine running debbugs:
bugs.domain.net MX 50 master.domain.net.
In /etc/postfix/main.cf enable the transport maps by inserting the
following line:
transport_maps = hash:/etc/postfix/transport
Now create /etc/postfix/transport and insert:
bugs.domain.net debbugs:
This tells postfix to use the debbugs transport agent to deliver any
mail send to bugs.domain.net. Now we need to make a database from that
that postfix can use:
# makemap hash transport
Now we need to teach postfix what the debbugs transport agent is. Edit
/etc/postfix/master.cf and add:
debbugs unix - n n - - pipe
flags=F user=debbugs argv=/usr/lib/debbugs/receive $recipient
This assumes that you are running debbugs with uid debbugs (the package
doesn't do that by default, but I generally chown /var/lib/debbugs/*
to a new debbugs account just to be safe).
Finally add bugs.domain.net to mydestination in main.cf:
mydestination = $myhostname localhost.$mydomain bugs.domain.org
Now that all this is done, restart postfix and it should be working..
Wichert.
|