Index: mail/em-composer-prefs.c
===================================================================
--- mail/em-composer-prefs.c	(revision 35459)
+++ mail/em-composer-prefs.c	(working copy)
@@ -167,8 +167,11 @@ sig_load_preview (EMComposerPrefs *prefs
 	else
 		str = e_msg_composer_get_sig_file_content (
 			signature->filename, signature->html);
-	if (!str)
-		str = g_strdup ("");
+	if (!str || !*str) {
+		/* make html stream happy and write at least one character */
+		g_free (str);
+		str = g_strdup (" ");
+	}
 
 	if (signature->html) {
 		gtk_html_load_from_string (html, str, strlen (str));
@@ -1044,7 +1047,7 @@ em_composer_prefs_construct (EMComposerP
 	prefs->sig_add = GTK_BUTTON (widget);
 
 	widget = glade_xml_get_widget (gui, "cmdSignatureAddScript");
-	gtk_widget_set_sensitive (widget, sensitive);
+	gtk_widget_set_sensitive (widget, sensitive && !mail_config_scripts_disabled ());
 	g_signal_connect (
 		widget, "clicked",
 		G_CALLBACK (sig_add_script_cb), prefs);
Index: mail/ChangeLog
===================================================================
--- mail/ChangeLog	(revision 35459)
+++ mail/ChangeLog	(working copy)
@@ -1,3 +1,18 @@
+2008-04-30  Milan Crha  <mcrha@redhat.com>
+
+	** Fix for bug #322553
+
+	* mail-config.h: (mail_config_scripts_disabled):
+	* mail-config.c: (struct MailConfig), (mail_config_init),
+	(mail_config_scripts_disabled): New helper function.
+	* em-composer-prefs.c: (sig_load_preview):
+	Write to html stream at least one character.
+	* em-composer-prefs.c: (em_composer_prefs_construct): Disable
+	signature's Add Script button when not approved running scripts.
+	* mail-config.c: (mail_config_get_gconf_client): Ensure init.
+	* mail-config.c: (mail_config_signature_run_script): Do not run
+	script when disabled in /desktop/gnome/lockdown/disable_command_line.
+
 2008-04-30  Milan Crha  <mcrha@redhat.com>
 
 	** Fix for bug #528288
Index: mail/mail-config.c
===================================================================
--- mail/mail-config.c	(revision 35459)
+++ mail/mail-config.c	(working copy)
@@ -103,6 +103,7 @@ typedef struct {
 	gboolean jh_check;
 	gboolean book_lookup;
 	gboolean book_lookup_local_only;
+	gboolean scripts_disabled;
 } MailConfig;
 
 static MailConfig *config = NULL;
@@ -507,6 +508,14 @@ mail_config_init (void)
 	config->book_lookup_local_only =
 		gconf_client_get_bool (config->gconf, key, NULL);
 
+	key = "/desktop/gnome/lockdown/disable_command_line";
+	func = (GConfClientNotifyFunc) gconf_bool_value_changed;
+	gconf_client_notify_add (
+		config->gconf, key, func,
+		&config->scripts_disabled, NULL, NULL);
+	config->scripts_disabled =
+		gconf_client_get_bool (config->gconf, key, NULL);
+
 	gconf_jh_check_changed (config->gconf, 0, NULL, config);
 }
 
@@ -616,6 +625,9 @@ mail_config_write_on_exit (void)
 GConfClient *
 mail_config_get_gconf_client (void)
 {
+	if (!config)
+		mail_config_init ();
+
 	return config->gconf;
 }
 
@@ -1186,6 +1198,15 @@ mail_config_get_lookup_book_local_only (
 	return config->book_lookup_local_only;
 }
 
+gboolean
+mail_config_scripts_disabled (void)
+{
+	if (config == NULL)
+		mail_config_init ();
+
+	return config->scripts_disabled;
+}
+
 char *
 mail_config_signature_run_script (const char *script)
 {
@@ -1194,6 +1215,9 @@ mail_config_signature_run_script (const 
 	int in_fds[2];
 	pid_t pid;
 
+	if (mail_config_scripts_disabled ())
+		return NULL;
+
 	if (pipe (in_fds) == -1) {
 		g_warning ("Failed to create pipe to '%s': %s", script, g_strerror (errno));
 		return NULL;
Index: mail/mail-config.h
===================================================================
--- mail/mail-config.h	(revision 35459)
+++ mail/mail-config.h	(working copy)
@@ -158,6 +158,8 @@ void mail_config_reload_junk_headers (vo
 gboolean mail_config_get_lookup_book (void);
 gboolean mail_config_get_lookup_book_local_only (void);
 
+gboolean mail_config_scripts_disabled (void);
+
 GType evolution_mail_config_get_type (void);
 
 gboolean evolution_mail_config_factory_init (void);
