Ultimate MS Outlook Editor

At my work, I’m required to use Microsoft Outlook for exchanging email with my co-workers. At home, I use Mutt on FreeBSD, and have grown to really love the lightning-fast responsiveness, immunity to virusses, and easy scriptability of this tiny text-based mail reader.


At my work, I’m required to use Microsoft Outlook for exchanging email with my co-workers. At home, I use Mutt on FreeBSD, and have grown to really love the lightning-fast responsiveness, immunity to virusses, and easy scriptability of this tiny text-based mail reader.

I’m going to tell you one solution, just so I can tell you another one 🙂

It’s possible to use Mutt with Microsoft Exchange:

  • Set up IMAP on your Exchange server. This was already done here.
  • Install a copy of Cygwin, including Python.
  • Either set up Mutt to access IMAP on Exchange directly, or do what I prefer to do: download and set up offlineimap. This IMAP-to-Maildir synchronization utility is excellent.
    1. First, you need to run the “rebaseall” utility so that Python doesn’t dump with traceback when you try to run offlineimap. You can’t rebaseall if you’re trying to do it from an rxvt window — you need to be using the cmd-based Cygwin shell for it to finish without an error.
    2. Then you need make sure your .offlineimaprc file specifies “Curses.Blinkenlights” as the first available interface — the TK interface, on Win32, just hangs.
  • You can’t use offlineimap on a non-managed Cygwin mount. The reason is that the Maildir specification uses the “:” character, which is a big no-no in Windows-land. The solution is to use this command:
     $ mount -f -s -b -o managed "d:/tmp/mail" "/home/of/mail" 

    substituting the windows-path directory you wish to use for mail for the “d:/tmp/mail” above, and the mount point you wish to put it on instead of “/home/of/mail”.

  • Once you have IMAP-to-Maildir synchronization going to your local PC, then you’re good to go with offline IMAP stuff and Mutt. Follow the usual directions for configuring Mutt to use the Maildir you’ve set up, paying particular attention to choice of outbound mailer (probably ssmtp).

Obviously, though I’m a big fan of Mutt, that seemed like a lot of work. Lucky me, I chanced across a script that, with minor modifications, gave me the primary thing I loved about using Mutt: being able to use vim as my text editor. I’m just much faster using that than any other editor, and it’s ubiquitous on UNIX systems, either in a more-primitive incarnation of “vi”, or in some version.

So I installed Python and the Win32 extensions for Python, then linked this script on my quickbar in Windows, conveniently right next to Outlook:

 #!/bin/env python ''' outlook.pyw (OutLook editor launcher) -- allows one to edit an open e-mail  mesg from Outlook using Emacs or *Vi* rather than "Notepad--". :-)  NOTE: requires Python 1.6 and newer (use of string methods)

created by John Klassa (klassa at employees.org) on 2001 May 29 updated by Wesley Chun (cyberweb at rocketmail.com) on 2002 Feb 28

$Id: outlook.pyw,v 0.2 2002/08/28 18:04:06 wesc Exp wesc $ '''

from os import spawnv, P_WAIT, unlink from tempfile import mktemp from Tkinter import Tk, Button, Frame, Label from Tkconstants import * from win32com.client import Dispatch

def launch(): '''launch() spawns your favorite editor to edit the Outlook compose   window (either new or reply), then returns that data to Outlook...  change the 'ed' variable to switch editors.'''

# Get a handle to Outlook. o = Dispatch("Outlook.Application")

# Work our way down to the reply (a "MailItem"). insp = o.ActiveInspector() if insp == None: return item = insp.CurrentItem if item == None: return

# Grab the message body in the reply. body = item.Body

# Write the body... need to "encode" the string because Outlook uses # Unicode with bunch of unprintables (ASCII chars > 128). Also, since # we are going from DOS2UNIX2DOS, we have the \r\n vs \n issue, re- # sulting in those fabulous ^M characters. A persistent, bound-to-a- # key Emacs macro takes care of that nicely, but the solution imple- # mented here is to just wipe the '\r's now, then add them back when # we reread this file back before returning the body to Outlook. tmp = mktemp() # generate a unique tmp filename fh = open(tmp, "w") fh.write(body.encode('ascii', 'ignore').replace('\r\n', '\n')) fh.close()

# Launch editor to edit the file (should make this configurable). #ed = r"d:\emacs-20.7\bin\emacs" # emacs editor binary ed = r"c:\vim\vim62\gvim.exe" # *vi* editor binary spawnv(P_WAIT, ed, [ed, tmp])

# Read edited file back into memory, restore '\r's, and kill tmp file. fh = open(tmp) body = fh.read().replace('\n', '\r\n') fh.close() unlink(tmp)

# Store it as the body of the reply. Note that we are merely # sending this data back to Outlook -- it does not prevent MS from # mucking with your message. For example, it may add your signature # again, or it may remove newlines. MS software... what can you do? item.Body = body

# Create the Tk(inter) GUI app with the appropriate label and buttons. if __name__=='__main__': tk = Tk() f = Frame(tk, relief=RIDGE, borderwidth=2).pack() Label(f, text="Outlook Edit Launcher v0.2").pack() Button(f, text="Edit", fg='blue', command=launch).pack(fill=BOTH) Button(f, text="Quit", fg='red', command=tk.quit).pack(fill=BOTH) tk.mainloop()

I now click Outlook, then click my outlook.py script. I minimize the annoying black cmd window that comes up (anybody know how to get rid of this?), and I now have a little Python/TK window with a convenient “edit” button on it. When I compose a message in LookOut, I click this “edit” button, and up pops gvim 6.2, ready for me to type the message. When I’m done typing it, I just write-quit out of gvim, and the text pops up in my Outlook compose window.

Convenient! Well, for a UNIX-geek at least.

Anyway, I’m still torn. Do I really need to use Outlook here? Realistically, I have maybe one meeting a week that I need to keep track of, and that’s easily done in my Palm. Maybe I should just use Mutt in Cygwin on a managed mount? Who knows, but both are valid choices. And in a world where MS wants you to only use MS products, and those products are funkily generic and slow, it’s nice to have choices.

The Pledge: Et Tu, Supremes?

What do you think about the Pledge of Allegiance case the Supreme Court is due to hear today? Here’s the quick background on the case:

Michael Newdow, a non-religious California father, lawyer, and doctor, objected to his daughter reciting the words “Under God” in the Pledge of Allegiance. He took the school to court and won, but the district appealed. It is due to be heard before the Supreme Court today.

What do you think about the Pledge of Allegiance case the Supreme Court is due to hear today? Here’s the quick background on the case:

Michael Newdow, a non-religious California father, lawyer, and doctor, objected to his daughter reciting the words “Under God” in the Pledge of Allegiance. He took the school to court and won, but the district appealed. It is due to be heard before the Supreme Court today.

Until 1954, the phrase “Under God” was not in the Pledge of Allegiance. It was added by Congress due to lobbying by the “Knights of Columbus”, a religious organization. Additionally, in 1940, the Court decided that it was unconstitutional to require any citizen to recite the pledge.

There are a few interesting facets to the case that, in my opinion, may cause the Supremes to ignore it:

  • Newdow is not the custodial parent
  • Justice Antonin Scalia, noted conservative Supreme Court Justice, bowed out of hearing this case due to his outspoken opposition to Newdow’s arguments at a religious rally last year
  • The girl’s mother is a Born-Again Christian, opposed to the case — and so is the daughter
  • Bringing this case to bear may cause him to lose his California Bar Certification. Several religious organizations have begun a petition for him to lose his license to practice law.

As for me, this morning I heard arch-conservative Bob Lonsberry refer to Newdow as “this evil man” and his offspring the result of a “hippy-dippy fling”. Although I don’t think the phrase “under God” does any harm in the Pledge, at the same time, I think ad hominem attacks against Newdow due to him following his conscience are simply wrong.

The interesting thing for me here is the question: is the act of putting into law that the Pledge of Allegiance contains the phrase “Under God” a violation of the First Amendment to the Constitution of the United States? And will striking the same from the Pledge be an abridgement of the free speech of those for whom the public prayer aspect of the Pledge makes patriotism more palatable? What I mean is, does prohibiting religious speech in government oaths impinge the freedom of speech of those who wish to express their religious convictions in those oaths?

Congress shall make no law respecting an establishment of religion, or prohibiting the free exercise thereof; or abridging the freedom of speech, or of the press; or the right of the people peaceably to assemble, and to petition the government for a redress of grievances.

The small addition by Congress of “under God” turns the Pledge into both a patriotic oath, and a public prayer. People are free not to say it when reciting the Pledge, but the removal of it from the official Pledge will deny religious people the opportunity of saying it.

Don’t know how it’s going to turn out, but my gut reaction is that if the court does anything but refuse to hear the case, or rule in favor of the school district, there is going to be a great deal of civil uproar over, really, what seems to be an inconsequential thing. Throughout Elementary School, I recited the Pledge daily. Throughout Middle and High schools, I recited it once a week. Since then, I’ve only said it a handful of times. Seems like a bit of a tempest in a teapot to me, yet the long-term ramifications of the decision are both unknown, and probably far-reaching.

Update: More details now available on CNN about Newdow’s appeal.

Lethal Weapon

TODAYonline brings us this little tidbit:

“A CURIOUS, anti-brassiere advertising campaign begins today. Printed against a light blue background, the print advertisement has no pictures and tells readers to “stop wearing bras”.

The striking caption is accompanied by research findings about how wearing bras can cause cancer.”

Read the article: Stop Wearing Bras

TODAYonline brings us this little tidbit:

“A CURIOUS, anti-brassiere advertising campaign begins today. Printed against a light blue background, the print advertisement has no pictures and tells readers to “stop wearing bras”.

The striking caption is accompanied by research findings about how wearing bras can cause cancer.”

Read the article: Stop Wearing Bras

Stats…

Interesting statistics for your viewing pleasure:

Interesting statistics for your viewing pleasure:

Hope you enjoyed the list!

Bigger avatars

I’ve relaxed restrictions on avatars to accept 110×110 .jpg or .gif images. Uploaded a pic of Sam as a demo.

Go wild.

This space intentionally left blank.

I’ve relaxed restrictions on avatars to accept 110×110 .jpg or .gif images. Uploaded a pic of Sam as a demo.

Go wild.

This space intentionally left blank.

The Floogie

I finally uploaded The Floogie. Mucho thanks to Justin and Teresa for resurrecting this old dog, and sending me an mp3 of this first Wayward Sun tune.

You can also stream the song using this link. Requires WinAmp or (for UNIX-like platforms), XMMS, and a high-bandwidth connection, because the song’s encoded at 160kbits/sec (a little fast for some streaming connections).

I apologize for the bad chunks of the song… it was on a well-worn tape.

Oh, Justin also threw me an original demo of us singing the Wayward Sun Theme Song; you can stream Wayward Sun’s theme song.

I finally uploaded The Floogie. Mucho thanks to Justin and Teresa for resurrecting this old dog, and sending me an mp3 of this first Wayward Sun tune.

You can also stream the song using this link. Requires WinAmp or (for UNIX-like platforms), XMMS, and a high-bandwidth connection, because the song’s encoded at 160kbits/sec (a little fast for some streaming connections).

I apologize for the bad chunks of the song… it was on a well-worn tape.

Oh, Justin also threw me an original demo of us singing the Wayward Sun Theme Song; you can stream Wayward Sun’s theme song.

Have a baby, go to jail

Here’s the story from KSL TV:

Doctors warned a woman to have a caesarian section to save her baby, she refused, the baby died, and now the mother is charged with murder. It’s a case that’s already making national headlines and sparking a heated debate over ethics, fairness and the right to life.

Here’s the story from KSL TV:

Doctors warned a woman to have a caesarian section to save her baby, she refused, the baby died, and now the mother is charged with murder. It’s a case that’s already making national headlines and sparking a heated debate over ethics, fairness and the right to life.

Rowland's PictureWe’ve heard cases before where an expectant mother has been putting her fetus at risk by drinking, or using drugs, or other dangerous behavior. This one has a different twist– it wasn’t what she was doing, it was what she didn’t do.

In custody tonight, charged with murder, is 29-year old Melissa Ann Rowland. She was arrested nearly two months after the stillborn death of her child.

It’s a complicated story involving several local hospitals, doctors and nurses who continually advised that Rowland needed medical attention in order to save her baby’s life. The Salt Lake County District Attorney’s office says Rowland’s lack of action violates the law.

Kent Morgan, District Attorney’s Office: “…the conduct was that she omitted her duty to take care of her child and get affirmative treatment. That’s what makes this case so egregious.”

It started on Christmas Day at LDS hospital.

Rowland — carrying twins — told a nurse that she hadn’t felt them move. The nurse advised her to go to either Jordan Valley or Pioneer Valley Hospital. According to the charging documents, Rowland replied: “she’d rather have both her babies die before she’d go to those hospitals…”

January 2nd, she saw a doctor at LDS Hospital.

Kent Morgan, District Attorney’s Office: “She went and saw a doctor and he indicated that there were very severe medical problems at that time, and that she should immediately have a cesaerian section.”

According to the charges, the doctor told police: “She refused to have the c-section and left.” This despite being warned that lack of treatment could result in the death or severe injury of her babies.

A few blocks away she told a nurse at Salt Lake Regional Hospital that a doctor wanted to cut her “from breast bone to pubic bone”, and that would “ruin her life”. The nurse says Rowland made a comment to the effect that she’d rather “lose one of the babies than be cut like that.”

January 9th, Rowland went to Pioneer Valley Hospital to verify that her babies were still alive. Once again she left and refused treatment after warnings that her babies are in danger.

January 13th she went back to Pioneer Valley and delivered her twins. One was dead; the autopsy shows the boy had died two days earlier.

Kent Morgan, District Attorney’s Office: “There wasn’t a lack of resources. Any one of these hospitals could have taken care of the needs and saved this child.”

Rowland is charged with murder and bail is set at $250,000. We’re told that she has other children and is married. She’ll make her first court appearance in the next day or two.

I listened to “Family Values Talk Radio”, 570 KNRS on the way home. Bob Lonsberry, ultra-conservative, was hosting the show. His opinion? That she deserves the murder charge, and one to fifteen years in prison. The vast majority of callers agreed with his assessment, though several thought she was guilty of stupidity, and not murder.

Is failing to have a medical procedure a crime? Is choosing to give birth vaginally tantamount to murder? Are we now a community that incarcerates nursing mothers because they chose to disregard their doctor’s advice?

Some few callers into Lonsberry’s show attempted to turn this around to the abortion debate: we (society at large) have a (debatable, but) definite point at which we consider a baby to be viable human life. If I recall correctly, that point is somewhere around 27 weeks (correct me if I’m wrong). Could this be considered a late-term abortion on her part? What if she was not insured, and the cost of a C-section was prohibitive? Is lack of funds, and a desire to avoid bankruptcy, a defense for allowing an unborn fetus to die?

I’m not sure about all the rationales going on, but in my mind, one thing is certain: sending a mother to jail for up to fifteen years because one of her unborn twins was born stillborn is just plain stupid. It just serves no purpose. With that in mind, the murder charge itself appears ridiculous on the face of it — yet, one person, through her inaction, allowed another human being, albeit a small one, to die.

It got me thinking about the purpose of incarceration. What’s the reason we send someone to jail, anyway? Is it to “rehabilitate” them, in hopes of preventing them from making similar mistakes? Is it to punish them by depriving them of freedom for a while? Is it to protect society from their evil by preventing them from having the choice available to hurt other people?

Perhaps the time has come for us to make certain “unusual” punishments for unusual crimes. If she’s guilty of negligent homicide, incarcerating her in this circumstance seems to serve absolutely no purpose except to perpetrate the revenge of an outraged community.

What if, for reproductive stupidity, we (society) simply removed reproductive capacity? For men, a simple surgical procedure, and they are sterile (reversibly so). For women, an Intra-Uterine device prevents pregnancy for up to a decade, and is also surgically removable.

But then we’re back into state-mandated surgical procedures, which started this whole rant of mine. If successful, I wonder what kind of barrel of monkeys this prosecution will open up?

Realize I’m just kind of writing aloud at the moment; I haven’t fully decided what to think of this yet. But it’s definitely another “fuzzy gray area” of the law that will almost certainly have major consequences on the state of judicial legislation if allowed to proceed.

As a side note, did the police beat her up on the way in or something? She looks completely miserable in the photo.

Last aside, I promise: I feel for the people of Spain today. At least 192 dead and thousands injured in a terrorist attack on trains around Madrid. I’m appalled at news coverage, however: had this happened in the U.S., a disaster like this, with more wounded than the Oklahoma City bombing, would have massive coverage. Not a single talk radio station was even discussing it today, other than a brief blurb in the on-the-hour news from most stations. I guess it’s not a big deal because it’s in Europe or something. Grr.

World’s Best Review of Starsky & Hutch

Go to Starsky & Hutch 2004 reviewed. You know, when I read this review, I’m forcibly reminded that, sans a few details, this particular style of review could be the review for any of a number of action movies…

My favorite lines:

Go to Starsky & Hutch 2004 reviewed. You know, when I read this review, I’m forcibly reminded that, sans a few details, this particular style of review could be the review for any of a number of action movies…

My favorite lines:

“A man shoots at two police officers, they shoot back, and he races away in a car.” Hmm, sounds like Beverly Hills Cop. No, wait, no, umm, that one with Jackie Chan and Chris Farrell. Or, wait…

“Two men in a car race off the end of a pier hoping to land on a yacht but crash into the water.” FREAKING SPOILER!!! AUUUGGGHHH!!!

“Cheerleaders dance with suggestive moves, and they’re wearing tiny outfits that reveal cleavage, bare abdomens, bare thighs and parts of their bare buttocks as two men look on with interest.” Sounds like I’m back in high school. Oh, wait, I was the cheerleader.

Free Powerbook — exposed

From time to time, I do a little shopping online. I actually prefer to purchase my consumer electronics this way, because I’ve generally found the price and selection far superior to what I can get at my local CompUSA. Then again, return policies are often a pain when hunting online for stuff (but, apparently, CompUSA has problems with returns as well.).

Anyway, while rummaging around the gigantic dustbin that is eBay looking at G4 iBooks and PowerBooks, I ran across a listing of “Powerbook for $150”. I thought that looked intriguing, until I read it and realized it was the same scam all over again:

THIS AUCTION IS FOR INFORMATION ONLY NOT THE ACTUAL COMPUTER!!!

This auction is for a link to a website where Apple Powerbook G4 are offered for the incredible price of $150.00. The items are brand new, never used, not refurbished or anything like that. All it takes is a little patience.

From time to time, I do a little shopping online. I actually prefer to purchase my consumer electronics this way, because I’ve generally found the price and selection far superior to what I can get at my local CompUSA. Then again, return policies are often a pain when hunting online for stuff (but, apparently, CompUSA has problems with returns as well.).

Anyway, while rummaging around the gigantic dustbin that is eBay looking at G4 iBooks and PowerBooks, I ran across a listing of “Powerbook for $150”. I thought that looked intriguing, until I read it and realized it was the same scam all over again:

THIS AUCTION IS FOR INFORMATION ONLY NOT THE ACTUAL COMPUTER!!!

This auction is for a link to a website where Apple Powerbook G4 are offered for the incredible price of $150.00. The items are brand new, never used, not refurbished or anything like that. All it takes is a little patience.

I finally decided over this weekend to get to the bottom of these “info” eBay postings. After too much research, time spent online, time spent verifying stories, I can boil down the reality for you in three words:

It’s a scam.

OK, yeah, wiser heads than me could have figured out right from the get-go that you’re not going to get a $1500 computer for $150. But I finally figured out how this scam works — and the people get you both coming and going on this one. You pay them X dollars for “information” on how to get a free PowerBook. Then they rope you into the “program”.

What’s the “program”? Well, they’ll call it “network marketing”, or “matrixing”, or “the grid”, or any of a number of terms to make you think it’s anything but what it actually is.

The scheme goes something like this: For $150, you buy yourself a “position” in “the matrix”. You sign up X number of people under you, and they sign up X number of people under them, and if you’re patient and work at building a downline, eventually you’ll be shipped a brand-new Apple PowerBook. Seems like a sweet deal, doesn’t it?

Well, unfortunately, these schemes are only quasi-legal, and normally cease to exist the moment there’s a lawsuit. And, as millions of Amway (*cough*, ahem, excuse me, “Quixtar”, billing itself as an “e-commerce company”) former resellers can attest, such schemes are the road to ruin for most of their proponents.

I got sicker and sicker the more I realized that I’d heard this same story over and over again. I respect “direct sales”-oriented MLM’s. The Pampered Chef. Home Interiors. Even, (ahem: link for adult couples only) Slumber Party. These are companies with some network marketing aspect, but the main goal is that you make your money selling the product. I can respect that. But organizations where the main goal is to recruit more people is just abusive. And they contaminate the relationships people value most: friends, colleagues, people at church.

In my opinion, the only ones getting the “free Powerbooks” from eBay “Info” postings are the con artists doing the postings, who are also probably using it to fill their downline. And the average person gets sidelined by these rapscallions, buying into a “something-for-nothing” dream… and gets the shaft.

Friends don’t let friends drive pyramid schemes.

SMS Spam

So today, for the first time, I received spam on my mobile
phone. That’s right, I got spammed to my phone! And the
worst part is, that I don’t have much of a leg to stand on
trying to defend myself from it. It was obvious that it
was tailored for SMS. The email was very short, contained
no HTML or anything else.

Not like I’m going to scream “the sky is falling”, but if
I got as much spam to my mobile phone email address
as I do to my personal inbox, I’d be inundated and
the notifications I use for business reasons would be useless
since I’d tend to disregard my SMS notifications. I wonder
if Sprint has something set up to “only allow SMS messages
from foo” or something. Considering that they underplay
SMS on their phones anyway (they encourage you to set up a
gateway server and a $3,000 product instead), I doubt they
will want to do anything about it.

So today, for the first time, I received spam on my mobile phone. That’s right, I got spammed to my phone! And the worst part is, that I don’t have much of a leg to stand on trying to defend myself from it. It was obvious that it was tailored for SMS. The email was very short, contained no HTML or anything else.

Not like I’m going to scream “the sky is falling”, but if I got as much spam to my mobile phone email address as I do to my personal inbox, I’d be inundated and the notifications I use for business reasons would be useless since I’d tend to disregard my SMS notifications. I wonder if Sprint has something set up to “only allow SMS messages from foo” or something. Considering that they underplay SMS on their phones anyway (they encourage you to set up a gateway server and a $3,000 product instead), I doubt they will want to do anything about it.

Then again, I wonder if I brought it upon myself. The other day, I became a registered user at 3gupload.com. It’s an incredibly convenient service, where I can upload ringtones, games, pictures, etc. to my “locker” on their site, and then be able to transfer the stuff to my phone over-the-air. But I wonder if I was a victim of a drive-by spamming, or did I open myself up to it by giving my SMS address to what is reputed to be a legitimate service?