Exim sending only to non-local emails?
Setup Send-only Mail Server with Exim on Ubuntu 10.04 LTS
For example:
$to='INSERT-EMAIL';
$subject='testing the subject';
$message='hello, looks like it works';
mail($to, $subject, $message, $headers);
INSERT-EMAIL=
INSERT-EMAIL=
INSERT-EMAIL=
What do I gotta do?
4 Replies
Maybe I can explain it better. In short:
mail() sending to
mail() sending to
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
Right, on to the next possible solution then.
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