I have a fairly default Fedora 7 installation, certainly the sendmail is just as it was installed.
How do I get sendmail to deliver mail to local destinations? The system's hostname is home.isbd.net and it's connected to the Internet via a router. I have a CNAME set up at the hosting provider that hosts isbd.net to point at the static address of my ADSL connection.
When I send mail from my system to a local address it gets the hostname added, thus mail gets sent to root@home.isbd.net, postmaster@home.isbd.net, chris@home.isbd.net, etc. All of this fails because sendmail attempts to connect to the SMTP port of home.isbd.net, which isn't possible because my router's firewall doesn't accept connections on port 25.
I don't want to open up port 25 and it seems a bit silly anyway to send mail on such a long round trip. Is there any way I can tell sendmail that home.isbd.net is localhost (or 192.168.1.1)? I have an entry for home.isbd.net in my /etc/hosts file which is:-
192.168.1.1 home home.isbd.net
but obviously sendmail is doing a DNS lookup for home.isbd.net which returns the 'external' IP address.
On 10-Nov-07 18:14:31, Chris G wrote:
Hi Chris, Have a look at
cat /etc/host.conf
It should look like:
order hosts bind multi on
The first line tells anything that's interested to look first in the /etc/hosts file; and then, if that fails, to "go DNS".
If that doesn't solve it, then there's something a bit tricky going on ... Oh the joys of editing /etc/sendmail.cf!
Best wishes, Ted.
-------------------------------------------------------------------- E-Mail: (Ted Harding) ted.harding@nessie.mcc.ac.uk Fax-to-email: +44 (0)870 094 0861 Date: 10-Nov-07 Time: 19:04:44 ------------------------------ XFMail ------------------------------
On Sat, Nov 10, 2007 at 07:04:48PM -0000, Ted Harding wrote:
Well, I'd guess that your sendmail config isn't right... You'll probably want to know about LOCAL_DOMAIN in the /etc/mail/sendmail.mc file.
If that doesn't solve it, then there's something a bit tricky going on ... Oh the joys of editing /etc/sendmail.cf!
Which, as anyone will tell you, you should never do ;) the sendmail.cf file is compiled from other sources using m4, altering the sendmail.cf could mean that you lose changes if someone decides to run the makefile...
Cheers,
On Sat, Nov 10, 2007 at 07:23:52PM +0000, Brett Parker wrote:
I have changed LOCAL_DOMAIN in the above file, have run "make -C /etc/mail" and have restarted sendmail, it still tries to send the mail out to the internet.
I have also discovered that sendmail reads a file called /etc/mail/local-host-names so I have changed that too, no joy.
I can see postfix coming along! :-)
All I *actually* want to do is to be able to see the mail that gets sent to root in my own account.
On Sunday 11 November 2007 11:17, Chris G wrote:
All I *actually* want to do is to be able to see the mail that gets sent to root in my own account.
Have you tried editing /etc/aliases ?
On my server, I have three lines:
# See man 5 aliases for format postmaster: root root: paul@fakehostname.com
[Note: fakehostname is replaced with a real domain]
You might want to try throwing chrisg@localhost in there...
Regards, Paul.
On Sat, Nov 10, 2007 at 07:04:48PM -0000, Ted Harding wrote:
I've already been there, and in /etc/nsswitch.conf, both say to use /etc/hosts first, obviously sendmail doesn't take any notice.
If that doesn't solve it, then there's something a bit tricky going on ... Oh the joys of editing /etc/sendmail.cf!
If it gets that far I'll install postfix! :-)
On 10-Nov-07 18:14:31, Chris G wrote:
Just had another thought! (I didn't look closely enough at your /etc/hosts entry the first time).
The canonical format for an entry in /etc/hosts is
IP_address canonical_hostname aliases
where as it looks as though yours is
IP_address alias canonical_hostname
which may throw sendmail off the scent. I suggest you try writing it as
192.168.1.1 home.isbd.net home
If that works, then there'll be the question of how it got written wrong in the first place. Often this is done automatically by some system script (which may well be run at each re-boot). So you may have to work round that issue ...
Hoping, again, that this helps! Ted.
-------------------------------------------------------------------- E-Mail: (Ted Harding) Ted.Harding@manchester.ac.uk Fax-to-email: +44 (0)870 094 0861 Date: 10-Nov-07 Time: 20:05:29 ------------------------------ XFMail ------------------------------