Fwd: Fwd: Fwd: How To change queue process method
---------- Forwarded message ---------- From: Maickel Pandie <maickel.pandie@gmail.com> Date: Wed, 18 Jun 2008 21:18:44 +0700 Subject: Re: [Mailman-Developers] Fwd: Fwd: How To change queue process method To: Barry Warsaw <barry@list.org>
Question again...
In Switchboard.files() Can I get listname from the digest/ filebase? How?
Nope. That information is available in the metadata, but you have to dequeue the file in order to read it.
Can you give me the example of dequeue metadata file to get the listname of the message please? I need the listname of the message because I made my own function to count how many domain as the destination of the message and the input of that function is listname
Can you give me any suggestion how to get attachment file size from each message?
Is there any function in mailman who can give me the size of the message? What variable that I need to get the size of the message? (filename, listname, filebase, or other variabel)
Many Thanks
2008/6/16, Barry Warsaw <barry@list.org>:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On Jun 16, 2008, at 3:25 AM, Maickel Pandie wrote:
I have some problem here and I didn't know how to solve it. I sent 1 message to milis_01@milis.com (listname) and I record what Switchboard.files() return to Runner.py:
1213621876.0387881+53028ae65697f5b1c06e9cf0f3b04ae1bb2ecfb1 1213621876.0387881+ad9a762eff62186e94d26fda95865243b6dc4069 1213621876.0387881+e7efb136c33f77e0674e03512860aadb23a2d605
From Switchboard.enqueue() and Switchboard.files() I knew that 1213621876.0387881 is the rcvtime
What I asking are:
- Why the digest (53028ae65697f5b1c06e9cf0f3b04ae1bb2ecfb1, ad9a762eff62186e94d26fda95865243b6dc4069, e7efb136c33f77e0674e03512860aadb23a2d605) are changing for same message?
Because the hash is calculated from the entire contents of the file, which includes the message's metadata dictionary. That will change each time the message is re-queued.
- In Switchboard.files() Can I get listname from the digest/ filebase? How?
Nope. That information is available in the metadata, but you have to dequeue the file in order to read it.
Cheers,
- -Barry
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (Darwin)
iEYEARECAAYFAkhWjJ4ACgkQ2YZpQepbvXEJEwCdFw6o4MhGsheX+Mu8Pn11GW4N vFMAnRARv78M+7YpwVxNJCoqIOoBt8/o =9HdD -----END PGP SIGNATURE-----
Maickel Pandie wrote:
- Can you give me the example of dequeue metadata file to get the listname of the message please? I need the listname of the message because I made my own function to count how many domain as the destination of the message and the input of that function is listname
You are creating a huge can of worms, however if you insist ...
In the files() method, you don't want to dequeue the message because while that will get you the message and the metadata, it will also remove the queue entry (actually rename it from .pck to .bak). I suppose you could then rename the .bak back to .pck, but since files() is really only in the business of preparing a list of entries to be dequeued by a runner, I think it is best to read the pickle (if you must) without dequeueing it in the files() method.
So you would do something like:
msg = cPickle.load(fp)
data = cPickle.load(fp)
Then the list name is data.get('listname')
- Can you give me any suggestion how to get attachment file size from each message?
You can look at the "Is the message too big?" code in Mailman/Handlers/Hold.py.
- Is there any function in mailman who can give me the size of the message? What variable that I need to get the size of the message? (filename, listname, filebase, or other variabel)
With msg and data as above
if data.get('_parsemsg'):
size = len(msg)
else:
size = len(msg.as_string())
Ask yourself if the cost of all this extra work is not greater than whatever you think you're going to save.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
I'm sory, but I have to do this research. There is a case: a lot of people using mailing list server to distribute many kind of file to their group. The important things are a lot of group using mailing list to distribute a big file but not urgent such as big resolution picture, movie, etc. there also a group using mailing list for work like distributing their report(pdf, doc, odt (small file)) and they need it to be delivered fast. The bandwidth is not so big to deliver a lot of big file fast so I'm doing this research. This is my kind of job now to research something like this despite this is not important but I have to do it and make the report for the result.
Thanks for your help
2008/6/18 Mark Sapiro <mark@msapiro.net>:
Maickel Pandie wrote:
- Can you give me the example of dequeue metadata file to get the listname of the message please? I need the listname of the message because I made my own function to count how many domain as the destination of the message and the input of that function is listname
You are creating a huge can of worms, however if you insist ...
In the files() method, you don't want to dequeue the message because while that will get you the message and the metadata, it will also remove the queue entry (actually rename it from .pck to .bak). I suppose you could then rename the .bak back to .pck, but since files() is really only in the business of preparing a list of entries to be dequeued by a runner, I think it is best to read the pickle (if you must) without dequeueing it in the files() method.
So you would do something like:
msg = cPickle.load(fp) data = cPickle.load(fp)
Then the list name is data.get('listname')
- Can you give me any suggestion how to get attachment file size from each message?
You can look at the "Is the message too big?" code in Mailman/Handlers/Hold.py.
- Is there any function in mailman who can give me the size of the message? What variable that I need to get the size of the message? (filename, listname, filebase, or other variabel)
With msg and data as above
if data.get('_parsemsg'): size = len(msg) else: size = len(msg.as_string())
Ask yourself if the cost of all this extra work is not greater than whatever you think you're going to save.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
Hi friend....
Do you have any suggestion what SMTP benchmark I can use except Multimail2 to test Mailman+Postfix? Something that can return some variabel not only sending a lot of email ?(This is for research and not for spamming other)
Thanks
2008/6/19 Maickel Pandie <maickel.pandie@gmail.com>:
I'm sory, but I have to do this research. There is a case: a lot of people using mailing list server to distribute many kind of file to their group. The important things are a lot of group using mailing list to distribute a big file but not urgent such as big resolution picture, movie, etc. there also a group using mailing list for work like distributing their report(pdf, doc, odt (small file)) and they need it to be delivered fast. The bandwidth is not so big to deliver a lot of big file fast so I'm doing this research. This is my kind of job now to research something like this despite this is not important but I have to do it and make the report for the result.
Thanks for your help
2008/6/18 Mark Sapiro <mark@msapiro.net>:
Maickel Pandie wrote:
- Can you give me the example of dequeue metadata file to get the listname of the message please? I need the listname of the message because I made my own function to count how many domain as the destination of the message and the input of that function is listname
You are creating a huge can of worms, however if you insist ...
In the files() method, you don't want to dequeue the message because while that will get you the message and the metadata, it will also remove the queue entry (actually rename it from .pck to .bak). I suppose you could then rename the .bak back to .pck, but since files() is really only in the business of preparing a list of entries to be dequeued by a runner, I think it is best to read the pickle (if you must) without dequeueing it in the files() method.
So you would do something like:
msg = cPickle.load(fp) data = cPickle.load(fp)
Then the list name is data.get('listname')
- Can you give me any suggestion how to get attachment file size from each message?
You can look at the "Is the message too big?" code in Mailman/Handlers/Hold.py.
- Is there any function in mailman who can give me the size of the message? What variable that I need to get the size of the message? (filename, listname, filebase, or other variabel)
With msg and data as above
if data.get('_parsemsg'): size = len(msg) else: size = len(msg.as_string())
Ask yourself if the cost of all this extra work is not greater than whatever you think you're going to save.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
participants (2)
-
Maickel Pandie
-
Mark Sapiro