Index: branches/5.1.x/core/install/upgrades.sql
===================================================================
diff -u -r13614 -r13635
--- branches/5.1.x/core/install/upgrades.sql	(.../upgrades.sql)	(revision 13614)
+++ branches/5.1.x/core/install/upgrades.sql	(.../upgrades.sql)	(revision 13635)
@@ -1870,3 +1870,25 @@
 DELETE FROM ConfigurationValues WHERE VariableName = 'Config_Server_Time';
 UPDATE ConfigurationValues SET ValueList = NULL, DisplayOrder = 20.02 WHERE VariableName = 'Config_Site_Time';
 UPDATE ConfigurationValues SET VariableValue = '' WHERE VariableName = 'Config_Site_Time' AND VariableValue = 14;
+
+ALTER TABLE Events
+	ADD AllowChangingSender TINYINT NOT NULL DEFAULT '0' AFTER ReplacementTags ,
+	ADD CustomSender TINYINT NOT NULL DEFAULT '0' AFTER AllowChangingSender ,
+	ADD SenderName VARCHAR(255) NOT NULL DEFAULT '' AFTER CustomSender ,
+	ADD SenderAddressType TINYINT NOT NULL DEFAULT '0' AFTER SenderName ,
+	ADD SenderAddress VARCHAR(255) NOT NULL DEFAULT '' AFTER SenderAddressType ,
+	ADD AllowChangingRecipient TINYINT NOT NULL DEFAULT '0' AFTER SenderAddress ,
+	ADD CustomRecipient TINYINT NOT NULL DEFAULT '0' AFTER AllowChangingRecipient ,
+	ADD Recipients TEXT AFTER CustomRecipient,
+	ADD INDEX (AllowChangingSender),
+	ADD INDEX (CustomSender),
+	ADD INDEX (SenderAddressType),
+	ADD INDEX (AllowChangingRecipient),
+	ADD INDEX (CustomRecipient);
+
+UPDATE Events SET AllowChangingSender = 1, AllowChangingRecipient = 1;
+UPDATE Events SET Module = 'Core' WHERE Module LIKE 'Core:%';
+
+DELETE FROM Permissions WHERE Permission LIKE 'in-portal:configuration_email%';
+DELETE FROM Permissions WHERE Permission LIKE 'in-portal:user_email%';
+DELETE FROM Phrase WHERE Phrase IN ('la_fld_FromToUser', 'la_col_FromToUser');
