Click to See Complete Forum and Search --> : sendmail, fetchmail, procmail


MarkLeong
09-20-2001, 03:32 AM
I am trying to configure sendmail as an internal mail server and at the same time retrieve external mails from ISP.

My fetchmail file looks like:-


poll pop.someserver.com
protocol pop3
localdomains localhost
no dns
no envelope
user mark%someserver.com with password somepassword
is mark here


The procemailrc file looks like:-

LOGFILE=/var/log/procmail
VERBOSE=on
:0:
* (^To|^cc).*mark@someserver.com
!mark@server1.myownserver.com


When I execute fetchmail it connected to the external pop server by I got the following error:-

fetchmail: SMTP connect to local host failed
fetchmail: can't raise the listener
and so on so forth......

What could be wrong?

What is the relationship between sendmail, fetchmail and procmail?

I am pretty sure sendmail is working as I could send mail internally and to external mail boxes.

Craig McPherson
09-20-2001, 06:58 AM
Originally posted by MarkLeong:
<STRONG>fetchmail: SMTP connect to local host failed</STRONG>

You have to have an SMTP server running on the machine in order for fetchmail to work -- otherwise it has no way of actually delivering the mail it downloads.

MarkLeong
09-20-2001, 08:43 AM
Yes, sendmail is working. I could send mails internally and to external servers.

I could telnet 192.168.0.105 25 (192.168.0.5 is the ip of the mail server).

Somehow I could not telnet 127.0.0.1 25. I think the problem is here. But what should I change/configure?

Also, do I need fetchmail and procmail together? Can I just use procmail without sendmail? At the moment I am placing fetchmailrc and procmailrc in my home directory. Can I fetchmail at certain intervals without logging in?

Craig McPherson
09-20-2001, 01:34 PM
Originally posted by MarkLeong:
<STRONG>I could telnet 192.168.0.105 25 (192.168.0.5 is the ip of the mail server). Somehow I could not telnet 127.0.0.1 25. I think the problem is here. But what should I change/configure?</STRONG>

Ahh. That's your problem. Fetchmail tries to connect to localhost:25, but it looks like your loopback interface may not be up at all.

Can you ping 127.0.0.1? Can you ping the hostname "localhost"? If the first is false, your loopback interface isn't up. If the second is false, you should add a "localhost" entry to /etc/hosts. If both are true, then your problem is with Sendmail not binding to the localhost interface. You'd have to check your Sendmail configuration for that. I can't help you with it.

Also, do I need fetchmail and procmail together?

Fetchmail is for downloading mails from POP and IMAP servers and passing them off to your SMTP server. Procmail is for filtering mail. Do you need them both together? If all the "filtering" you want to do is to just put the right mail in the right mailbox, fetchmail can already do that -- assuming it's running as root.

Can I just use procmail without sendmail?

Well, as mentioned, you need an SMTP server (like sendmail) if you want to send mail directly from your machine, or if you want to recieve mail directly at your machine, or if you want to download mail to your machine using fetchmail.

At the moment I am placing fetchmailrc and procmailrc in my home directory. Can I fetchmail at certain intervals without logging in?

Fetchmail has a "daemon mode" where it can poll any number of servers at specified intervals and distribute the mail it downloads into any number of mailboxes. I haven't used it before, so you'll have to look it up in the docs.

MarkLeong
09-23-2001, 11:50 PM
I could ping 127.0.0.1 and localhost but still could not telnet 127.0.0.1 25.

I have also commented out the DaemonOption line in the sendmail.cf file.

The problem is still there.

Any help?

MarkLeong
09-24-2001, 02:47 AM
Its working now - after I reboot the computer.

Guest I have to comment out the DaemonOption line. Otherwise sendmail will only bind to the ip indicated.

Does anybody know how to configure sendmail so that it only dispatch mail at 1 hour intervals. At the moment sendmail dispatches mail whenever one is received.

How do I get fetchmail to fetch mail at 0.5 hourly intervals without logging in to any user account?

posterboy
09-24-2001, 05:54 AM
fetchmail -d 3600 is what I use. -d makes it a daemon, and the interval to poll
is in seconds.

I don't know how to make sendmail "hold" the mail until a certain time, but I do know that's doable. Read the sendmail newsgroup, or post there, some real gurus hang out on that group. Don't forget to carefully review /var/log/maillog, a really good blow-by-blow is in there for anything that fails. If you know the drill, you can telnet into your (or anybody's) sendmail and make it compose and send mail from a telnet session, very informative when things are not working. Good Luck, Ray

MarkLeong
09-24-2001, 11:43 PM
Thanks posterboy.

If I have serveral user account in the Linux machine, whose fetchmailrc file will be used when running fetchmail as daemon?

posterboy
09-25-2001, 05:47 AM
I think it's commonly run as a root owned process, often started during boot. It's going to get any users mail from any server that is listed in the rc file, so it doesn't matter. Here, root can never get any mail, anyway, as that account is aliased to the user I operate under.

MarkLeong
09-25-2001, 09:25 AM
Sorry but I do not get it. So where do I put the fetchmailrc file?

posterboy
09-25-2001, 04:49 PM
Mine is in /root. I start fetchmail as one of the last items in rc.local. This means that root is it's owner, and it picks up it's .fetchmailrc from that /root directory.

MarkLeong
09-25-2001, 09:13 PM
Thanks.