Index: src/orca/scripts/apps/Thunderbird/script.py
===================================================================
--- src/orca/scripts/apps/Thunderbird/script.py	(revision 4001)
+++ src/orca/scripts/apps/Thunderbird/script.py	(working copy)
@@ -234,6 +234,23 @@
                 if string == "Delete":
                     oldLocusOfFocus = None
 
+        # If the user has just deleted an open mail message, then we want to
+        # try to speak the new name of the open mail message frame.
+        # See bug #540039 for more details.
+        #
+        rolesList = [pyatspi.ROLE_DOCUMENT_FRAME, \
+                     pyatspi.ROLE_INTERNAL_FRAME, \
+                     pyatspi.ROLE_FRAME, \
+                     pyatspi.ROLE_APPLICATION]
+        if self.isDesiredFocusedItem(event.source, rolesList):
+            if isinstance(orca_state.lastInputEvent, input_event.KeyboardEvent):
+                string = orca_state.lastNonModifierKeyEvent.event_string
+                if string == "Delete":
+                    oldLocusOfFocus = None
+                    state = newLocusOfFocus.getState()
+                    if state.contains(pyatspi.STATE_DEFUNCT):
+                        newLocusOfFocus = event.source
+
         # Pass the event onto the parent class to be handled in the default way.
 
         Gecko.Script.locusOfFocusChanged(self, event,
@@ -319,6 +336,21 @@
 
         obj = event.source
 
+        # If the user has just deleted an open mail message, then we want to
+        # try to speak the new name of the open mail message frame.
+        # See bug #540039 for more details.
+        #
+        rolesList = [pyatspi.ROLE_DOCUMENT_FRAME, \
+                     pyatspi.ROLE_INTERNAL_FRAME, \
+                     pyatspi.ROLE_FRAME, \
+                     pyatspi.ROLE_APPLICATION]
+        if self.isDesiredFocusedItem(event.source, rolesList):
+            if isinstance(orca_state.lastInputEvent, input_event.KeyboardEvent):
+                string = orca_state.lastNonModifierKeyEvent.event_string
+                if string == "Delete":
+                    speech.speak(obj.name)
+                    return
+
         # If we get a "object:property-change:accessible-name" event for 
         # the first item in the Suggestions lists for the spell checking
         # dialog, then speak the first two labels in that dialog. These
