Attached is a patch that changes packet-newmail.c to always register
itself on the port from the preferences (defaults to 0) upon launch.
This allows the user to right-click and use decode as. Currently, the
dissector only registers itself when the default port number changes
from 0 or by packet-dcerpc-mapi.c when a MAPI register push notification
packet is seen.
Thanks,
Steve
Index: epan/dissectors/packet-newmail.c
===================================================================
--- epan/dissectors/packet-newmail.c (revision 19398)
+++ epan/dissectors/packet-newmail.c (working copy)
@@ -46,8 +46,8 @@
void proto_reg_handoff_newmail(void);
/* Variables for preferences */
-guint preference_default_port = 0;
-guint preference_default_port_last = 0;
+guint preference_default_port;
+guint preference_default_port_last;
/* Initialize the protocol and registered fields */
static int proto_newmail = -1;
@@ -128,9 +128,17 @@
void
proto_reg_handoff_newmail(void)
{
+ static gboolean inited = FALSE;
+
dissector_handle_t newmail_handle;
newmail_handle = find_dissector("newmail");
+
+ if(!inited) {
+ dissector_add("udp.port", preference_default_port, newmail_handle);
+ preference_default_port_last = preference_default_port;
+ inited = TRUE;
+ }
if(preference_default_port != preference_default_port_last) {
/* Unregister the last setting */