Dan Brown wrote:
> For a variety of complex reasons, I'm trying to set up
> fetchmail to run on my e-smith box (which already runs as its
> own mail server), fetch e-mail from my ISP's mail account, and
> drop that into one of the e-smith accounts. The account at the
> ISP is danb35, and the account on my e-smith box is dan.
>
> For now, I've set up a .fetchmailrc file in /root, and I've
> included the line "user danb35 is dan". Fetchmail
> connects to the ISP, downloads the mail, and tries to forward
> it to "dan@localhost", which then bounces as
> "unknown host: localhost". If I change the line to
> "user danb35 is dan@danb.mine.nu", it works fine.
Good, although I would recommend that you use the dan account for this, rather than the root account.
> So, I'm left with two questions: (1) shouldn't the mail server
> recognize localhost as a valid hostname?
No. "localhost" should, and does, resolve to an IP address, but there's no reason that the mail server should accept email which has that address. If you think about it, it's not a very useful email address to have...
> (2) is there a better way of setting this up?
You seem to have a good solution already, don't you? You could also look at the "--domainname" option to fetchmail.
Charlie