<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
<br>
<br>
David Booth wrote:
<blockquote cite="mid:7185563C40D9447B9871BA54A5C56192@DAVID"
 type="cite">
  <meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
  <meta content="MSHTML 6.00.6000.17063" name="GENERATOR">
  <div><b>From:</b> <a moz-do-not-send="true"
 title="mailto:bhughes@elevating.com
CTRL + Click to follow link"
 href="mailto:bhughes@elevating.com">Bret Hughes</a> </div>
  <div
 style="font-family: Tahoma; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">
  <div
 style="background: rgb(245, 245, 245) none repeat scroll 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;">
  <div><b>Sent:</b> Thursday, July 08, 2010 6:18 AM</div>
  <div><b>To:</b> <a moz-do-not-send="true"
 title="blueonyx@blueonyx.it" href="mailto:blueonyx@blueonyx.it">BlueOnyx
General Mailing List</a> </div>
  <div><b>Subject:</b> [BlueOnyx:04983] Re: disable all email</div>
  </div>
  </div>
  <div><br>
  </div>
  <br>
  <br>
Michael Stauber wrote:
  <blockquote cite="mid:201007071129.48432.mstauber@blueonyx.it"
 type="cite">
    <pre wrap="">Hi Bret,

  </pre>
    <blockquote type="cite">
      <pre wrap="">I have a client that has about 120 sites that are now only webservices
with no email.  Dns is working and all email outside the box works
fine.  The issue is that as they were setting stuff up they did not
disable the email for the sites and/or remove the localhostname
aliases.  I suspect I can remove all the entries in
/etc/mail/local-host-names that are troublesome but it appears that the
gui will not reflect that email is disabled and some (all?) of the
entries will be put back someone changes something email related.

For instance :

Site name <a moz-do-not-send="true" class="moz-txt-link-abbreviated"
 href="http://www.mydomain.com">www.mydomain.com</a> has  an  Email Server Alias of mydomain.com

There is an entry in /etc/mail/local-host-names for both
<a moz-do-not-send="true" class="moz-txt-link-abbreviated"
 href="http://www.mydomain.com">www.mydomain.com</a> and mydomain.com

disabling email in the gui does not affect that
    </pre>
    </blockquote>
    <pre wrap=""><!---->
Yes, because /etc/mail/local-host-names is the wrong place for that.

When you tick the box for "disable all email" for a site, then the following 
lines gets added to /etc/mail/access:

### Start Block Email for Virtual Site: site4.smd.net ###
<a moz-do-not-send="true" class="moz-txt-link-abbreviated"
 title="http://www.site-in-question.com
CTRL + Click to follow link"
 href="http://www.site-in-question.com">www.site-in-question.com</a>           ERROR:5.1.1:550 User unknown
### END Block Email for Virtual Site: site4.smd.net ###

That'll then make sure that all email to that site is rejected with a "User 
unknown" message.

  </pre>
  </blockquote>
  <br>
I don't think I need the user to be rejected. I need sendmail to not
even try to deliver locally.  It feels like this is what is happening:<br>
  <br>
A web form on <a moz-do-not-send="true"
 class="moz-txt-link-abbreviated"
 title="http://www.mydomain.com
CTRL + Click to follow link"
 href="http://www.mydomain.com">www.mydomain.com</a> generates an email
for <a moz-do-not-send="true" class="moz-txt-link-abbreviated"
 href="mailto:someone@mydomain.com">someone@mydomain.com</a><br>
PHP calls sendmail on the local box <br>
sendmail looks in its config to see if it is supposed to handle mail
for mydomain.com<br>
if it is it delivers the mail locally<br>
if it is not it does a dns call to find the mx record for mydomain.com
and sends the mail to that ipaddress<br>
  <br>
It is the latter that I need to have happen.  <br>
I want mail to be sent to mydomain.com users just not on this box.  It
sounds like I can get close by removing the entries in local-host-names
and restarting sendmail.<br>
  <br>
Where are the records stored for the email aliases for the sites so I
can at least remove them programatically.<br>
Does anyone know?<br>
  <br>
Thanks for the response,<br>
  <br>
Bret<br>
  <br>
  <p>
  </p>
  <div> </div>
  <div><font face="Arial" size="2">So you want mail for that domain to
be sent to a different ip address w.x.y.z?</font></div>
  <div><font face="Arial" size="2">You do that with a line in
/etc/mail/access</font></div>
  <div> </div>
  <div><font face="Arial" size="2">mydomain.com    RELAY</font></div>
  <div> </div>
  <div><font face="Arial" size="2">and another line in
/etc/mail/mailertable</font></div>
  <div> </div>
  <div><font face="Arial" size="2">mydomain.com    smtp:w.x.y.z</font></div>
  <div> </div>
  <div><font face="Arial" size="2">Then</font></div>
  <div> </div>
  <div><font face="Arial" size="2">cd  /etc/mail</font></div>
  <div><font face="Arial" size="2">make</font></div>
  <br>
</blockquote>
That is helpful David I did not know you could do that.  It is not as
clean as just not handing mail at all for that domain though.  I
suspect that the access file will get overwritten and have no idea if
BX does anything with mailertable. <br>
<br>
I am looking at the code now.   I got as far as the ccephp_set call and
am now installing svn locally so I can checkout the C code and see
where all this is stored.  I had hoped that the separation of services
was built into the design but I guess it is not and I will need a work
around until I get the underlying stuff figured out.  I am leaning
toward cron overwriting the file and restarting sendmail when the
local-host-name file changes at this point. At least that will not get
lost with a software update to the BX code as it would if I dink with
either the php or the c code.  I am not really a C coder by any means
and as such am hesitant to really get into it but am curious how it all
fits together now.  I have never looked at code that adds functions to
php so it is interesting to me.<br>
<a class="ext-link" href="https://devel.blueonyx.it/repos/trunk/"><span
 class="icon"></span></a><br>
</body>
</html>