On Mon, Nov 28, 2005 at 11:55:16AM -0500, jeff wrote:
> OK, I'm stumped with this one. I am trying to set up a home email server
> with Mepis SOHO to filter ISP email for the family. All that is required is
> for the server to fetch the mail from the ISP, scan it, and store it
> locally in the users accounts where they can retrieve it from their
> computers.
>
> On the server, root can send mail to any user, and any user can send to
> another user. And the users can read their emails on the server. That part
> works fine.
>
> >From the other computers, users can read their email that is on the server.
> That part is working fine.
>
> So I set fetchmail to get mail from the ISP pop server. Fetchmail gets the
> mail, spamassassin runs, and the mail disappears. The server logs say that
> the mail is being bounced because it can't find a user to deliver to and
> that there is not a fqdn. Postfix is not configured to send to the ISP so
> it doesn't actually bounce, and fetchmail seems to be unable to hand off
> mail to the user accounts, so the mail is lost.
Are you sure that spamassassin isn't configured in such a way that it is
causing the emails to be lost? If that's the case, looking at fetchmail
probably won't help much. It's not clear to me, from your explanation
of what's happening, where exactly it's getting lost.
>
> What is wrong with the configuration that local mail works until fetchmail
> gets mail from the ISP? And why is fetchmail unable to find the user
> accounts?
I think [I|we] would need to see your .fetchmailrc before any definitive
answers could be offered. If you post it to the list, make sure you
don't forget to obscure any passwords that might appear in the file.
I'm pasting the main text of a brief howto I wrote about fetchmail
configuration some time ago. The paste isn't pretty, but it's serviceable,
I think:
When Fetchmail is first installed, you probably won't have a .fetchmailrc in your home directory and, if you do, you will have to do some configuration anyway. The first thing to do is open (or create) .fetchmailrc in your user account's home directory (probably /home/[user] or ~/[user]). In general, when signed in as a given user, you can get to that account's home directory simply by entering cd at the command line without any arguments.
Within that file, you need to include some information so that fetchmail knows where to get your email and what to do with it once it has gotten it. You'll want to include configuration options such as the following in the .fetchmailrc file, each one on a separate line:
set postmaster [user]
The purpose of this one is to ensure that the email actually goes to the username you'll be using to check your email.
set bouncemail
This should be the default for Fetchmail on your system, but it's worth being certain. If this is set to "no bouncemail" instead of "bouncemail", the sender of an email won't get direct notifications that mail has bounced. Instead, it will go to the postmaster. Since you're setting yourself as the postmaster, this shouldn't be a problem, but again, it's worth being sure.
set no spambounce
This is to prevent bouncing of spam. You usually don't want spammers to get bounces because that just indicates that there's someone listening at the other end, and they might send more.
set properties ""
This is actually ignored by Fetchmail, as far as I can tell, but separate extensions to Fetchmail might make use of it. Give it an empty string by setting it to "" (two double-quotes next to each other with no intervening space) to ensure this field is treated as blank unless you have some specific reason to do otherwise.
set daemon [n]
In this, replace the [n] with a number of seconds between mail checks you want it to perform. Setting the daemon option tells fetchmail to run as a background process that polls your email server on a regularly scheduled basis for new email. If you'd rather just manually run the fetchmail command every time you want to see if you have mail, leave this line out of your configuration file entirely.
poll [url] with proto POP3
user '[login]' there with password '[pass]' is '[user]' here
Believe it or not, that's pretty much it. That last entry requires a little extra explanation, though.
The "poll" entry tells Fetchmail where to go looking for email. You must enter the fully qualified domain name (FQDN) of the email server where incoming mail is stored in place of [url] in the above example. This should be something like "mail.domain.com" (without quotes). The POP3 part of that specifies the mail protocol being used, and is an assumption on my part, but chances are good that either you're using POP3 or you'll know what you should do instead of that.
On a second line below the poll line, replace [login] with your login name on the mail server (probably not exactly the same as your username on the local system where you'll be running Fetchmail). Replace [pass] with the password you use on the mail system to authenticate. Entries surrounded by single quotes must remain surrounded by single quotes.
Some of you out there might be surprised to see that the .fetchmailrc file uses plain text password storage. Clearly, this is not the most secure method of storing information in existence, but as long as you're on a trusted system where you maintain strict access control at all times, you should be okay. If you're not, you should look into other options for getting email, such as using a mail user agent (MUA) that does its own email retrieval.
For those who use command-line email clients like Mutt or Mail and don't want to screw around with complex mail retrieval options, Fetchmail is a capable little tool. It has a lot of configuration options at which I haven't even hinted here, that you can read about by way of web searches or using the man fetchmail command at the shell prompt.
To wrap this up, I'll post the text of a .fetchmailrc file I use, edited to block out usernames and passwords with metasyntactic variables (foo, bar, baz) instead:
set postmaster "foo"
set bouncemail
set no spambounce
set properties ""
set daemon 600
poll www.apotheon.com with proto POP3
user 'bar' there with password 'baz' is 'foo' here
As you can see, I've set it to poll for new email once every ten minutes (600 seconds) and the username I use for both the user assignment at the end and the postmaster assignment at the beginning is the same.
-- Chad Perrin [ CCD CopyWrite | http://ccd.apotheon.org ]unix virus: If you're using a unixlike OS, please forward this to 20 others and erase your system partition.
This archive was generated by hypermail 2.1.3 : Fri Aug 01 2014 - 20:18:10 EDT