diff --git a/mailsystem.install b/mailsystem.install
index ef966f7..014f6fa 100644
--- a/mailsystem.install
+++ b/mailsystem.install
@@ -8,15 +8,31 @@
  */
 
 /**
+ * Ensure that mailsystem has a higher module weight than any other module
+ * implementing hook_mail_alter().
+ */
+function mailsystem_set_module_weight() {
+  $modules = array_diff(module_implements('mail_alter'), array('mailsystem'));
+  $query = db_query("SELECT MAX(weight) FROM {system} WHERE name IN ('" . implode("', '", $modules) . "') AND type = 'module'");
+  $max = db_result($query);
+  $max = $max + 1;
+  $query = db_query("UPDATE {system} SET weight = $max WHERE name = 'mailsystem' AND type = 'module'");
+}
+
+
+/**
  * Implements hook_requirements().
  * Ensures that the newly-required autoload module is available, or else
  * disables the mailsystem module and returns an informative error message.
  */
 function mailsystem_requirements($phase) {
-  if ($phase === 'install' || module_exists('autoload')) {
+  if ($phase === 'install') {
+    return array();
+  }
+  mailsystem_set_module_weight();
+  if (module_exists('autoload')) {
     return array();
   }
-  $t = get_t();
   $args = array(
     '!autoload' => url('http://drupal.org/project/autoload'),
     '%autoload' => 'Autoload',
@@ -29,15 +45,15 @@ function mailsystem_requirements($phase) {
     autoload_boot();
     autoload_registry_rebuild();
     drupal_set_message(
-      $t('The %autoload module has been enabled because the %mailsystem module now requires it.', $args)
+      t('The %autoload module has been enabled because the %mailsystem module now requires it.', $args)
     );
     return array();
   }
   return array(
     'mailsystem_autoload' => array(
-      'title' => $t('%autoload module', $args),
-      'value' => $t('Not installed'),
-      'description' => $t(
+      'title' => t('%autoload module', $args),
+      'value' => t('Not installed'),
+      'description' => t(
         'The <a href="!mailsystem">%mailsystem</a> module dependencies have changed.  Please download and install the required <a href="!autoload">%autoload</a> module, then re-enable the <a href="!mailsystem">%mailsystem</a> module.', $args
       ),
       'severity' => REQUIREMENT_ERROR,
@@ -50,7 +66,7 @@ function mailsystem_requirements($phase) {
  *
  * @see mailsystem_requirements()
  */
-function mailsystem_update_6200() {
+function mailsystem_update_6201() {
   if ($requirements = mailsystem_requirements('runtime')) {
     return array(
       '#abort' => array(
diff --git a/mailsystem.module b/mailsystem.module
index 41486cc..82f9a83 100644
--- a/mailsystem.module
+++ b/mailsystem.module
@@ -329,6 +329,11 @@ function mailsystem_parse_id(array &$message) {
  * Creates an instance of the MailSystemInterface class appropriate to the
  * $message['id'] and invokes its format() method on the message array.
  *
+ * This must run after all other hook_mail_alter() functions, in order to remain
+ * consistent with the 7.x version behavior.
+ *
+ * @see mailsystem_set_module_weight()
+ *
  * @param &$message
  *   The message array to be altered.
  */
