external mailserver and edit domainowners file

olanjouw

Verified User
Joined
Jan 9, 2005
Messages
9
hi,

im using DA on a shared server so i dont have root access
i want to use my own mailserver.
this is easy to do and is working well
But to make this work i did have to disable the mail functions on the server (In mx record settings window)
For my website im using some scripts which are using sendmail, those scripts arent working anymore since i disabled the internal mail server function.

I found this thread:
http://www.directadmin.com/forum/archive/index.php/t-2581.html

and it looks like i have to edit the domainowners file in etc/virtual/domainowners

is this the correct solution for my problem?
and can i do this myself or do i have to ask the hostingcompany?

thanks
Otto
 
If you check in your control panel for MX Records and make sure the MX record is pointing to your server and the Use this server to handle my emails option is unchecked, the /etc/virtual/domainowners file will be properly configured.

This was added to DirectAdmin after the post you saw was made.

Jeff
 
Thanks for reply.
I have unchecked that box and normal mail is handled by new mailserver.
But the sendmail scripts on my website arent working anymore.
when i change it back to the da server mail and check the box for 'use this milserver' the scripts are working fine...
any idea?
 
Sendmail scripts won't work because the local server knows you're no longer an authorized sender.

Can you modify your scripts to use port 25 injection?

Try it on one first; I'm not sure if it'll work. You might have to make the username a trusted user in exim.conf.

Otherwise you might have to try modifying yor scripts to use your new mailserver.

Jeff
 
i have full access to the scripts but im not a programmer.....
this is part of the most simple script
it has nothing to do with DA but do you know how to inject port 25?
thanks

switch($op) {
case "sendmail":
sendmail($text, $from, $name, $email_to, $sitename);
break;
default:
contactpage($database, $dbprefix, $contact, $absolute_path, $lang, $sitename);
}

function contactpage($database, $dbprefix, $contact, $absolute_path, $lang, $sitename){
$query = "select * from ".$dbprefix."contact_details where id=1";
$result = $database->openConnectionWithReturn($query);
list ($id, $companyname, $ACN, $address, $suburb, $state, $country, $postcode, $telephone, $fax, $email_to)=mysql_fetch_array($result);

$contact->contactpage($id, $companyname, $ACN, $address, $suburb, $state, $country, $postcode, $telephone, $fax, $email_to, $absolute_path, $lang, $sitename);
}

function sendmail($text, $from, $name, $email_to, $sitename){
if ((isset($text)) && (isset($from))){
$to = $email_to;
$subject = $sitename." "._ENQUIRY;
$text= _ENQUIRY_TEXT." ".$name."\n".stripslashes($text);
$from2=_FROM." $name <$from>";
mail ($to, $subject, $text, $from2);?>
<SCRIPT> alert("<?php echo _THANK_MESSAGE; ?>"); document.location.href='index.php?option=contact';</SCRIPT>
<?php }
}
?>
 
Most scripts I've seen have a configuration that give you a choice. What you want to do is open a path to port 25 on localhost and send the mail that way.

Jeff
 
thanks for reply and help.

But just to be sure, it is correct that if you want to use your own mailserver you have to uncheck the "use local mail server" box?

and when you uncheck that box sendmail doenst work anymore on that domain and the only solution is to change all the scripts that uses sendmail?

thanks
 
Unless DA controls your domain, why can't you just change the DNS MX records to use a different IP/Mail server through the provider's control panel?

For example if I registered a domain name at freeparking.co.uk, I can modify the DNS records to point www.domain.com to my web server (with DA on it) and mail.domain.com + any mail records to my mail server (without DA). If that makes sense...
 
Unless the box is unchecked any mail coming through or orginating on your server won't ever get to the "real" server because exim will think that the mail belongs on the local server.

When the domain is created, exim is told it's a local domain. Unchecking the box simply tells exim the domain isn't a local domain.

Jeff
 
Back
Top