Re: Multiple sender addresses to the same roundup user
Yann <[email protected]>
| Newsgroups | gmane.comp.bug-tracking.roundup.user |
|---|---|
| Message-ID | <[email protected]> |
Hi,
a little followup on this activity. I have decided to use getmail and an
external filter to add the Resent-From header to incoming emails, as
suggested by Ralf.
this is a portion of mail getmailrc configuration file
------------------------------------------------
[destination]
type = Mboxrd
path = ~/inboxes/abuse
[filter-1-spamcop]
type = Filter_external
path = /path/to/abuse-classifier.py
------------------------------------------------
and this is the abuse-classifier code
------------------------------------------------
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import email
if __name__ == '__main__':
stdin = sys.stdin.read()
try:
msg = email.message_from_string(stdin)
except:
sys.exit(1)
if '@reports.spamcop.net' in msg.get('from'):
msg.add_header('Resent-From','[email protected]')
print msg.as_string(True)
sys.exit(0)
------------------------------------------------
If the need arises to add more manipulation to incoming emails it can be
eaisly added here.
So, from this point on I have all the downloaded emails in a local
mailbox file.
One of the requirements with getmail of using a shared mailbox file is
that "The Mboxrd destination delivers to an mboxrd-format mbox file with
either fcntl-type (lockf) or flock-type file locking."
I wanted to know if the roundup-mailgw tool supports any of those file
locking mechanisms. If it is not supported I think that the only way to
avoid multiple access to the same file (from getmail and roundup-mailgw)
is to call them in sequence.
Yann
Il 29/08/2013 16:11, Ralf Schlatterbeck ha scritto:
> On Thu, Aug 29, 2013 at 03:47:01PM +0200, y kmm wrote:
>> As my previous answer to Peter I had not considered this option, would you
>> suggest it instead of trying to manipulating it with an auditor?
> thats too late. Roundups mail gateway checks if an email is allowed to
> submit. Only *after* that check auditors are called.
>
>> If I understand correctly how roundup works, when a new email is downloaded
>> by the roundup-mailgw script, a set of new objects are created (one user,
>> one issue, one message and one or more files). However it seems to me that
>> each object creation is somewhat atomic and thus completely oblivious about
>> the other elements that could be part of the same "trasaction".
> It is all done in a database transaction. So if you're using a
> relational database backend (mysql, postgreSQL, sqlite) this *is*
> atomic.
>
>> So for example, if I have an auditor on the user, It will be called each
>> time a user is being created, and I have no way to know what is the context
>> for this user (for example if it is part of an email processing or it is
>> simpy the creation of a new user from the web interface)
> In a way, yes. But you can follow links (or multilinks) to other
> objects. For example when you are called with an issue auditor you can
> already access the messages and files of that issue (and the user even
> if it has been created in this transaction). For an example what you can
> do you may want to look into the nosyreaction.py file in the classic
> tracker. This contains (contrary to the name which suggests it only
> contains a reactor) an auditor that updates the nosy list. For this it
> looks through the messages of the issue.
>
> Ralf
------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60133471&iu=/4140/ostg.clktrk