If you've done any scanning on the new Ricoh multifunction copier/printer/scanner devices, you may have noticed that sometimes they send you attachments that you can't open. This document will show you how to extract the scans from those attachments.
That said, here is what I've done to get scanning from those machines to work for me.
You only have to do this once, and only if you want mail from the scanners to automatically be filed in a folder where my utility can retrieve it. If you don't mind moving the messages by hand, just make a folder named “Ricoh” under your Inbox and manually move messages from the scanner into it before running the utility.
Now, when the scanner sends you mail, it will automatically be moved to the “Ricoh” folder.
On a Mac using Apple's Mail program, you will also want to create a rule to place mail messages with scanner output into a special mailbox. The basic idea is the same as for Outlook; someday someone will add complete documentation here. One shortcut would be to scan one document to your email and select that message in your Inbox. That way, when you go to create the rule, the various fields will more-or-less auto-populate.
Assuming you now have a bunch of messages in their own mailbox in Mail, the next step is to output that entire mailbox. Select the mailbox and then the menu “Mailbox/Archive Mailbox…”. Choose a destination to save it and click “Save”. Once Mail is done (which could be a while, if you have many megabytes of scans), there will be a directory created called ”mailbox name.mbox”. Inside that directory is a file called “mbox”; this is the same file as the one that the reconstruction utility described below, copies from the Outlook server. You can then use a modified version of that utility to extract all of the scanned documents. Basically, you just need to delete the lines that do the copying from the Outlook server (those before the line with csplit, though you'll likely want to retain the line mkdir -p ~/Ricoh), change the file name in the csplit command from mailfile to mbox, and you've got a script that will extract and assemble PDFs from Mail.
Better instructions to follow, but here's the gist:
scan-assemble. The output should look something like this:[jdlarios@hercules ~]$ scan-assemble
Please enter the UWB ID to use: jlarios
Copying Ricoh mail folder...
[Trying IP address [69.91.206.85]]
[Microsoft Exchange Server 2003 IMAP4rev1 server version 6.5.7638.1 (UWBMAIL.uwb.edu) ready.]
{uwbmail.uwb.edu/imap/user=jlarios} password:
[[UNSEEN 2] Is the first unseen message]
{uwbmail.uwb.edu:143/imap/readonly/user="jlarios"}Inbox/Ricoh [8 message(s)] => /tmp/jdlarios/jlarios-Ricoh/mailfile
[Ok 8 messages(s)]
[Microsoft Exchange Server 2003 IMAP4rev1 server version 6.5.7638.1 signing off.]
Looking for messages in folder...
546
10101092
9704363
10101033
9547973
10101033
9509461
10101033
7325058
Extracting step one...
Decoding filename=textfile0
Decoding filename=textfile0
mime.c:3060:MIME_unpack_stage2:WARNING: Current recursion level of 3 is greater than permitted 2
20101227115918RG.DCSML-S000190001.000074FAEE21 has part 1 of 2
Decoding filename=textfile0
20101227115918RG.DCSML-S000190002.000074FAEE21 has part 2 of 2
Decoding filename=textfile0
mime.c:3060:MIME_unpack_stage2:WARNING: Current recursion level of 3 is greater than permitted 2
20101227120400XY.DCSML-S000200001.000074FAEE21 has part 1 of 2
Decoding filename=textfile0
20101227120400XY.DCSML-S000200002.000074FAEE21 has part 2 of 2
Decoding filename=textfile0
mime.c:3060:MIME_unpack_stage2:WARNING: Current recursion level of 3 is greater than permitted 2
201012271209237C.DCSML-S000210001.000074FAEE21 has part 1 of 2
Decoding filename=textfile0
201012271209237C.DCSML-S000210002.000074FAEE21 has part 2 of 2
Decoding filename=textfile0
mime.c:3060:MIME_unpack_stage2:WARNING: Current recursion level of 3 is greater than permitted 2
20101227121416HU.DCSML-S000220001.000074FAEE21 has part 1 of 2
Decoding filename=textfile0
20101227121416HU.DCSML-S000220002.000074FAEE21 has part 2 of 2
Extracting step two...
Decoding filename=textfile0
Decoding filename=textfile1
Decoding filename=clawhammer.pdf
Decoding filename=textfile0
Decoding filename=textfile1
Decoding filename=20101227120358938.pdf
Decoding filename=textfile0
Decoding filename=textfile1
Decoding filename=20101227120921666.pdf
Decoding filename=textfile0
Decoding filename=textfile1
Decoding filename=20101227121415106.pdf
Moving files to ~/Ricoh for download...
The contents of your ~/Ricoh directory are as follows:
total 55340
-rw------- 1 jdlarios users 14533026 Dec 27 13:09 20101227120358938.pdf
-rw------- 1 jdlarios users 14504538 Dec 27 13:09 20101227120921666.pdf
-rw------- 1 jdlarios users 12888678 Dec 27 13:09 20101227121415106.pdf
-rw------- 1 jdlarios users 14648764 Dec 27 13:09 clawhammer.pdf
Note that it's asking for your UWB ID and password, not your UW NetID. This is so it can connect to the UWB Exchange server and retrieve the mail sent by the scanner. Once you've entered your password, it may take a while before anything looks like it's happening. This is normal.