public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-user] Looking for IMAP->IMAP spam filtering
@ 2012-02-20 23:40 Grant Edwards
  2012-02-21  0:00 ` [gentoo-user] " Grant Edwards
  2012-02-21  1:29 ` [gentoo-user] " Pandu Poluan
  0 siblings, 2 replies; 6+ messages in thread
From: Grant Edwards @ 2012-02-20 23:40 UTC (permalink / raw
  To: gentoo-user

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            




^ permalink raw reply	[flat|nested] 6+ messages in thread

* [gentoo-user] Re: Looking for IMAP->IMAP spam filtering
  2012-02-20 23:40 [gentoo-user] Looking for IMAP->IMAP spam filtering Grant Edwards
@ 2012-02-21  0:00 ` Grant Edwards
  2012-02-21  1:02   ` Pandu Poluan
  2012-02-21  1:29 ` [gentoo-user] " Pandu Poluan
  1 sibling, 1 reply; 6+ messages in thread
From: Grant Edwards @ 2012-02-21  0:00 UTC (permalink / raw
  To: gentoo-user

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 ...




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [gentoo-user] Re: Looking for IMAP->IMAP spam filtering
  2012-02-21  0:00 ` [gentoo-user] " Grant Edwards
@ 2012-02-21  1:02   ` Pandu Poluan
  2012-02-21  1:26     ` Grant Edwards
  0 siblings, 1 reply; 6+ messages in thread
From: Pandu Poluan @ 2012-02-21  1:02 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 1150 bytes --]

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,

[-- Attachment #2: Type: text/html, Size: 1610 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [gentoo-user] Re: Looking for IMAP->IMAP spam filtering
  2012-02-21  1:02   ` Pandu Poluan
@ 2012-02-21  1:26     ` Grant Edwards
  0 siblings, 0 replies; 6+ messages in thread
From: Grant Edwards @ 2012-02-21  1:26 UTC (permalink / raw
  To: gentoo-user

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?




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [gentoo-user] Looking for IMAP->IMAP spam filtering
  2012-02-20 23:40 [gentoo-user] Looking for IMAP->IMAP spam filtering Grant Edwards
  2012-02-21  0:00 ` [gentoo-user] " Grant Edwards
@ 2012-02-21  1:29 ` Pandu Poluan
  2012-02-21 17:00   ` [gentoo-user] " Grant Edwards
  1 sibling, 1 reply; 6+ messages in thread
From: Pandu Poluan @ 2012-02-21  1:29 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 1585 bytes --]

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,

[-- Attachment #2: Type: text/html, Size: 1890 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [gentoo-user] Re: Looking for IMAP->IMAP spam filtering
  2012-02-21  1:29 ` [gentoo-user] " Pandu Poluan
@ 2012-02-21 17:00   ` Grant Edwards
  0 siblings, 0 replies; 6+ messages in thread
From: Grant Edwards @ 2012-02-21 17:00 UTC (permalink / raw
  To: gentoo-user

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?




^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2012-02-21 17:02 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-20 23:40 [gentoo-user] Looking for IMAP->IMAP spam filtering Grant Edwards
2012-02-21  0:00 ` [gentoo-user] " Grant Edwards
2012-02-21  1:02   ` Pandu Poluan
2012-02-21  1:26     ` Grant Edwards
2012-02-21  1:29 ` [gentoo-user] " Pandu Poluan
2012-02-21 17:00   ` [gentoo-user] " Grant Edwards

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox