fetchmail-friends
[Top] [All Lists]

[fetchmail] Re: download only selected messages.

2003-09-28 16:02:27
On Sat, Sep 27, 2003 at  9:41:37AM -0500, Abhay Pradhan wrote:
Say my email account is 
Abhay Pradhan <pradhan(_at_)xyz(_dot_)com>

for pop3, i have to connect to mail.xyz.com

Now, say I want another person to use this email account too.

Foo Bar <pradhan(_at_)xyz(_dot_)com>

Is it possible for me to configure fetchmail such that when I run
fetchmail, it only downloads emails that are for Abhay Pradhan
<pradhan(_at_)xyz(_dot_)com>.

When the other person runs fetchmail, it only downloads mails meant for
Foo Bar <pradhan(_at_)xyz(_dot_)com>

If you can run procmail at your ISP to hack the mail on its way to
your pop3 mailbox, you might have some options.  For example, you
could alter the TO headers like:

  To: Abhay Pradhan <pradhan(_at_)xyz(_dot_)com>
becomes
  To: Abhay Pradhan <pradhan+abhay(_at_)xyz(_dot_)com>

while
  To: Foo Bar <pradhan(_at_)xyz(_dot_)com>
becomes
  To: Foo Bar <pradhan+foobar(_at_)xyz(_dot_)com>

I don't know if fetchmail can discriminate addresses at that level;
judging from Rob MacGregor's answer, I'd expect not.

I'm assuming your friend Foo Bar is fetching mail to a different
machine than yours; if you two are sharing the fetchmail machine or
its network, your job is fairly trivial, thanks to procmail and its
ability to redistribute the mail *after* the fetch from the ISP.
There's an interesting article on email account sharing in the April
2001 Linux Journal "Providing E-mail Services for a Small Office." It
may not help in your case, as the sharing is done after download from
the ISP, but might be worth reading as food for thought. 

HTH,

Jim