Penguin
Blame: SendmailNotes
EditPageHistoryDiffInfoLikePages
Annotated edit history of SendmailNotes version 6, including all changes. View license author blame.
Rev Author # Line
6 AristotlePagaltzis 1 !!! SendMail as a secondary MX
1 AristotlePagaltzis 2
6 AristotlePagaltzis 3 As far as I can tell, setting up SendMail to act correctly as a secondary MX is a bit of a drag. SendMail seems to run into problems if it is a secondary MX, and it gets a message when all higher-priority MXes for the domain are down. Without special configuration, it will bounce the message with a "<tt>mail loops back to me (MX problem?)</tt>" error.
1 AristotlePagaltzis 4
5 The very first steps to setting this up are:
6
6 AristotlePagaltzis 7 Add MX records in [DNS]. For example:
1 AristotlePagaltzis 8
6 AristotlePagaltzis 9 <verbatim>
1 AristotlePagaltzis 10 mydomain.com. MX 0 preferredmx.mydomain.com.
11 MX 10 secondarymx.otherdomain.org.
6 AristotlePagaltzis 12 </verbatim>
1 AristotlePagaltzis 13
6 AristotlePagaltzis 14 MXes with the lowest numbers are given the highest priority. I'm assuming that you already have a primary setup, and that part won't be explained here.
1 AristotlePagaltzis 15
6 AristotlePagaltzis 16 Now, on the secondary (this assumes you have <tt>/etc/mail/access</tt> and <tt>/etc/mail/mailertable</tt>):
1 AristotlePagaltzis 17
6 AristotlePagaltzis 18 # Add a line containing <tt>mydomain.com RELAY</tt> to <tt>/etc/mail/access</tt>.
1 AristotlePagaltzis 19
6 AristotlePagaltzis 20 # Add a line containing <tt>mydomain.com smtp:preferredmx.mydomain.com</tt> to <tt>/etc/mail/mailertable</tt> (this is the bit that seems to commonly not be mentioned).
2 AristotlePagaltzis 21
6 AristotlePagaltzis 22 # Run <tt>make</tt> in <tt>/etc/mail</tt>. Check the timestamps of <tt>access.db</tt> and <tt>mailertable.db</tt> to be sure that they have just been regenerated. If they haven't, <tt>touch access mailertable</tt> and check your clock.
1 AristotlePagaltzis 23
6 AristotlePagaltzis 24 If you don't have a MakeFile, run <tt>makemap hash access.db < access; makemap hash mailertable.db < mailertable</tt>.
1 AristotlePagaltzis 25
6 AristotlePagaltzis 26 # Restart sendmail(8), probably <tt>/etc/init.d/sendmail restart</tt>
1 AristotlePagaltzis 27
6 AristotlePagaltzis 28 # Try sending a test message from a local address through the secondary to <tt>something@mydomain.com</tt>.
1 AristotlePagaltzis 29
6 AristotlePagaltzis 30 You should be all set. Try making the primary unreachable from the secondary, just to be sure, and repeat step 6. The easiest way to make it unreachable is to log into <tt>preferredmx</tt> and do <tt>route add secondarymx.otherdomain.org dev lo</tt>. By doing this you are (temporarily) adding a bad route between the two boxes. __If you don't understand the implications of that, you probably don't want to do it. ''Do not'' do that if you are presently logged into <tt>preferredmx</tt> from <tt>secondarymx</tt>, and that is the only way you can reach <tt>preferredmx</tt>.__ Be sure to <tt>route del secondarymx.otherdomain.org dev lo</tt> after you are done testing.
1 AristotlePagaltzis 31
6 AristotlePagaltzis 32 !!! <tt>make</tt> in <tt>/etc/mail</tt> doesn't build <tt>sendmail.cf</tt>
3 GreigMcGill 33
6 AristotlePagaltzis 34 You just updated your <tt>/etc/mail/sendmail.mc</tt>, but when you run <tt>make</tt>, nothing happens. If you manually try to make <tt>sendmail.cf</tt> using m4(1), you get an error along the lines of:
3 GreigMcGill 35
6 AristotlePagaltzis 36 <verbatim>
37 sendmail.mc:10: m4: Cannot open /usr/share/sendmail-cf/m4/cf.m4: No such file or directory
38 <verbatim>
3 GreigMcGill 39
6 AristotlePagaltzis 40 If you run RedHat, this means you need to install the <tt>sendmail-cf</tt> [Package].
3 GreigMcGill 41
6 AristotlePagaltzis 42 Why there is a seperate package for people who want to actually ''configure'' SendMail, I don't know.
2 AristotlePagaltzis 43
44 ----
6 AristotlePagaltzis 45 Part of UserSubmittedNotes