How to get mail to local destinations delivered?

Tim ignored_mailbox at yahoo.com.au
Sun Nov 11 14:04:00 UTC 2007


Chris G:
>> I have tried:-
>>   chris at localhost
>>   chris at 192.168.1.1
>>   chris@[192.168.1.1]
>> and sendmail tries to send the *all* to the outside world!


Gijs:
> You can send root's mail to a user like so (in /etc/aliases):
> root: chris
> 
> But if you really want mail to get delivered to an emailaddress
> without going through the internet, you'll have to setup your own
> pop3/imap server, along with corresponding domain-setups (like John
> already mentioned before).

Not necessarily...  You can have a mail client directly get mail from
the /var/mail/<username> file, and avoid running a POP or IMAP server.
You still need to configure sendmail, though, so it understands the
address you're giving root's mail to is for local delivery (sendmail
keeps the mail internal).  To that end, username at localhost ought to work
straight away.  If you had a private domain name for your system, you
can use that, instead.  But you have to set up sendmail to accept that
domain for local delivery.

> Setting your email address in the aliases file does mean its a long
> round trip for the email, but in the end the mail does get delivered
> to the correct person. 

If you're talking about setting a public internet email address in the
aliases file, that mightn't work without even more extensive sendmail
configuring than already discussed.  The system will try to send the
mail *from* root at localhost (or root at localmachineaddress) to the aliased
address, and external mail servers will usually refuse to pass on a
message with such a "from address".

How did I manage this?  I do run a local POP3/IMAP server.  My root mail
goes to my local username, sendmail has a mail spool file for me, my
sendmail is configured to deliver such mail locally (it handles it
itself, it doesn't try to send it to an external server).  My local mail
client fetches mail from my local mail spool.  I also use my local mail
as the collection point for all my internet mail - a fetchmail process
drags it all in, and dumps it all there, every few minutes.  This means
I can deal with *all* of my mail from any IMAP mail client that can
access my IMAP server.

Having several terminals that I might use email on, and not wanting to
SSH everywhere, I found this convenient.  I can even make the IMAP
server accessible remotely, if I wanted to.  I'd only do so using a
secure protocol, though.  I wouldn't want spammers abusing it.

-- 
(This computer runs FC7, my others run FC4, FC5 & FC6, in case that's
 important to the thread.)

Don't send private replies to my address, the mailbox is ignored.
I read messages from the public lists.




More information about the fedora-list mailing list