Re: SpamCop script which worked in Tiger suddenly dropping some attachments in Leopard
Re: SpamCop script which worked in Tiger suddenly dropping some attachments in Leopard
- Subject: Re: SpamCop script which worked in Tiger suddenly dropping some attachments in Leopard
- From: Kok-Yong Tan <email@hidden>
- Date: Wed, 9 Feb 2011 02:59:19 -0500
On Wed, Feb 9, 2011, at 02:20, Kok-Yong Tan wrote:
On Tue, Feb 8, 2011, at 08:02, Axel Luttgens wrote:
Le 8 févr. 2011 à 05:25, Kok-Yong Tan a écrit :
On Mon, Feb 7, 2011, at 12:14, Kok-Yong Tan wrote:
[...]
Many thanks, Axel. I've typed it in and it seems to run fine
after I corrected the variable "sourceFilePath" above to
"sourceFile" as the former isn't defined. As I mentioned in my
original email, even with Leopard 10.5.8 Mail, the dropouts only
happen sporadically so it's not a consistently reproducible
problem (which makes debugging all that much harder). I'll try
running your version for a while from within the Script Editor
for debugging purposes and see if the same problem crops up
again. I'll report back over the next couple of weeks or so.
Tan
Okay, reporting back as promised. Initial runs of the above
script seemed to work although it ran really, really, really slow--
about the same speed as when it was run in Tiger Mail. Then just
five minutes ago, running with 5 spams selected resulted in it
dropping spams 3 and 4 which I had to manually add in. I guess it
didn't help. Running it again against the same 5 spams by moving
them from Trash to my Spam folder resulted in it attaching spams
1, then 3-5 but dropping spam 2. Different runs caused different
results in the attachment process. It always seems to be the
attachment process--when I check the temporary files, they are
sitting there ready to be attached. Instead of having them all
attach on the fly, I'm going to try processing them all then
coming back and attaching them in another separate loop by itself.
Hello Tan,
Thanks for the follow-up.
Thank *YOU* for helping me.
Perhaps should one suspect a deeper problem coming with Mail on
10.5.x...
Okay.
Could you try to quit then re-launch Mail once it begins with those
slowdowns/dropouts, and then immediately run the script? Does it
then run quicker/more reliably?
Not quite. Even if it starts dropping attachments with slowdowns,
it not necessarily continues doing this. It can suddenly stop
dropping attachments suddenly and return to normal. Without me
having to restart Mail! As such, restarting Mail doesn't prove
anything. i.e., sometimes it stops dropping attachments upon
restart; other times, it continues dropping attachments upon restart.
Anyway, if you don't mind some GUI scripting, perhaps could it be
worth to give it a try; here follows a skeleton (you'll need to
localize it, and possibly to adapt it for your version of Mail):
set SCaccount to "YOURACCOUNT"
tell application "Mail"
set counter to count of selection
set totalSize to 0
repeat with M in (get selection)
set totalSize to totalSize + (message size of M)
end repeat
end tell
set totalSize to round (totalSize / 1024)
tell application "Mail" to activate
tell application "System Events"
tell application process "Mail"
tell menu item "Réexpédier en tant que pièce jointe" of menu 1
of menu bar item "Message" of menu bar 1 to perform action "AXPress"
Uh...what's the bits in quotes in French? I have no clue how they
map to the US English. Can you translate into English then I'll try
looking up the equivalent commands in the US English Applescript.
tell front window
set focused of first text field of first item of (scroll areas
whose (name of text field 1 is "À :")) to true
keystroke SCaccount
set focused of text field "Objet :" to true
keystroke ("" & counter & " junk item(s) being submitted for
processing; total size is around " & totalSize & " KB")
end tell
end tell
end tell
I'm reporting back on the results. While it somewhat works in that it
hasn't dropped any attachments (yet--I've only tried it on a spam load
of only 3 emails thus far--I'll wait for a bigger load before trying
it again), "Forwarding as Attachment" doesn't seem to be as good as
expanding the raw source and then attaching the raw source. The
reason I say this is because one of the emails didn't get processed by
SpamCop with the SpamCop report engine complaining that it couldn't
find an IP address. When I used the old script (which expands the
spam as raw source, saves it to a file and then attaches that file
with the expanded source) to re-send this spam to be re-processed,
SpamCop found the IP to report it to the offender's ISP. So there
seems to be a subtle difference between "Forward as Attachment" and
attaching a file with raw source email in it.
--
Reality Artisans, Inc. # Network Wrangling and Delousing
P.O. Box 565, Gracie Station # Apple Certified Consultant
New York, NY 10028-0019 # Apple Consultants Network member
<http://www.realityartisans.com> # Apple Developer Connection member
(212) 369-4876 (Voice) # My PGP public key can be found
at <https://keyserver.pgp.com>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden