diff --git a/install/lib/installer_base.lib.php b/install/lib/installer_base.lib.php
index 6b72bbf834162cf52f12f1ef181e3219f6c96404..98ebc604461415c20277d0018f0f8cd70d8f2702 100644
--- a/install/lib/installer_base.lib.php
+++ b/install/lib/installer_base.lib.php
@@ -1070,6 +1070,7 @@ class installer_base extends stdClass {
 
 			# reduce 3 or more newlines to 2
 			$content = rf($conf['postfix']['config_dir'].'/master.cf');
+			$content = preg_replace( '/^# Data returning from Amavis .*$/m', '', $content );  # Cleanup comment we generated
 			$content = preg_replace( '/(\r?\n){3,}/', '$1$1', $content );
 			wf( $conf['postfix']['config_dir'].'/master.cf', $content );