Linode Forum
https://forum.linode.com/

Exim sending only to non-local emails?
https://forum.linode.com/viewtopic.php?f=11&t=7875
Page 1 of 1

Author:  josh-chs [ Wed Oct 05, 2011 6:38 pm ]
Post subject:  Exim sending only to non-local emails?

Ok, tried searching for answers to this one, but no go so....

Setup Send-only Mail Server with Exim on Ubuntu 10.04 LTS and it seems to only send to emails outside of our domain.

For example:

$to='INSERT-EMAIL';
$subject='testing the subject';
$message='hello, looks like it works';
mail($to, $subject, $message, $headers);

INSERT-EMAIL=me@yahoo.com - check
INSERT-EMAIL=me@non-linode-site.com - check

INSERT-EMAIL=me@linode-site.com - nothing

What do I gotta do?

Author:  josh-chs [ Fri Oct 07, 2011 10:10 am ]
Post subject: 

Nothing, eh?

Maybe I can explain it better. In short:

mail() sending to me@some-other-site.com - works great

mail() sending to me@linode-site.com - does not work

I just don't get it.

Author:  Stever [ Fri Oct 07, 2011 10:30 am ]
Post subject: 

josh-chs wrote:
mail() sending to me@linode-site.com - does not work

What exactly would you expect to happen to local mail from a "Send-Only Mail Server"?

Author:  josh-chs [ Fri Oct 07, 2011 10:45 am ]
Post subject: 

Stever wrote:
josh-chs wrote:
mail() sending to me@linode-site.com - does not work

What exactly would you expect to happen to local mail from a "Send-Only Mail Server"?


*sigh* :oops:

Right, on to the next possible solution then.

Author:  skavoovie [ Mon Oct 10, 2011 12:45 am ]
Post subject: 

So you want to be able to send mail locally, and from localhost to the world, but not accept any mail from the world?

If so, Postfix out of the box on many distros will already be configured to do exactly that. You will simply need to configure your domain(s) and confirm what interfaces your instance of Postfix will bind to.

Configure Postfix to only accept inbound relaying to the loopback interface(s):


for IPv4 only:

Code:
inet_interfaces = 127.0.0.1
inet_protocols = ipv4



for IPv4 and IPv6:
Code:
inet_interfaces = 127.0.0.1, [::1]
inet_protocols = all



From there, just configure the following values with your domain (read the comments in the main.cf file for help in knowing what to configure these with), and restart Postfix:
Code:
myhostname
mydomain
myorigin
mydestination


For mydestination, I would recommend the following once you've configured myhostname and mydomain (plus any other domains you want to be aliases locally):
Code:
mydestination = $myhostname, $mydomain, localhost.$mydomain, localhost


That's pretty much the bare minimum that will get you up and running. Local mail to local users will be delivered to the mail spool file or user maildir as configured in main.cf (review the comments to see to configure this -- they are very straight-forward), Postfix won't even bind to any public interface, and mail sent from the local machine to the world will be relayed out from whatever domain you have myorigin configured as.

HTH

Page 1 of 1 All times are UTC-04:00
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/