FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Gentoo > Gentoo User

 
 
LinkBack Thread Tools
 
Old 02-20-2012, 10:40 PM
Grant Edwards
 
Default Looking for IMAP->IMAP spam filtering

I'm looking to set up something that reads messages from one IMAP
server/mailbox, filters out the spam, and then writes the filtered
messages into another IMAP server/mailbox. The source and destination
servers may or may not be the same, and neither is the machine where
the filter is running. I'd like the solution to use the IMAP IDLE
command to avoid the latency and load of constantly setting up SSL
connections and polling the source server.

It looks like fetchmail -> procmail+spamassassin -> dovecot/deliver
ought to do what I want.

Is there something simpler and easier that I've overlooked?

--
Grant Edwards grant.b.edwards Yow! Is this going to
at involve RAW human ecstasy?
gmail.com
 
Old 02-20-2012, 11:00 PM
Grant Edwards
 
Default Looking for IMAP->IMAP spam filtering

On 2012-02-20, Grant Edwards <grant.b.edwards@gmail.com> wrote:
> I'm looking to set up something that reads messages from one IMAP
> server/mailbox, filters out the spam, and then writes the filtered
> messages into another IMAP server/mailbox. The source and destination
> servers may or may not be the same, and neither is the machine where
> the filter is running. I'd like the solution to use the IMAP IDLE
> command to avoid the latency and load of constantly setting up SSL
> connections and polling the source server.
>
> It looks like fetchmail -> procmail+spamassassin -> dovecot/deliver
> ought to do what I want.

Or not. It looks dovecot can't deliver to a mailbox on an IMAP server
after all.

> Is there something simpler and easier that I've overlooked?


--
Grant Edwards grant.b.edwards Yow! ... bleakness
at ... desolation ... plastic
gmail.com forks ...
 
Old 02-21-2012, 12:02 AM
Pandu Poluan
 
Default Looking for IMAP->IMAP spam filtering

On Feb 21, 2012 7:03 AM, "Grant Edwards" <grant.b.edwards@gmail.com> wrote:

>

> On 2012-02-20, Grant Edwards <grant.b.edwards@gmail.com> wrote:

> > I'm looking to set up something that reads messages from one IMAP

> > server/mailbox, filters out the spam, and then writes the filtered

> > messages into another IMAP server/mailbox. The source and destination

> > servers may or may not be the same, and neither is the machine where

> > the filter is running. I'd like the solution to use the IMAP IDLE

> > command to avoid the latency and load of constantly setting up SSL

> > connections and polling the source server.

> >

> > It looks like fetchmail -> procmail+spamassassin -> dovecot/deliver

> > ought to do what I want.

>

> Or not. *It looks dovecot can't deliver to a mailbox on an IMAP server

> after all.

>

> > Is there something simpler and easier that I've overlooked?

>


Seems to me "getmail" is more suitable for your needs:


http://pyropus.ca/software/getmail/documentation.html#features


the feature list says that it can run a filtering software, and delivers emails directly into maildirs.


Not sure about IDLE support though.


Rgds,
 
Old 02-21-2012, 12:26 AM
Grant Edwards
 
Default Looking for IMAP->IMAP spam filtering

On 2012-02-21, Pandu Poluan <pandu@poluan.info> wrote:
> On Feb 21, 2012 7:03 AM, "Grant Edwards" <grant.b.edwards@gmail.com> wrote:
>>
>> On 2012-02-20, Grant Edwards <grant.b.edwards@gmail.com> wrote:
>> > I'm looking to set up something that reads messages from one IMAP
>> > server/mailbox, filters out the spam, and then writes the filtered
>> > messages into another IMAP server/mailbox. The source and destination
>> > servers may or may not be the same, and neither is the machine where
>> > the filter is running. I'd like the solution to use the IMAP IDLE
>> > command to avoid the latency and load of constantly setting up SSL
>> > connections and polling the source server.
>> >
>> > It looks like fetchmail -> procmail+spamassassin -> dovecot/deliver
>> > ought to do what I want.
>>
>> Or not. It looks dovecot can't deliver to a mailbox on an IMAP server
>> after all.
>>
>> > Is there something simpler and easier that I've overlooked?
>>
>
> Seems to me "getmail" is more suitable for your needs:
>
> http://pyropus.ca/software/getmail/documentation.html#features
>
> the feature list says that it can run a filtering software, and delivers
> emails directly into maildirs.
>
> Not sure about IDLE support though.

I'll take a look at the sources. Doesn't look like it delivers to an
IMAP mailbox (I could always add that).

I've just thrown together a Python app that reads messages from one
IMAP server/mailbox [using the idle command ], writes them to
another IMAP server/mailbox, and then deletes them from the source
server. Now for the filtering...

--
Grant Edwards grant.b.edwards Yow! Spreading peanut
at butter reminds me of
gmail.com opera!! I wonder why?
 
Old 02-21-2012, 12:29 AM
Pandu Poluan
 
Default Looking for IMAP->IMAP spam filtering

On Feb 21, 2012 6:44 AM, "Grant Edwards" <grant.b.edwards@gmail.com> wrote:

>

> I'm looking to set up something that reads messages from one IMAP

> server/mailbox, filters out the spam, and then writes the filtered

> messages into another IMAP server/mailbox. The source and destination

> servers may or may not be the same, and neither is the machine where

> the filter is running. I'd like the solution to use the IMAP IDLE

> command to avoid the latency and load of constantly setting up SSL

> connections and polling the source server.

>

> It looks like fetchmail -> procmail+spamassassin -> dovecot/deliver

> ought to do what I want.

>

> Is there something simpler and easier that I've overlooked?

>


Okay, I may have misunderstood your needs the first time around (blame it to not having my first cuppa tea of the day).


So, you want to do these steps:

- Pull email from an IMAP account in box A

- Filter it in box B

- Push it to box C


So, the third step is not an LDA.


There are some alternatives, none of them are simple, though. The 'easiest' I think would be:


- have fetchmail (on box B) pull email from box A, and deliver to local maildir (on B) via procmail+SA


- have Dovecot watch the local maildir


- have *another* fetchmail instance pull email from the local Dovecot and push it to an SMTP MTA on box C


You can have multiple fetchmail daemons running at the same time by copying/symlinking the fetchmail initscript and creating a correspondent conf file. I've submitted a patch (that has been accepted into the tree) that allows multiple fetchmail daemons.



Rgds,
 
Old 02-21-2012, 04:00 PM
Grant Edwards
 
Default Looking for IMAP->IMAP spam filtering

On 2012-02-21, Pandu Poluan <pandu@poluan.info> wrote:

> Okay, I may have misunderstood your needs the first time around
> (blame it to not having my first cuppa tea of the day).
>
> So, you want to do these steps:
> - Pull email from an IMAP account in box A
> - Filter it in box B
> - Push it to box C

Skip the box B part. Pull an e-mail from IMAP mailbox A, filter it,
then either discard it or append it to IMAP mailbox C (with A and C
possibly on different servers).

> So, the third step is not an LDA.

Right. Nothing's local except the filtering.

> There are some alternatives, none of them are simple, though. The
> 'easiest' I think would be:
>
> - have fetchmail (on box B) pull email from box A, and deliver to local
> maildir (on B) via procmail+SA
>
> - have Dovecot watch the local maildir
>
> - have *another* fetchmail instance pull email from the local Dovecot and
> push it to an SMTP MTA on box C

If I'm going to use the SMTP server on box C, then I don't think
there's a need for the intermediate maildir stop, since I can have
procmail pipe the message to something like msmtp to deliver it to the
SMTP server. There are a couple problem with using the SMTP server.
The first is that you can't specify a mailbox. The big problem is
that the SMTP server may rewrite headers. For example, if it's gmail's
SMTP server, it will always muck up the From: header so the message
appars to be from the account that was used to log in to the SMTP
server (you loose the original From: header). Using the IMAP server
allows you to store a message an any folder you want and the headers
are unchanged.

> You can have multiple fetchmail daemons running at the same time by
> copying/symlinking the fetchmail initscript and creating a
> correspondent conf file. I've submitted a patch (that has been
> accepted into the tree) that allows multiple fetchmail daemons.

I think it would be simpler to write an LDA that delivers a message to
an IMAP mailbox and have procmail pipe messages to that for delivery.
It should only take a couple dozen lines of Python... (famous last words)

--
Grant Edwards grant.b.edwards Yow! But was he mature
at enough last night at the
gmail.com lesbian masquerade?
 

Thread Tools




All times are GMT. The time now is 03:57 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org