Peter's Blog

Redefining the Impossible

Items filed under email


I'm back to using Outlook for two reasons:

  • the journal feature may be useable as a desktop notetaking tool. Being integrated into the email program means fewer apps running and a leaner and meaner system (ha). It does look like a half decent note taking tool, entries can be formatted, pictures pasted in etc.
  • was reading how hackers can carry packet sniffers on memory keys and became paranoid about my unencrypted password floating around the ether(net). I looked into setting up ssl authentication on the exchange server but it involves messing around setting up an ssl certificate server and I couldn't be bothered.

I've given up on using folders to categorise my email: I leave it all in the inbox and rely in searching to find stuff. I have google desktop search to speed this up but that still thinks I am still using thunderbird and tries using that to display messages. How to persuade it I have vaccilated back to the evil ones?


4 Comments

There are three ways to blog from a pocketpc that I have found:

  1. open your blog in a web browser and edit it as normal. This doesn't work so well in practise unless your web page has been designed with a css style sheet that works nicely on a pda. I tried modifying my drupal theme accordingly and made it presentable but it's not up to data entry.
  2. try using an application for posting to blogs. There are a couple of these about but those that I tried were buggy or had tiny little edit boxes.
  3. write the article and submit by email. This is how I am posting this, I use phatnotes, a notetaking application that can send the notes via email. I don't use pocket outlook for the simple reason that it doesn't seem to save sent mail so I cannot edit the article and send it again to modify it. I use my old mailbot script on the server to capture posts and poke them into drupal.

So far this has worked ok and I can compose posts offline and upload them at my leisure.

Disadvantages:

  • No preview unless I go online, hence I keep posts simple.
  • cutting and pasting urls is fiddly and I cannot be bothered with it.
  • my script adds tags by scanning the database for existing tags, searching the post for the tag words and adding the tags that it finds. This can give irrelevant tags and I cannot define new tags. I need a neat way to specify tags in the post.

Advantages:

  • the convenience of whipping my pda out and having a quick blog. I don't have to go upstairs and get my laptop.
  • can lay on settee and blog in comfort.

2 Comments

I've discovered Thunderbird saved searches. They allow me to create items in the tree thing on the left that act like folders full of messages that meet certain search characteristics. For example, I can have an item called 'fred' containing all messages from 'fred'. Previously to do this I would create a folder and get my filtering rules to try to shuffle incoming messages into the right folder. In outlook this was always flaky, in thunderbird I've never bothered. Saved searches are much easier to set up and have the advantage that if you change the search terms then the changes are applied immediately, you don't have to run all your messages through filtering rules again. Also messages can meet more than one search pattern: I could have a search for everyone in project X and I could also have searches for specific people in project X: the same messages could appear in both.

It's working nicely with Microsoft Exchange via IMAP: the searches occur instantly, no real overhead. This may be because the IMAP is offloading the search to the server. If the search was done locally I doubt that it would be so transparent.

Hum, as a concept these stored searches could be considered an alternative to tagging. Instead of manually having to mark an article as being about, say, ubuntu, the stored search would automatically search for the word ubuntu in the article and list the matches. It is more fiddly to create a search than a tag but they would require less maintenance. Tagging does give the possibility of structuring articles. Something else to think about.


2 Comments

Servant Salamander: coming to rely on this. Pretty much destined to register it. Today I discovered that I can get it to calculate space used in subdirectorys and then send a report of directory names and sizes, sorted by size, to the clipboard. Try doing that with Windows Explorer. I've stopped using filezilla, Salamander is a useful sftp client. Things I do wish it could do:

  • copy directly from one sftp site to another. Similarly, since you can browse straight into a zip or tgz file, it would be nice to be able to copy a file from within an archive on one window to other window showing an sftp site. The user interface spoils you, you start thinking these things are possible, you try them and are thwarted.
  • create tar.gz files. I have actually learned the incantation for this, I am becoming such a command line junkie:
    tar cvfz blah *
    
    It can do zips and rars and stuff.
  • It sometimes goes a bit crazy with the confirmation dialogs, sometimes giving two or three in a row. I don't have faith enough to disable them, combining them into one dialog would be nice (e.g. yes I want to copy, I want to copy it there, I want to overwrite everything).

Thunderbird: since I fixed the exchange server I have been using this instead of outlook and have not looked back. I use an IMAP connection to the Exchange server and it is working just fine. I used to have problems with it when my network connection was flakier (it kept asking me for my password) but since I installed XP on my pc the network has been ok (one of those software decay things on my old Win2k install). I think outlook was tainted by spambayes which was pretty lethargic in moving spam around (to get around outlook's flaky message filtering it does lots of sleeps to keep out of the way). So you go to look at a message and find that spambayes is still in the process of moving it to the junk folder. Thunderbirds integrated bayesian spam filter is working for me. Another thing I like about thunderbird, the flag thing that pops up and goes away again when new mail arrives. The outlook taskbar thing always used to get stuck on, even after deleting new messages, to the extent that I disabled it.



I put postfix on my linode for mail handling. The installation went smoothly enough, loading the ubuntu package and editing /etc/postfix/main.cf to set up the domain names to be accepted. However, I had trouble receiving mail from outside. Trying to telnet in on port 25 told me that the smtp daemon was not listening.

The solution to this was to edit the /etc/postfix/master.cf file and change the lines:

127.0.0.1:smtp inet n   -       -       -       -       smtpd
::1:smtp       inet n   -       -       -       -       smtpd

to

smtp      inet  n       -       -       -       -       smtpd

which tells it to listen to any connection to the smtp port, not just local connections.

According to this site I haven't put up another open relay. (note to self: publish open relay test, lie about results and build nice list of open relays to sell to spammers).


Filed under: email linode postfix ubuntu


Someone at work got a phishing email. Looking through the html, I found this:

 <p class=MsoNormal><font size=2 color=black face=Verdana><span
  style='font-size:10.0pt;font-family:Verdana;color:black'><a
  href="http://www.paypal-3089740289dsdasdfedd.8800.org/navbar/34098.html"><span
  style='text-decoration:none'><img border=0 width=117 height=35
  id="_x0000_i1025" src="http://paypal.com/en_US/i/logo/paypal_logo.gif"
  onMouseOver="click('')"></span></a><o:p></o:p></span></font></p>

I'm no expert in javascript but it looks to me like just moving the mouse over an image is going to cause it to be clicked, taking you to a paypal clone site and filling your hard disk with spyware. Outlook XP disables javascript in emails, and just as well.


Filed under: email outlook phishing

2 Comments

Latest MTA to use under linux is postfix as this appears to be a ubuntu standard. I fancy trying something a bit lighter than exim and there doesn't appear to be a debian package for qmail and I can't be bothered to build it.

As this mail server is running on my little intranet box at work I need it to forward internal email to the company internal email server. If I email pcw@mycompany.com from the box the email gets bounced with "Name or service not known" because the DNS server configuration is screwed up and mycompany.com resolves to the internal file server, not the mail server.

Anyway, I worked out the postfix incantation to do this and it's not a pretty thing, it doesn't bode well for postfix ease of use:

  • Create/edit a file called /etc/postfix/transport
  • Add relay instruction along the lines of:
    mycompany.com        smtp:192.168.0.5
    
    or wherever you want to relay to.
  • execute the command
    sudo postmap /etc/postfix/transport
    
  • edit /etc/postfix/main.cf and add the following:
    relay_domains = $mydestination, mycompany.com
    transport_maps = hash:/etc/postfix/transport
    
  • execute the command
    sudo postfix reload
    
    to reload the configurations (or /etc/init.d/postfix restart).

This worked for me, from my server box I can email myself on internal email allowing me to get messages from servers etc.


Filed under: email linux postfix ubuntu

1 Comment

email, electronic mail. If you want to know more, email me and ask.


Filed under: email


I've been contemplating some python web development. This is mainly for the following reasons:

  • I'd like my blog to have features for threading subjects based on keywords, a kind of related articles list. This would be dynamically updated, old articles could link to newer articles. This is possible in Drupal but the taxonomy system is laborious to configure through the web interface. There is a new keyword feature (folksonomies) but it appears to be a library for other modules to use. There are some modules that promise this kind of thing but they are not what I am looking for. The most important thing is that old articles are displayed with links to new articles, which involves messing around with themeing to add links to a cached page or figuring out how to flush the cache and put articles through a filter that would add the links.
  • I'd rather spend my limited programming time being creative with technologies I am already familiar with. I don't like php enough to want to learn it any more. I know and like python.
  • I don't want to spend my time trying to figure out how the Drupal code base works. Ok, I'm lazy and I have a short attention span and I'm not very interested in how it works.
  • If I do this as a spare time project I want to enjoy it, I don't want it to feel like a maintenance exercise. I can do that at work.
  • I have found that using librarys etc written by third partys can give you 95% of what you want, then you spend weeks trying to hack them to get the extra 5%. The only exception to this rule I can think of is the python standard library which is way cool.

So I looked at a few web application frameworks. This is a little lightweight and short on detail, I did most of it a few weeks ago and I didn't take notes.

cherrypy: Requires python 2.3 and my hosting service will only give me python 2.2 with cgi. I think generator functions are way cool and I'd love to use them. Do I stand any chance of getting my hosting service to upgrade? I'll email them and ask.

quixote: got the demo going, although I had to fix some of the urls within it as they appeared to be broken. It worked easily enough with cgi, the 1.3 version worked with python 2.2. However, again they have just released version 2 which has a couple of yield statements in it, limiting it python 2.3.

webware: I don't think I could see the advantage of 'servlets' and their web site (presumably powered by webware but it only says 'python powered') is not an impressive display of it's capabilities.

zope/plone: I've toyed with zope in the past (version 2) and found it's learning curve to be almighty. It may be very capable but you have to learn the zope way to do everything. The developers seem to be concentrating on inventing new object-orientated paradigms rather than keeping things simple and I hate huge complex object models. I don't like the web-based source editor (what, no syntax highlighting?: although I could use mozex and edit in vim). Also, non-cgi.

I was most interested in quixote until I came to the python 2.3 stumbling block with the new version 2. I don't want to settle for an old version. This led me on to think about what these frameworks actually give me:

  • map urls to class/method calls
    • big deal
  • session management
    • do I need it for my simple purposes?
  • templating systems
  • interface to cgi/mod_python/fastcgi/whatever
    • I can only have cgi anyway
  • easy form generation
    • classes to build the contents of a form. How many forms will I need? Can't templates do this?
  • already used on the internet and exposed to hackers
    • lets not be too ambitious with what we do. Keep drupal in the background for data entry.
  • learning curves

Which has led me to... straight cgi. Run my own scripts from cgi, using the cgi module in the standard python library to get the url parameters and generate a nice error page when things go wrong. I can get it going easily enough and below, with just a few hours hacking, is something that can display nodes from the drupal database. The output is themed through the Cheetah template engine and gives me the same look as my drupal theme. Given that it is only cgi it is not massively scalable, but I understand every line of it and that means a lot in terms of development time. Given that it generates pages that look like the drupal pages, I can chop and change, leaving some bits to drupal (data entry) and others in python (presentation). It's a lash up but so what?

The main challenge is porting my wilki module to python, particularly the geshi syntax highlighting.

I am not planning to rewrite Drupal and I probably won't release Yet Another Python Web Framework. I may not even finish it. It is something for me to play with.

   1  #!/usr/bin/python
   2  #
   3  import Cheetah.Template
   4  import cgi
   5  import cgitb; cgitb.enable()
   6  import time
   7  import datetime
   8  import os
   9  import pdo
  10  
  11  def ThemeAndOutput( strPageTitle, strContent, oParams={}):
  12      "Theme the site"
  13  
  14      strSideBar = """
  15      <div class="block">
  16      <h2>Reports</h2>
  17      <ul>
  18          <li><a href="Intranet.cgi">Drupal Emulator</a></li>
  19      </ul>
  20      </div>"""
  21  
  22      oDict = {
  23          'Root': '/SMB',
  24          'Url': '/Intranet/Intranet.cgi',
  25          'Title': 'Drupal Emulator',
  26          'Slogan': 'There are no Problems, only Challenges',
  27          'PrimaryLinks': [ '<a href="http://intranet.org">Intranet</a>',
  28                              '<a href="http://www.google.co.uk">Google</a>'],
  29          'PageTitle': strPageTitle,
  30          'SideBar': strSideBar,
  31          'Footer': 'Copyright 2005 Peter Wilkinson'
  32      }
  33  
  34      #
  35      # Read page template and shove in the content.
  36      #
  37      strTemplate = open( 'PageTemplate.html').read() % { 'Content': strContent}
  38  
  39      #
  40      # Run template and content through cheetah in one go.
  41      # Is this faster? Doubt it.
  42      #
  43      oHtml = Cheetah.Template.Template( strTemplate, [oDict, oParams])
  44  
  45      print str(oHtml)
  46  
  47  def MainPage( oForm):
  48      "Main welcome page: tell user what is going on"
  49  
  50      #
  51      # Determine how many links to show.
  52      #
  53      strFrom = oForm.getfirst( 'from')
  54      if strFrom == None:
  55          strLimit = ' LIMIT 10'
  56      else:
  57          try:
  58              nLimit = int(strFrom)
  59              strLimit = ' LIMIT %d, 10' % nLimit
  60          except:
  61              strLimit = ' LIMIT 10'
  62  
  63      c = pdo.connect( 'Module=MySQLdb;user=drupal;passwd=secret;db=drupal')
  64      rs = c.open( 'SELECT * FROM node ORDER BY created DESC %s' % strLimit)
  65  
  66      strTitles = []
  67      while rs.next():
  68          strTitles.append( '<a href="Intranet.cgi?node=%s">%s</a>' %
  69                (rs.fields['nid'].value, rs.fields['title'].value))
  70  
  71      strPage = """
  72  <ul>
  73  #for $strTitle in $titles
  74  <li>$strTitle</li>
  75  #end for
  76  </ul>
  77      """
  78  
  79      ThemeAndOutput( "Welcome", strPage, { 'titles': strTitles})
  80  
  81  def NodePage( oForm):
  82      "Display a node"
  83  
  84      strNode = oForm.getfirst( 'node')
  85      if strNode == None:
  86          ErrorPage()
  87          return
  88      else:
  89          try:
  90              nNode = int(strNode)
  91          except:
  92              ErrorPage()
  93              return
  94  
  95      c = pdo.connect( 'Module=MySQLdb;user=drupal;passwd=secret;db=drupal')
  96      rs = c.open( 'SELECT * FROM node WHERE nid = %d' % nNode)
  97  
  98      if rs.next():
  99          strTitle = rs.fields['title'].value
 100          strBody = rs.fields['body'].value
 101      else:
 102          ErrorPage()
 103          return
 104  
 105      strPage = """
 106  <h2>$strTitle</h2>
 107  
 108  <pre>
 109  $strBody
 110  </pre>
 111      """
 112  
 113      ThemeAndOutput( strTitle, strPage,
 114            { 'strTitle': strTitle, 'strBody': strBody})
 115  
 116  def ErrorPage():
 117      strPage = """<p>There has been some kind of navigation error, the link
 118  you just clicked is broken</p>
 119  <p>Better <a href="mailto:someone@somewhere.com">complain about it</a>.</p>
 120      """
 121  
 122      ThemeAndOutput( "Drupal emulator", strPage)
 123  
 124  oForm=cgi.FieldStorage()
 125  
 126  node = oForm.getfirst( 'node')
 127  if node:
 128      NodePage( oForm)
 129  else:
 130      MainPage( oForm)
Toggle Line Numbers

The page template is kept in a seperate file. It is based on the phptemplate of my drupal theme and was ported over in less than an hour. Theming engines? A specialisation of templates.

   1  Content-Type: text/html
   2  
   3  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
   4   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
   5  <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
   6  <head>
   7  <title>$Title</title>
   8  <meta http-equiv="Content-Style-Type" content="text/css"/>
   9  <style type="text/css">@import url(style.css);</style>
  10  </head>
  11  <body>
  12      <div id="headerleft">
  13      </div>
  14      <div id="headermain">
  15          <div id="ie6hack">
  16          </div>
  17      </div>
  18      <div id="headertitle">
  19          <h1>
  20              <a href="$Url" title="$Title">
  21              $Title</a>
  22          </h1>
  23      </div>
  24      <div class="slogan">
  25          $Slogan
  26      </div>
  27      <div id="logo">
  28          <a href="$Url" title="$Title">
  29              <img src="ITL.gif"/>
  30          </a>
  31      </div>
  32      <div id="headerright">
  33      </div>
  34  #if len($PrimaryLinks) > 0
  35      <div id="primarylinks">
  36          <ul>
  37  #for $PrimaryLink in $PrimaryLinks
  38              <li>$PrimaryLink</li>
  39  #end for
  40          </ul>
  41      </div>
  42  #end if
  43  
  44      <div id="ie5forcemargininsidehack">
  45          <div id="main">
  46              <div class="tab">
  47                  <div class="tabbackground">
  48                      <div class="tableft">
  49                          <h3>
  50                              $PageTitle
  51                          </h3>
  52                      </div>
  53                  </div>
  54              </div>
  55              <div class="tabbody">
  56                  <div class="ieisbuggy">
  57                  </div>
  58                  <div id="content">
  59                      %(Content)s
  60                  </div>
  61                  <div class="ieisbuggy">
  62                  </div>
  63              </div>
  64          </div>
  65          <div id="footer">
  66              <div class="footerleft">
  67                  <p>
  68                  $Footer
  69                  </p>
  70              </div>
  71          </div>
  72      </div>
  73      <div id="sidebarright">
  74          <div id="sidebar">
  75              <div class="sidebarbox">
  76                  $SideBar
  77              </div>
  78          </div>
  79          <div id="sidebarbottom">
  80          </div>
  81      </div>
  82  </body>
Toggle Line Numbers


Been playing with The Brain some more:

  • By linking a folder to a thought and creating virtual thoughts for all files in the folder, I can apply meta-data and define new relationships between files, beyond what a simple folder hierarchy can do. It's an interesting concept, but I need to think of a use for it. Maybe creating shortcuts to useful files, each shortcut having a note to remind me what the file does beyond it's name.
  • The context menu for virtual thoughts gives some of the windows explorer options such as 'open', 'edit', 'edit with VIM' etc, it is not restricted to opening them. This is useful to me, giving me the option of running or editing python files.
  • Similarly, brain promises it can spider a web site, building a map of all the pages, each thought linking to the corresponding page. Unfortunately this seems to be broken:
    1. it stopped with a weird access error half way through my test
    2. the links it did create didn't work, some problem with absolute vs relative urls.
  • It has some nice keyboard shortcuts, it is possible to do extensive navigation and map buildng using just the keyboard.
  • If I just start typing a word then by default this goes into the search box and does an incremental search. Very fast way of finding things.
  • I don't think the virtual thoughts for files appeared in the search list.
  • Dragging an email from outlook causes the corresponding .eml file to be stored in the brain and opened when the thought is clicked on: nice way to organise email.
  • Since the RTF notes support OLE I can embed excel spreadsheets in them. Maybe RTF isn't so bad.
  • Except the program create a 388 byte empty RTF file for every though, even when I don't put anything in them.
  • Program was last modified in March 2004. It's not perfect so is it still under development?
  • It is supposed to be version 3.0.2 but the tooltip in the task bar and at least one comment in the help file says version 2.0.
  • Despite it's flash graphics it is nice and fast. I can imagine the new graphical UI coming out, based on Avalon and similar, providing gimmicky interfaces like this.

Conclusion: I still like it.



Next in my Outliner quest is TheBrain. This is a radical looking outliner:

images/TheBrain.jpg

Each node in the diagram is called a 'thought' and it can have multiple parents, children and peers (not siblings, they can have different parents). This allows incredibly complex mappings of relationships to be created. For an idea of what it is like to use, try the WebBrain which needs java enabled in your browser. The mappings form more of an amorphous blob than a tree and so can model all kinds of things. It is more of a brainstorming tool than an outliner.

Review:

  • it is fun to use
  • it is easy to get lost
  • you can assign web pages, applications etc to thoughts, so they launch when you click on them
  • I tried mapping mail addresses to people thoughts but the mailto link was broken by the time it reached outlook.
  • A folder can be assigned to a thought, in which case 'virtual thoughts' representing the files in the folder appear in the map.
  • can export data as XML, although I haven't tried that yet to see how complete it is.
  • RTF notes can be assigned to thoughts. Unfortunately these cannot contain hyperlinks but they can contain OLE objects (remember OLE?).
  • It is easy enought to search for items or assign keywords and types to them. Tell the difference between people and computers in your map.

TreePad seems more a way of organising articles that TheBrain, which is a way of arranging thoughts and pushing them around as a way to see new relationships. It is interesting putting a family tree or company organisation chart into it and examining it from all angles.

I'm having fun playing with it. I came across other Mind Mapping tools in my exploration but TheBrain's totally unique UI appeals to me.


3 Comments

Had a big problem with the Exchange Server. It stopped working and upon rebooting the system the exchange services would not start. The principal service that was stuck was the "Microsoft Exchange System Attendant" and the other services were waiting for it. Result: no company email for two and a half days.

When the service finally gave up trying to start it would give the following error:

The Server is not operational
Facility: Win 32
ID no: 8007203a
Exchange System Manager

Someone had been altering the configuration of the DNS server over the weekend and had deleted a few zones that did not appear to be used. Looking through the list of computers in the Active Directory on the Domain Server (a different box to the Exchance Server), these all had their URLs specified as being in one of the zones that was deleted. On a hunch I recreated one of the deleted zones with a single host entry for the exchange server and, voila, exchange started and has been fine.

It seems that the basic cause was that Exchange could not get access to the Active Directory on the Domain Server, probably because the Domain Server was doing some kind of validation on the IP address that was failing.

What is weird is that all other Windows computers in the building were in the same deleted zone but everyone was still able to log into the domain server. There may be some extra security in there to get access to Active Directory compared to logging into a domain, who knows.


Filed under: email exchange windows

2 Comments

Google have released their new non-beta desktop search. Since they have given me pagerank 0, here's some spiteful Microsoft Desktop Search Evangelism:

  • New GDS has a plugin API. MDS already has installable filters for extra file types based on established technology: see here and here and especially here. Ok, IFilters are all based on deeply pretentious COM models so I wouldn't want to try writing them. Interesting to see that you can load filters through a win32 API called LoadIFilter. Wonder if this is of any use?
  • MDS can index PDF files by downloading Adobes own plugin.
  • MDS indexes my outlook messages, even though they are stored on an exchange server: can GDS do that?
  • MDS doesn't take copies of the documents it indexes so saves lots of disk space.
  • I do find MSN search useful, especially the taskbar thing. I like the way
    =regedit
    
    launches the registry editor without me having to open the 'run' box or a command prompt. Dunno if GDS can do this.
images/MDSTaskbar.jpg
  • I don't like the way GDS gives results in a web browser: it only gives you the option of opening files it finds: you cannot edit them, copy them or whatever. MDS results are presented in a file explorer, much more useful.

4 Comments

I was looking at the Microsoft Genuine Advantage Program as I wanted to try the Microsoft Antispyware beta. One of the goodies on offer was a 6 month trial version of Microsoft OneNote which is a program for taking notes and organising them. By the time a 6 month trial is finished I am either using something every day or I have not touched it for 5 months so I thought I would give it a try.

I am always interested in new ideas for organising notes. I've tried Wikis but web apps are a bit too slow and fiddly. I've tried blogging but I end up typing more than is necessary in order to be descriptive. I've tried outline editors but I never really get into the habit of using them. For notes I just want to bang in bare details, paste stuff in with a 3 word description.

OneNote gives you the following:

  • A simple place to type in arbitrary text. You click anywhere on a page and type away, giving a box with a note in it.
  • The notes are organised into a confusing multi-layer hierarchy of sections, folders and pages which map onto folders, subfolders and files in the physical file structure. Essentially there are multiple levels of tabs. However, once you have chosen a name for a section and folder, you don't really have to worry about giving your notes names or wonder where to save them.
  • Can drag and drop file or folder locations from explorer to a link in a note and then annotate them. Later you can click on the link to open them. Ditto for urls in FireFox. Cool way to build annotated bookmarks or add metadata to your file system.
  • Paste images into notes
  • A cool 'screen snippet' facility that lets you mark an area of screen and capture a bitmap to poke into your note. This has a bug on my multi-monitor setup whereby the cursor does not appear on one of the monitors.
  • Taskbar OneNote button for post-it functionality
  • If you are one of the select few that have a tablet PC then you can scribble on the pages with a crayonpen. You can use the mouse if you want to write like a three year old.
  • Spelling checker
  • Search through notes for keywords
  • Very basic automation interface that just about allows you to post new items. Here I use Python to poke in a new page:
       1  #
       2  # Poke an entry into OneNote
       3  #
       4  
       5  import win32com.client
       6  import pythoncom
       7  
       8  oOneNote = win32com.client.dynamic.Dispatch( 'OneNote.CSimpleImporter')
       9  
      10  strTemplate = """<?xml version="1.0"?>
      11  <Import xmlns="http://schemas.microsoft.com/office/onenote/2004/import">
      12      <EnsurePage path="Postings\\Posts.one"
      13          guid="{10DA1EEF-6415-4ae8-AF79-9E099F3800A8}"
      14          title="Odours" />
      15      <PlaceObjects pagePath="Postings\\Posts.one"
      16                 pageGuid="{10DA1EEF-6415-4ae8-AF79-9E099F3800A8}">
      17          <Object guid="%(ItemGuid)s">
      18              <Position x="10" y="10"/>
      19              <Outline>
      20                  <Html>
      21                      <Data>
      22                          <![CDATA[
      23                              <html><body><p>Sample text here.</p></body></html>
      24                            ]]>
      25                      </Data>
      26                  </Html>
      27              </Outline>
      28          </Object>
      29      </PlaceObjects>
      30  </Import>
      31  """ % { 'ItemGuid': str(pythoncom.CreateGuid()) }
      32  
      33  oOneNote.Import(strTemplate)
    
    Toggle Line Numbers
    Notes on this:
    • You need to know the Guid of pages to add stuff to them and there is no way to inspect the guids of existing objects so you have to create guids for you own objects and remember what you called them.
    • It won't create guids automatically, you have to do it.
    • You have to specify the position (x,y) of an object on a page and there is no way of knowing if it will collide with another object. The interface was added as an afterthought in SP1 and it shows.
  • Encrypt pages, save passwords etc

What it doesn't give you:

  • No way to link from one note to another, in a different section for example. Hypertextual linking would take it to a new dimension.
  • Can't drag and drop a note from one page to another, have to cut and paste.
  • Integrate OneNote with Outlook or Word unless you have Office 2003.
  • You can only export files in .mhtml format, a mime encoded html archive. Not total lockin but close. No way to extract data through automation interfaces.

I'm going to give it a try, to see if it will become indispensable to me. It seems very version 1 (which it is), there seems to be a lot they could have done with it. However, give Microsoft credit, this does not appear to be another 'me too' app designed to crush competitors but an actual attempt to create a new product.

Update:

This suddenly got more interesting:

  • You can drag and drop an email message from outlook to onenote and the email message is stored in a '.msg' file and a link to the message goes into your notes. Something I have always wanted, the ability to thread emails with notes. This turns out to be a standard thing in Outlook (Xp version anyway), you can drag and drop messages into the desktop.
  • You can scribble on notes with 'ink' and save it all to a .mht file which just about anyone can admire in internet explorer. Amaze your friends. This example may work in Explorer, FireFox may show the raw mime message, which is interesting in itself, eminently parseable.
  • The 'research' feature is set of onlike books. You can look up words like 'plaintively' which aren't covered by google define.

3 Comments

Since Gmail have given me 100 invites I have decided to give my site it's own gmail account:
images/mail.png
. I don't quite have enough faith in gmails spam filters to put the raw email address here yet. prattboy@gmail.com would agree.

I realised today that I can just set up the auto-forwarding in gmail to forward this email to my main gmail account so I don't have to go through the tedious process of logging out of one gmail account and logging into another.

I haven't tried Gmails new POP service yet. I only see that as a way to create my own email archive. Gmail's user interface is good enough, it's main shortcoming for me is not being able to simply paste pictures into emails, you have to mess around attaching them.

My Site5 account gives me unlimited email accounts or something but this is a simpler option. If I do decide to put up the raw mailto then it's gmail that will have to handle the spam.

If anyone reading this wants a gmail invite then just ask. I think they are so common these days that I doubt I'll get any takers.

A nod to this site for the email icon generator.


Filed under: email gmail hosting php site5

2 Comments

Windows update is offering me the snappily titled Microsoft Windows Malicious Software Removal Tool.

Is this a free adware killer?

Do I need it as I only use IE when web sites won't work otherwise?

Is MS giving it away to make amends for all the security holes in IE?

At work they are deploying Firefox to anyone who wants to use the Microsoft Exchange Webmail feature. Exchange offers two webmail interfaces, a fancy IE one and a bog-standard one for everyone else. The IE one doesn't work outside the firewall because it is giving out URLs from an internal subdain. There is probably a way around this but the Firefox solution is the most expedient.


Filed under: email exchange firefox windows


MSN Desktop search is changing my way of working: now I can find .exe files I don't spend my time clicking around in Windows Explorer finding things, I just use the desktop search bar.

This has lead me back to Outlook as an email client so I can search email. I've done the following:

  • set Outlook up to talk directly to the in-house exchange server.
  • set it to leave messages on the server: why waste my disk space?
  • installed SpamBayes, a glorious free spam filter written in python. It integrates very well.
  • got Desktop Search to index my email.

Desktop Search was reluctant to index the email and I had to read the small print in the help file. Apart from setting Outlook as the default email client I had to delete the registry key:

HKCU\Software\Clients\Mail

like it says as that was set to thunderbird.

Now, why do I have to keep typing my password in whenever Outlook boots? It's the same as my domain password. Whatever happened to single login? Thanks Microsoft, I was in danger of having nothing to criticise you for.


2 Comments

Looks like the spammers have worked out that only the first 6 characters in gmail email addresses are significant and are bombarding gmail with spam. Both my accounts are getting it, none of the email has the exact correct email address. Looks like combinations of words are being used to invent addresses. Gmail is recognising and filtering the spam but I still have to vet the spam list.


Filed under: email gmail


Yesterday:

FireFox
decided to show me profile manager and refuses to let me open my old profile. Have to start new profile from scratch, installing extensions etc sad
ThunderBird
not connecting to IMAP server: waits forever and doesn't time out sad

Filed under: email firefox imap thunderbird

1 Comment

Some of our email servers at work have ceased to be so I am having to send email via a Microsoft Exchange server, using Thunderbird as a client as I despise Outlook.

I was having problems sending mail outside the company: I'd get an error telling me that it couldn't relay messages. I fixed this by telling it to authenticate my login to the Exchange SMTP server.



Trying to emerge today after emerge-webrsync yesterday and getting this:

root@ad-pc root # emerge --pretend griffle

These are the packages that I would merge, in order:

!!! ARCH is not set... Are you missing the /etc/make.profile symlink?
!!! Is the symlink correct? Is your portage tree complete?

I'm fed up with Gentoo, it needs constant nursing and things randomly break. The printer driver died a few weeks ago and none of my kicking has brought it back to life. Ok, it is a high maintenance hackers distribution and I am admitting defeat, I want a lamers out-of-the-box working system.

When/if I get the time I'm changing distribution. I want a fast, compact X-less server system. I'll probably go to Debian Sarge as I liked apt.

Gentoo annoyances:

  • Having to build everything means if you want something you might get it tomorrow if the build doesn't break
  • env-update/etc-update and studying diffs in config files is error prone and tedious
  • emerge generates huge amounts of logging. If I do it in an at job the output emails cause timeouts in squirrelmail and thunderbird takes a few minutes to display them.

Now I think about it, I abandoned SUSE because of the poor rpm support and SUSE's sloooow servers meant I had to build everything.


Filed under: email gentoo linux thunderbird

6 Comments

The gmail way of working is a good model. Mail is received in the inbox, you read it and when you have digested it you press an 'Archive' button to move it from the inbox to the archive directory. I like this, it keeps the inbox clean of everything except email that needs dealing with. The old messages are out of the way, in a place where they can be ignored until 2 years later when you need to prove someone wrong.

I have started working like this on my dovecat IMAP/squirrelmail setup: I deal with stuff in the inbox and move it to one of the following:

  • a project related folder
  • an archive folder for general stuff.
  • a 'spam.categorically' folder

This has another advantage because the archive folder will be full of 'ham' messages (not spam) and makes a good input to the spamassassin bayes filter. Messages in the inbox can go from 'unread' to 'deleted' very quickly, in which case the bayes filter does not get a chance to look at them as it learns on a cron job every night (hoping it will learn the new keyword 'rolex' real soon).

I still need to realise my dream of publishing the contents of the project related folders on a web server where they can be searched, linked to and ideally threaded. This needs some kind of mega mail tool. The closest I can find is mail list server stuff which I am not sure can deal with CC's etc. Mailman may be hackable, being python, but where I've seen it used the presentation is pretty poor, one of the things that puts me off subscribing to mailing lists.


Filed under: email gmail imap python


Today I realised that I could use mozex and vim to edit email. I tried this with gmail and it went into a weird endless loop until I killed firefox. So I had a more serious try at using squirrelmail on my local imap server. Using gmail as a client had been bothering me as it's more of a black hole than outlook: how could I ever get my email archives back?

Running through email client alternatives:

Outlook
Big slow lumbering, much loved by ignorant phb's. Message filtering rules randomly disable themselves and cannot be relied upon. Taskbar indicator says messages are waiting even if filters mark them as read.
Thunderbird
Feels like a poor clone of outlook express. Whenever it can't connect to the imap server it decides it is because the password is wrong and I have to enter it again. Getting on my nerves.
Eudora
it only seems to last for about 5 minutes whenever I install it. I think 'so what' and delete it.
mutt
user interface design from the 1970's.
gmail
insists on putting signatures at bottom of replies, annoying for a top-poster like me. No way to get at archives apart from forwarding them all to self. Taskbar notifier either flaky or very sensitive detector of flaky networks. Notifier prompts me for user name and password whenever the pc boots. Both are already filled in I only have to press OK so it's not a security feature just an annoyance.
Squirrelmail
web-based, a little simplistic but not as simplistic as horder or neomail.

I have yet to find a truly lovable email client.


4 Comments

Installed the coolest new geek toy Google Desktop Search. This is essentially an indexer that will index your:

  • text files (including python source)
  • word documents
  • excel documents
  • email (outlook/outlook express only)
  • Instant Messaging (kiddies toys)

You can then search for files in IE/Firefox exactly as you would if searching the internet. It even taps into your internet google searching and adds things it finds on your desktop to your google search results (magic).

My thoughts on this:

  • Showing results in a browser is not always useful. You can click on the links and open the file but this runs the default 'open' action which for python scripts is to run them. I almost always want to open them in vim. I guess I'll have to reprogram the 'open' action. Still, makes me wish explorer search worked like this.
  • How does it compare to the indexing service built into win2k/XP? I've never bothered much with this. The XP one has had the paperclip team working to make it flashy and useless but you can set it to do a plain grep like win2k. It only shows file names in results, it won't show context like google desktop search. Any new search killer app that ms bring out or build into longhorn is likely to be equally reliant on writing complex filters with a billion COM interfaces to search through new file types.
  • It didn't index my drupal .module files. I'll try defining a .module extension in windows to see if google search picks them up or if it is just internally restricted in which file extensions it will index. There's nothing obvious in the registry to add file types.
  • It may tempt me back to using outlook as an email client. It will search and properly thread emails. I have always found outlooks searching too slow to be useful (I have 400M email archives full of big attachments).
  • If it could index the company intranet it would be very useful. The intranet's search facility is broken and the admin doesn't know how to fix it. The Intranet is laid out in a poorly organised manner and is simply a load of links to word documents on the company file server, which themselves are laid out on the file server in a poorly organised manner.
  • I had to install Win2k Service Pack 4 to get it to install.

5 Comments

I wanted to upgrade to SP2 as it seems to have improved wireless support and my wireless is sometimes a little flaky when coming out of hibernation. I'm not too fussed about the security problems as I only use IE on broken web sites and I don't use outlook express, I use email clients that aren't full of back doors.

I have heard that people had problems with SP2 on Dell Inspiron Laptops including dramatic slowdowns, reboot problems etc. So here is what I did:

  • went to Dell website and read what they had to say.
  • didn't bother removing adware as I am pretty sure I don't have any
  • flashed BIOS with latest version (July 2004)
  • installed SP2
  • rebooted
  • altered security settings to prompt for automatic updates: I don't want it done without me knowing.

All is ok, I'm still online despite firewall, seems pretty much as before. Different status bar icon or wireless. Security centre thing tries to sell me virus software but I can ignore that (I find virus software more intrusive than viruses).

One odd thing: when I started downloading SP2 it appears then 38M of it had already been downloaded. Where did it come from, why didn't it complete? It may explain why the update thing had not hastled me for a while. I had to manually download the jpg security fix.


Filed under: dell email inspiron outlook


I was thinking today how cool and hip I was using Bloglines as an RSS aggregator compared to people who just go through a list of favourite web sites every day. So 1995. Go RSS, join the 21st century.

Then I thought about it some more and this is essentially what I am doing with bloglines: I have a list of feeds that I go through one by one, looking through the articles. No real difference to going through a sidebar full of bookmarks, looking at websites.

If I am going to evangelise RSS aggregation, what am I going to say are the advantages? Why bother?

  • Uniform presentation
  • No adverts (for now: I cannot imagine this will forever be true)
  • Um

I'm going to continue with bloglines as the reasons above are enough for me, I just won't try to evangelise. As it happens I am not a good evangelist: I have yet to convert anyone to FireFox for example which should be pretty easy. Even after I removed the adware from my boss's PC he showed no interest in FireFox.

Maybe I should examine my RSSing habits and figure out if I am missing the point in some way.

The only people I know who are at all interested in gmail are those of a geeky persuasion.


4 Comments

That seems to have worked so here's the code. .procmail is used to identify appropriate emails by subject or sender and pipes the messages through this. Python libraries get the plain text or html content from the message and posts it to Drupal. If an existing posting with the same subject is found then that posting is edited.

#!/usr/bin/python

import sys
import email
import xmlrpclib
import traceback
import StringIO
import time

strMsg = ""

try:
    #
    # Read email message piped in by exim filter from stdin.
    #

    for strLine in sys.stdin.readlines():
        strMsg += strLine

    open( "MailBot.log", "a+").write( "====================\n%s" % strMsg);

    oEmail = email.message_from_string( strMsg)

    #
    # Run email through parser, collecting all text/plain parts.
    #
    body = ""
    strImages = []

    for oPart in oEmail.walk():
        #
        # Look for plain text
        #
        if oPart.get_content_type() == 'text/plain':
            if 1 or oPart.is_multipart() == False:
                strPart = oPart.get_payload( decode=True)

                #
                # Ignore blurb added to message by o2.
                #
                if strPart.find( "This is a Media Message from O2") >= 0:
                    continue

                body += strPart

        #
        # Look for images
        #
        if oPart.get_content_type() == 'image/jpeg':
            strImage = oPart.get_payload( decode=True)
            strFileName = oPart['Content-Location']
            open( '/home/{account}/www/images/' + strFileName, 'wb').write( strImage)
            strImages.append( '<img src="images/%s">' % strFileName)

    #
    # The first line is the title. The rest is the body.
    #
    strBody = body.split( '\n')
    while len(strBody) > 0:
        strTitle = strBody.pop(0)
        if strTitle != '':
            break;

    strBody = "\n".join( strBody).replace( '$', '\\$')

    if len(strImages) > 0:
        strBody = """<table><tr><td>%s</td><td valign="top">%s</td></tr></table>""" % ( "".join( strImages), strBody)

    #
    # Open xmlrpc link to drupal.
    #
    oDrupal = xmlrpclib.ServerProxy( 'http://{site}/xmlrpc.php')

    #
    # Get recent posts and build a map of title->postid.
    #
    oPosts = oDrupal.metaWeblog.getRecentPosts( '', '{someone}', '{password}', 1000)

    oExistingPosts = {}

    for oPost in oPosts:
        strOldTitle = oPost.get( 'title', '')
        if not oExistingPosts.has_key( strOldTitle):
            oExistingPosts[strOldTitle] = oPost['postid']

    #
    # Tweek things somewhat.
    #
    strBody = strBody.replace( '<pre>', '<pre class="literal-block">')

    #
    # Build parameters for post using unicode to pass weird characters.
    #
    oPost['title'] = unicode( strTitle, 'ISO-8859-1')
    oPost['description'] = unicode( strBody, 'ISO-8859-1')

    #
    # See if this is a new post from it's unique title.
    # If it is unique then post it as a new article.
    #
    if not oExistingPosts.has_key( strTitle):
        oDrupal.metaWeblog.newPost( '', '{someone}', '{password}', oPost, 1)
        pass
    else:
        #
        # Edit existing post
        #
        oDrupal.metaWeblog.editPost( oExistingPosts[strTitle], '{someone}', '{password}', oPost, 1)
        pass


except:
    oString = StringIO.StringIO()
    traceback.print_exc( file=oString)
    strMsg += oString.getvalue()

#
# Forward email to me.
#
print strMsg

The following procmail recipe invokes the above script:

:0:
* Subject:.*Post This
| /home/{account}/MailBot.py

where:

Post This
magic subject to get message posted
{account}
linux account name

The script must be chmod 700.


Filed under: drupal email linux php python


Been playing with Gmail some more, looking at it's features.

Labels
Instead of putting email in folders you assign it labels. You can then click on the label name to get a list of all emails that have that label. This is functionally the same as having folders. One advantage is that more than one label can be assigned to an email so it can be categorised in different ways. I don't see any way to AND labels together, i.e list emails with label1 AND label2. I tried using the search box but that did not work. I would say this would be a useful geeky feature. The labels then approach the power of the taxonomy system in Drupal (although in a single vocabulary with no hierarchy: hey I sound like a computer scientist!!).
Filters
Easily used to apply labels to new email.
Archive
I had ignored this before but I think the intention is that instead of leaving everything in the 'Inbox', once you have read your mail you press the Archive button to put it in an archive. This leaves the Inbox uncluttered. You can get at your archive by searching, clicking on labels, etc.
Spam
Automatically filtered, and generally very well. Spam messages to not appear in the 'All Mail' list or search results. There is no way of knowing new spam is there except by looking in the folder (folders, not labels, mixed paradigms).

Conclusion: I love Gmail, it follows googles fast, simple and powerful approach.


Filed under: drupal email gmail


I've spent a good few hours trying to set up my email on my new Site5 account. I wanted to set it up as follows:

  • Mails to my various target addresses (personal, public and wife) all arrive in a single account in different folders. This way I only have to poll a single account. This account is also my backup email archive.
  • All mail (except maybe spam checked mail) is forwarded to gmail to use as my email client. Site5 gives access to three web based email packages (Squirrelmail, Neomail, Horde) but they are not as good as gmail.

This is how my work email is set up and also how my former home email was set up. Both use procmail to do filtering and forwarding and are working sweetly.

So how to do this in the more restricted world of Site5?

On the Site5 site this is the main clue on how to set things up. This describes a technique of editing a file called /etc/valiases/ to get the email system to forward emails to procmail. procmail is then used to filter mails to the appropriate target folders, run spamassassin etc.

I tried using the prescribed setup and encountered two problems:

  • forwarding to gmail from the procmailrc did not work. According to the procmail log it did try to use sendmail to send the message but the messages never arrived.
  • I ended up with two copies of each mail, one that had been through procmail and another that did not (it had no spamassassin headers).

I did a google on cpanels (which is a relative of netadmin, which Site5 use) emailing forwarding facility and worked out that it is not necessary to edit valiases directly, the file can be edited via the netadmin email forwarding section. For each of my required email addresses I added two forwarding entries:

  1. A forward to my gmail account
  2. A forward to procmail (e.g. "|/usr/bin/procmail /home//.procmailrc")

The .procmailrc is set up in a conventional enough way, e.g:

## basic .procmailrc
SHELL=/bin/sh
LOGFILE=/home/blah/procmail_log   ##replace with your actual domain!
VERBOSE=yes    ## you can set this to YES for debugging
MAILDIR=/home/blah/mail/blah.com
DEFAULT=messages/inbox

# isn't bigger than a few k and working with big messages can bring
# SpamAssassin to its knees.
#
# The lock file ensures that only 1 spamassassin invocation happens
# at 1 time, to keep the load down.
#
:0fw: spamassassin.lock
* < 100000
| spamassassin

# Mails with a score of 15 or higher are almost certainly spam (with 0.05%
# false positives according to rules/STATISTICS.txt). Let's put them in a
# different mbox. (This one is optional.)
:0:
* ^X-Spam-Level: \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
messages/spamdefinitely

# All mail tagged as spam (eg. with a score higher than the set threshold)
# is moved to "probably-spam".
:0:
* ^X-Spam-Status: Yes
messages/spampossibly

#
# Sort into recipients
#
:0
* ^TO_someone@blah.com
messages/someone

:0
* ^TO_someoneelse@blah.com
messages/someoneelse

:0
DEFAULT

All emails go into an account called 'messages' which has folders for each recipient and also folders for messages that might be spam or are definitely spam.

This setup seems to be working. I was getting two copies of my emails before because I had set up email accounts with the same names as I was forwarding to procmail. If the Site5 email system receives a message to fred@somedomain.com it will look for email accounts called fred@somedomain.com and deliver the message there if it exists. It will then look for an email forwarding link for fred@somedomain.com and will forward it if that exists. I was getting two copies of email because the email account existed and got email delivered directly and also because my procmailrc was delivering another copy. After I deleted the extra email accounts I stopped getting duplicate copies. Everything arrives via procmail.

I'm not sure why procmail could not forward email to gmail but I suspect the Site5 account may be set up to restrict sending of emails to stop spammers using Site5 hosting.

I don't think it is necessary to have shell access to Site5 to do this. Editing the valiases file apparently would require shell access but that is not necessary if you use netadmin (aka cpanel) to set up the forwarding. The .procmailrc file can just be uploaded using ftp. I did ask Site5 for shell access and got it within an hour. So far I am very pleased with Site5: fast servers and fast support.



Google know how to make me happy. They've given me 6 gmail invites. I'll be giving them to friends/family. I won't sell them on ebay, not even to recoup my £1.30 investment.

I got a spam message today so I marked it as such and looked in the spam folder to find there were already 3 spams in there: there was no other indication that they were there. They were legitimate spams though, asking me if I wanted to advertise my web site to 28 million people by sending spam. Does the 28 million people include the ones with spam filters? If so I'd want a discount.

The gmail invite scheme is a great ploy. Slow adoption of the new system, spreading in a way that makes people feel privileged, starting with techy types who can invite and help their non-techy friends.

Update:

  • I gave myself a gmail invite to use for work and managed to grab the coveted address that has my own name (guess what it is, cursed spambot). My name is not uncommon (I appear on the third page of a google search which finds my Firl entry) so this is a win.

  • I've given one other invite away and yet I still have 6 invites.

  • I logged into my new account and that has 6 invites.

  • I think the spam I received is spam I forwarded to myself from my home server.

So are google going crazy with invites today, is it a weird cookie bug, or am I just lucky?

Update^2:

  • It was a cookie bug. I had two different accounts open in two firefox tabs and the first account got transformed into the second account. The new account did have 6 invites already. It seems you can only look at one account at a time Unsmiley


Filed under: email firefox gmail google