diff -urNp privatemsg/privatemsg.info privatemsgnew/privatemsg.info
--- privatemsg/privatemsg.info	1969-12-31 16:00:00.000000000 -0800
+++ privatemsgnew/privatemsg.info	2006-11-28 15:39:54.000000000 -0800
@@ -0,0 +1,2 @@
+name = Privatemsg
+description = Allows private messages between users
\ No newline at end of file
diff -urNp privatemsg/privatemsg.install privatemsgnew/privatemsg.install
--- privatemsg/privatemsg.install	2006-08-11 10:58:33.000000000 -0700
+++ privatemsgnew/privatemsg.install	2006-11-28 15:39:58.000000000 -0800
@@ -114,6 +114,18 @@ function privatemsg_install() {
   }
 }
 
+function privatemsg_uninstall() {
+  db_query("DROP TABLE {privatemsg}");
+  db_query("DROP TABLE {privatemsg_folder}");
+  db_query("DROP TABLE {privatemsg_archive}");
+// If you can't use a wildcard with variable_del(), how do you delete all the possible variables (i.e. for multiple node types)?
+// You can cycle through the existing node types, but that doesn't account for modules that are disabled.
+//  foreach ($node_types as $type) {
+//    variable_del('privatemsg_link_$type');
+//  }
+}
+
+
 /* Upgrade on mysql from versions before 22-May-2003:
    Create privatemsg_archive/privatemsg_folder tables and insert one row, shown above^
    ALTER TABLE privatemsg ADD folder int(10) unsigned NOT NULL;
diff -urNp privatemsg/privatemsg.module privatemsgnew/privatemsg.module
--- privatemsg/privatemsg.module	2006-10-23 16:33:55.000000000 -0700
+++ privatemsgnew/privatemsg.module	2006-11-28 15:39:49.000000000 -0800
@@ -16,8 +16,6 @@ function privatemsg_help($section) {
 ', array('%admin-settings-privatemsg' => url('admin/settings/privatemsg'), '%privatemsg' => url('privatemsg'))) .'</ul>';
       $output .= '<p>'. t('For more information please read the configuration and customization handbook <a href="%privatemsg">Privatemsg page</a>.', array('%privatemsg' => 'http://www.drupal.org/handbook/modules/privatemsg/')) .'</p>';
       return $output;
-    case 'admin/modules#description':
-      return t('Allows private messages between users.');
   }
 }
 
@@ -33,7 +31,7 @@ function privatemsg_link($type, $node = 
       $access[$node->uid] = user_access('access private messages', $author) && $author->uid && (isset($author->privatemsg_allow) ? $author->privatemsg_allow : 1);
     }
     if ($access[$node->uid]) {
-      return array(l(t('write to author'), "privatemsg/msgto/$node->uid"));
+      $links['privatemsg_links'] = array('title' => t('Write to author'), 'href' => "privatemsg/msgto/$node->uid", 'attributes' => array('title' => t('write to author')));
     }
   }
 }
@@ -42,27 +40,25 @@ function privatemsg_link($type, $node = 
  * Implementation of hook_menu().
  */
 function privatemsg_menu($may_cache) {
-  $items = array();
   global $user;
-
-  if ($may_cache) {
-    $items[] = array('path' => 'admin/settings/privatemsg',
-        'title' => 'privatemsg',
-        'callback' => 'privatemsg_configure');
-  }
-  else {
-    $new = (int)_privatemsg_get_new_messages();
-    $items[] = array('path' => 'privatemsg',
-                     'title' => t('my inbox') . ($new ? ' ('. $new .')' : ''),
-                     'callback' => 'privatemsg_page',
-                     'access' => user_access('access private messages'),
-                     'type' => $user->uid && (isset($user->privatemsg_allow) ? $user->privatemsg_allow : 1) ? MENU_DYNAMIC_ITEM : MENU_CALLBACK);
-
-    if ($new && (isset($user->privatemsg_setmessage_notify) ? $user->privatemsg_setmessage_notify : 1)) {
-      $m = drupal_set_message();
-      if (empty($m)) {
-        drupal_set_message(strtr(format_plural($new, 'You have one new <a href="%url">private message</a>', 'You have %count new <a href="%url">private messages</a>'), array('%url' => url('privatemsg'))));
-      }
+  $items = array();
+  $items[] = array(
+    'path' => 'admin/settings/privatemsg',
+    'title' => t('Privatemsg settings'),
+    'description' => t('Configure Privatemsg settings.'),
+    'callback' => 'drupal_get_form',
+    'callback arguments' => array('privatemsg_configure'));
+  $new = (int)_privatemsg_get_new_messages();
+  $items[] = array('path' => 'privatemsg',
+                   'title' => t('My Inbox') . ($new ? ' ('. $new .')' : ''),
+                   'callback' => 'privatemsg_page',
+                   'access' => user_access('access private messages'),
+                   'type' => $user->uid && (isset($user->privatemsg_allow) ? $user->privatemsg_allow : 1) ? MENU_DYNAMIC_ITEM : MENU_CALLBACK);
+
+  if ($new && (isset($user->privatemsg_setmessage_notify) ? $user->privatemsg_setmessage_notify : 1)) {
+    $m = drupal_set_message();
+    if (empty($m)) {
+      drupal_set_message(strtr(format_plural($new, 'You have one new <a href="%url">private message</a>', 'You have @count new <a href="%url">private messages</a>'), array('%url' => url('privatemsg'))));
     }
   }
   return $items;
@@ -174,7 +170,7 @@ function privatemsg_configure() {
       '#description' => t('Provide a link to send private messages to users with their comments.')
       );
 
-  return system_settings_form('privatemsg_settings', $form);
+  return system_settings_form($form);
 }
 
 /**
@@ -240,7 +236,7 @@ To read your messages, follow this link:
 If you don\'t want to receive these email again, change your preferences here:
 %link2', array('%name' => $user->name, '%site' => variable_get('site_name', 'drupal'), '%new' => $alert->c, '%link1' => url('user/login', 'destination=privatemsg', NULL, 1), '%link2' => url('user/'. $user->uid .'/edit', NULL, NULL, 1)));
 
-      user_mail($user->mail, $subject, $message, "From: $from\nReply-to: $from\nX-Mailer: Drupal\nReturn-path: $from\nErrors-to: $from");
+      user_mail('privatemsg-mailalert', $user->mail, $subject, $from, "X-Mailer: Drupal\n");
 
       // revert to previous (site default) locale
       $locale = $initial_locale;
@@ -252,6 +248,8 @@ function privatemsg_page() {
   global $user;
 
   $breadcrumb = NULL;
+  //  This is preferred per http://drupal.org/node/64279#post_op, but I don't know where $form_values should be coming from so I stuck with $_POST['op']...
+  //  $op = $form_values['op'];
   $op = $_POST["op"];
   $edit = $_POST["edit"];
   $recipient = $_POST["recipient"];
@@ -299,9 +297,10 @@ function privatemsg_page() {
       break;
     case 'send':
     case t('Send private message'):
-      if (!$edit["recipient"]) {
-        $edit["recipient"] = $recipient;
-      }
+        $edit['recipient'] = $_POST['recipient'];
+        $edit['subject'] = $_POST['subject'];
+        $edit['privatemsgbody'] = $_POST['privatemsgbody'];
+        $edit['format'] = $_POST['format'];
       $breadcrumb = array(l(t('Home'), ''), l(t('private messages'), 'privatemsg'));
       $output = _privatemsg_edit($edit);
       break;
@@ -426,6 +425,12 @@ function _privatemsg_format_folder($curr
 }
 
 function _privatemsg_form($message = 0) {
+  $output = drupal_get_form('_privatemsg_form_form', $message);
+  return $output;
+}
+
+function _privatemsg_form_form($message) {
+  
   global $user;
   $form = array();
 
@@ -486,7 +491,7 @@ function _privatemsg_form($message = 0) 
       '#name' => 'op'
       );
 
-  return drupal_get_form('privatemsg_message_form', $form);
+  return $form;
 }
 
 function _privatemsg_edit($edit) {
@@ -623,17 +628,17 @@ function theme_privatemsg_view($message)
     if ($message->recipient == $user->uid) {
       $author = user_load(array('uid' => $message->uid));
       if ($author->uid && (isset($author->privatemsg_allow) ? $author->privatemsg_allow : 1)) {
-        $links[] = l(t('Reply to this message'), "privatemsg/reply/$message->id");
+        $links['privatemsg-reply'] = array('title' => t('Reply to this message'), 'href' => "privatemsg/reply/$message->id");
       }
       else {
-        $links[] = t('Sender does not accept replies');
+        $links['privatemsg-noreply'] = array('title' => t('Sender does not accept replies'), 'href' => NULL);
       }
     }
     if (($message->recipient == $user->uid) || (variable_get("privatemsg_sent_status", 1))) {
-      $links[] = l(t('Delete this message'), "privatemsg/delete/$message->id", array('onClick' => "return confirm('".t('Are you sure to delete this message?')."')"));
+      $links['privatemsg-delete'] = array('title' => t('Delete this message'), 'href' => "privatemsg/delete/$message->id", 'attributes' => array('onClick' => "return confirm('".t('Are you sure to delete this message?')."')"));
     }
 
-    $links[] = l(t('List messages'), 'privatemsg');
+    $links['privatemsg-list'] = array('title' => t('List messages'), 'href' => 'privatemsg');
     $body .= '<div class="links">'. theme('links', $links) .'</div>';
   } 
   else {
@@ -652,8 +657,6 @@ function theme_privatemsg_view($message)
  @param folders
 **/
 function theme_privatemsg_list($current_folder, $messages, $folders) {
-  $form = array();
-
   $extra_folders = array();
   foreach ($folders as $folder) {
     $folder_list[] = _privatemsg_format_folder($current_folder, $folder[0], $folder[1]);
@@ -663,6 +666,12 @@ function theme_privatemsg_list($current_
   }
   $out = theme('links', $folder_list);
 
+  return $out . drupal_get_form('privatemsg_list_form', $current_folder, $messages, $folders);
+}
+
+function privatemsg_list_form($current_folder, $messages, $folders) {
+  $form = array();
+
   $form['messages'] = array(
       '#theme' => 'privatemsg_message_table',
       '#tree' => TRUE
@@ -683,7 +692,6 @@ function theme_privatemsg_list($current_
         $new = 0;
       }
     }
-
     $form['messages'][$message->id] = array();
     $form['messages'][$message->id]['selected'] = array(
         '#type' => 'checkbox',
@@ -763,7 +771,7 @@ function theme_privatemsg_list($current_
       '#name' => 'op'
       );
 
-  return $out . drupal_get_form('privatemsg_list_form', $form);
+  return $form;
 }
 
 function theme_privatemsg_message_table($form) {
@@ -772,7 +780,7 @@ function theme_privatemsg_message_table(
   foreach (element_children($form) as $key) {
     if ($key != 'current_folder') {
       $row = array();
-      $row[] = form_render($form[$key]['selected']);
+      $row[] = drupal_render($form[$key]['selected']);
       $row[] = $form[$key]['date']['#value'];
       $row[] = $form[$key]['user']['#value'];
       $row[] = $form[$key]['subject']['#value'];
@@ -793,7 +801,3 @@ function theme_privatemsg_message_table(
 
   return theme('table', $header, $rows);
 }
-
-/**  @} End of addtogroup theme_system **/
-
-?>
