LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 06-22-2004, 06:14 PM   #1
paranoidpenguin
LQ Newbie
 
Registered: Jun 2004
Location: London
Distribution: Mandrake 10.0
Posts: 14

Rep: Reputation: 0
Fetchmail not detecting users?!?


I have a system setup running Mandrake 10.0 with postfix and pop3 server. I have a number of domains all collecting in one external pop3 mailbox.

The email server works fine internally, all aliases and domains work without any problems at all. Sending externally is fine also... I have only one problem however.

Fetchmail is being used to download messages from the external 'catch-all' mailbox. Fetchmail is setup using the .fetchmailrc file under /root. This downloads all of the mail but is unable to see any users other than root. It therefore cannot deliver any mail to any users and my useraccount (being the postmaster) gets all of it!

Is there anyway around this? Can the fetchmailrc file be put somewhere else for instance? Its late and i'm getting very confused...

I found the link below that is similar to my problem but doesn't make things look very promising...

http://catb.org/~esr/fetchmail/fetchmail-FAQ.html#C1

If this problem isn't fixable does anyone know of another program that collects email from a pop3 mailbox and sents it on to the MTA?


Thanks thanks guys

Dan
 
Old 06-22-2004, 08:07 PM   #2
Linux_in_NH
Member
 
Registered: Jan 2004
Location: NH
Distribution: Mandrake, Geentoo, Ubuntu
Posts: 105

Rep: Reputation: 15
Hmmm... if the mail is being delivered to a single mainbox, how exactly is fetchmail supposed to know who the message is really for? fetchmail does not read the messages that it is downloading. It simply logs into a pop server, grabs whatever is there and allows it to be locally delivered.

What field(s) are there in the message that define the actual receipient should be? Sounds to me like you may need to write a (Perl) script to talk to the POP server, actually read the message and decide how to route it based on some data within the message.

Or maybe I am simply misunderstanding the question.
 
Old 06-23-2004, 03:07 AM   #3
paranoidpenguin
LQ Newbie
 
Registered: Jun 2004
Location: London
Distribution: Mandrake 10.0
Posts: 14

Original Poster
Rep: Reputation: 0
I think I know what you mean. I have since found a script that runs Fetchmail as a service as a system process. This still hasn't changed things though...
I was under the assumption that when Fetchmail downloads messages it passes them directly onto Postfix. Postfix then distributed the mail according to the
/etc/aliases file. I have configured locally three domains, they are say:-

something1.com
something2.com and
something3.com

If I send a mail internally on my LAN to (for instance) peter@something1.com and peter@something2.com, both of these mails go
straight into the mailbox for the username of 'peter'. The problem is that as soon as Fetchmail downloads messages it passes them somehow to the
root/postmaster account. If I look at the messages is downloads for 'peter' it says in the headers, that local delivery is not possible, user 'peter' unknown. I'm
confused because I thought Fetchmail just downloads mail and passes it straight to Postfix, and Postfix knows who 'peter' is?

Am I making any sense because my brain is beginning to feel fried lol...

Should I possibly use something like Procmail to filter the new messages off to Fetchmail or something?


Thanks

Dan
 
Old 06-23-2004, 05:32 AM   #4
Gnuru
Member
 
Registered: Jan 2004
Posts: 53

Rep: Reputation: 15
Well of course it passes the mail to the root account if the fetchmail process is running as root. How else can fetchmail know what local user to pass the mail to?

There are a couple of ways to change this. One, which I find is useful when on dialup is to use su to run fetchmail as another user like this:

su someuser -c fetchmail

A better solution would be to fix your fetchmailrc file. To fetchmailrc you can add 'is localuser here' to ensure that mail collected by fetchmail gets passed to local user 'localuser'.

So your fetchmail stanza should look something like this:

Code:
poll a.pop3.server with proto POP3
        user "pop3user" password "somepassword" is localuser here
 
Old 06-23-2004, 06:13 AM   #5
Linux_in_NH
Member
 
Registered: Jan 2004
Location: NH
Distribution: Mandrake, Geentoo, Ubuntu
Posts: 105

Rep: Reputation: 15
You are correct that fetchmail downloads a message and passes it to the local MTA (postfix), but again, neither fetchmail nor postfix (or any MTA for that matter) looks at the message data itself for deliverly information. All MTA's rely on the envelope data for destination information and fetchmail, by default, will create an 'envelope' for each message based on either who is running the process or as specified in the 'is' section of the fetchmailrc info.

Try thinking of it like a letter being delivered by the post office (yes, a letter written with pen and paper). In the letter, you address it to "Mary Jones, 123 Spruce Street, London". Now you place the letter in an envelope and you address the letter to "Suzy Smith, 432 Easy St., London". You place the letter in the Postal box down the street. Guess where the letter gets delivered.

Email works the same way. It has an envelope and a message. Fetchmail does not read either (it simply retreives whatever was in the mailbox and passes it to the local MTA) after attaching an envelope that specifies the user that is running the command (or as instructed by the 'is' option). The MTA reads only the envelope and delivers the message.

Again, to get around this, you may need to either write/find something that actually opens the letter and reads it for a different address for delivery. It really should not be too hard to write if you have any Perl experience, or you may be able to create a Postfix filter to do what you are looking for.

Hope this helps a bit....
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how to authenticate external users but bypass prompt on local LAN users? taiwf Linux - Security 5 07-13-2005 09:01 AM
fetchmail and 1 pop to many users nickcol Linux - Software 1 04-27-2005 03:14 AM
How to remove Mandrake Galaxy Theming for all users and all new users. Zombie_Ryushu Mandriva 0 01-04-2005 05:38 PM
How to set a Gnome theme as default for all users and future users ? MDesigner Linux - Newbie 1 06-28-2004 11:12 AM
copying kde configuration for 2 users OR 2 users on 1 x session for vnc blackphiber Linux - General 0 02-26-2004 08:57 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 07:52 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration