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?

4 Replies

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.

@josh-chs:

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"?

@Stever:

@josh-chs:

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.

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:

inet_interfaces = 127.0.0.1
inet_protocols = ipv4

for IPv4 and IPv6:

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:

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):

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

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct