I'm trying to set something up which in my mind is simple, but I'm having a hard time finding documentation or examples that make sense to me to accomplish it. Hopefully someone can point me in the right direction.
Quick background:
I have a few hosts on my network, which I trust.
I want to allow them to send mail between each other.
For instance, I have a server machine, a desktop, and a laptop. Call them A,B, and C.
I am *not* interested in general-purpose relay functionality. In fact, I don't even want to relay from A, through B, to C (for example). I only want to directly send mail from A to B or B to C, etc.
I am also *not* interested in forwarding or relaying anything outside my LAN. As far as these machines' mail is concerned, the Internet does not exist. In fact, if I can avoid using DNS, that would be my preference, too.
In my actual situation, it is complicated by the fact that some machines are running Debian, with Exim4, while other machines are running FreeBSD, with Sendmail. But for the purpose of this discussion, i'm fine with just assuming they're all running Sendmail. Once I get the basics figured out, I can worry about the different ways of configuring different mail servers.
So, here is more-or-less what I have in mind:
Each machine A,B,C already runs a mail server for local mail. I just want to allow them to talk to some immediate neighbors in their LAN. Since it's all trusted hosts on a private network, I imagine just using plain (E)SMTP on port 25 is fine.
In short, I want to compose mail on A that has "To: user@B" (or perhaps @B.lan.net, if I must).
I think basically, I am looking for some configuration which says "accept incoming connections on port 25, but reject anything not bound for a user on _this_ system".
Has anyone done something like that?
Or is there some reason this is a Bad Idea, which might explain my inability to find such examples on the web?
I can put entries in /etc/hosts as needed, which I *think* Sendmail will use in preference to DNS.
I could even use the square-brackets [host.name] notation, which I believe circumvents DNS lookups.
But my real stumbling block is how to configure Sendmail for that use-case, on a basic level.
There is etc/mail/relay-domains, and this gets me pretty far, but I believe this means the allowed domains/hosts/etc will be allowed arbitrarily relay through the Sendmail instance configured in this way? In my case, the hosts are trusted, so perhaps it is not worth worrying about. But ideally, I would only allow incoming mail to "myself", and not allow arbitrary relaying.
Likewise, the /etc/mail/access file only has a RELAY command, not some "accept for myself only" concept that I'm looking for.
Quick background:
I have a few hosts on my network, which I trust.
I want to allow them to send mail between each other.
For instance, I have a server machine, a desktop, and a laptop. Call them A,B, and C.
I am *not* interested in general-purpose relay functionality. In fact, I don't even want to relay from A, through B, to C (for example). I only want to directly send mail from A to B or B to C, etc.
I am also *not* interested in forwarding or relaying anything outside my LAN. As far as these machines' mail is concerned, the Internet does not exist. In fact, if I can avoid using DNS, that would be my preference, too.
In my actual situation, it is complicated by the fact that some machines are running Debian, with Exim4, while other machines are running FreeBSD, with Sendmail. But for the purpose of this discussion, i'm fine with just assuming they're all running Sendmail. Once I get the basics figured out, I can worry about the different ways of configuring different mail servers.
So, here is more-or-less what I have in mind:
Each machine A,B,C already runs a mail server for local mail. I just want to allow them to talk to some immediate neighbors in their LAN. Since it's all trusted hosts on a private network, I imagine just using plain (E)SMTP on port 25 is fine.
In short, I want to compose mail on A that has "To: user@B" (or perhaps @B.lan.net, if I must).
I think basically, I am looking for some configuration which says "accept incoming connections on port 25, but reject anything not bound for a user on _this_ system".
Has anyone done something like that?
Or is there some reason this is a Bad Idea, which might explain my inability to find such examples on the web?
I can put entries in /etc/hosts as needed, which I *think* Sendmail will use in preference to DNS.
I could even use the square-brackets [host.name] notation, which I believe circumvents DNS lookups.
But my real stumbling block is how to configure Sendmail for that use-case, on a basic level.
There is etc/mail/relay-domains, and this gets me pretty far, but I believe this means the allowed domains/hosts/etc will be allowed arbitrarily relay through the Sendmail instance configured in this way? In my case, the hosts are trusted, so perhaps it is not worth worrying about. But ideally, I would only allow incoming mail to "myself", and not allow arbitrary relaying.
Likewise, the /etc/mail/access file only has a RELAY command, not some "accept for myself only" concept that I'm looking for.