Kaynağa Gözat

+ Mail queue is now always enabled...

Signed-off-by: Michael Eshom <[email protected]>
Michael Eshom 10 yıl önce
ebeveyn
işleme
19864248f2

+ 0 - 1
Sources/ManageMail.php

@@ -298,7 +298,6 @@ function ModifyMailSettings($return_config = false)
 
 	$config_vars = array(
 			// Mail queue stuff, this rocks ;)
-			array('check', 'mail_queue'),
 			array('int', 'mail_limit'),
 			array('int', 'mail_quantity'),
 		'',

+ 1 - 1
Sources/ManageNews.php

@@ -699,7 +699,7 @@ function SendMailing($clean_only = false)
 
 	// How many to send at once? Quantity depends on whether we are queueing or not.
 	// @todo Might need an interface? (used in Post.php too with different limits)
-	$num_at_once = empty($modSettings['mail_queue']) ? 60 : 1000;
+	$num_at_once = 1000;
 
 	// If by PM's I suggest we half the above number.
 	if (!empty($_POST['send_pm']))

+ 1 - 1
Sources/Post.php

@@ -2242,7 +2242,7 @@ function AnnouncementSend()
 			'start' => $context['start'],
 			'additional_group_list' => implode(', mem.additional_groups) != 0 OR FIND_IN_SET(', $_POST['who']),
 			// @todo Might need an interface?
-			'chunk_size' => empty($modSettings['mail_queue']) ? 50 : 500,
+			'chunk_size' => 500,
 		)
 	);
 

+ 2 - 2
Sources/Subs-Post.php

@@ -641,11 +641,11 @@ function sendmail($to, $subject, $message, $from = null, $message_id = null, $se
 	}
 
 	// Are we using the mail queue, if so this is where we butt in...
-	if (!empty($modSettings['mail_queue']) && $priority != 0)
+	if ($priority != 0)
 		return AddMailQueue(false, $to_array, $subject, $message, $headers, $send_html, $priority, $is_private);
 
 	// If it's a priority mail, send it now - note though that this should NOT be used for sending many at once.
-	elseif (!empty($modSettings['mail_queue']) && !empty($modSettings['mail_limit']))
+	elseif (!empty($modSettings['mail_limit']))
 	{
 		list ($last_mail_time, $mails_this_minute) = @explode('|', $modSettings['mail_recent']);
 		if (empty($mails_this_minute) || time() > $last_mail_time + 60)

+ 0 - 1
Themes/default/languages/ManageMail.english.php

@@ -10,7 +10,6 @@ $txt['smtp_port'] = 'SMTP port';
 $txt['smtp_username'] = 'SMTP username';
 $txt['smtp_password'] = 'SMTP password';
 
-$txt['mail_queue'] = 'Enable mail queue';
 $txt['mail_limit'] = 'Maximum emails to send per minute';
 $txt['mail_limit_desc'] = '(Set to 0 to disable)';
 $txt['mail_quantity'] = 'Maximum amount of emails to send per page load';

+ 3 - 1
other/install_2-1_mysql.sql

@@ -1892,7 +1892,9 @@ VALUES ('smfVersion', '{$smf_version}'),
 	('drafts_autosave_enabled', '1'),
 	('drafts_show_saved_enabled', '1'),
 	('drafts_keep_days', '7'),
-	('topic_move_any', '0');
+	('topic_move_any', '0'),
+	('mail_limit', '5'),
+	('mail_quantity', '5');
 # --------------------------------------------------------
 
 #

+ 2 - 0
other/install_2-1_postgresql.sql

@@ -2404,6 +2404,8 @@ INSERT INTO {$db_prefix}settings (variable, value) VALUES ('drafts_autosave_enab
 INSERT INTO {$db_prefix}settings (variable, value) VALUES ('drafts_show_saved_enabled', '1');
 INSERT INTO {$db_prefix}settings (variable, value) VALUES ('drafts_keep_days', '7');
 INSERT INTO {$db_prefix}settings (variable, value) VALUES ('topic_move_any', '0');
+INSERT INTO {$db_prefix}settings (variable, value) VALUES ('mail_limit', '5');
+INSERT INTO {$db_prefix}settings (variable, value) VALUES ('mail_quantity', '5');
 # --------------------------------------------------------
 
 #

+ 2 - 0
other/install_2-1_sqlite.sql

@@ -2039,6 +2039,8 @@ INSERT INTO {$db_prefix}settings (variable, value) VALUES ('drafts_autosave_enab
 INSERT INTO {$db_prefix}settings (variable, value) VALUES ('drafts_show_saved_enabled', '1');
 INSERT INTO {$db_prefix}settings (variable, value) VALUES ('drafts_keep_days', '7');
 INSERT INTO {$db_prefix}settings (variable, value) VALUES ('topic_move_any', '0');
+INSERT INTO {$db_prefix}settings (variable, value) VALUES ('mail_limit', '5');
+INSERT INTO {$db_prefix}settings (variable, value) VALUES ('mail_quantity', '5');
 COMMIT;
 
 # --------------------------------------------------------

+ 2 - 0
other/install_2-1_sqlite3.sql

@@ -2039,6 +2039,8 @@ INSERT INTO {$db_prefix}settings (variable, value) VALUES ('drafts_autosave_enab
 INSERT INTO {$db_prefix}settings (variable, value) VALUES ('drafts_show_saved_enabled', '1');
 INSERT INTO {$db_prefix}settings (variable, value) VALUES ('drafts_keep_days', '7');
 INSERT INTO {$db_prefix}settings (variable, value) VALUES ('topic_move_any', '0');
+INSERT INTO {$db_prefix}settings (variable, value) VALUES ('mail_limit', '5');
+INSERT INTO {$db_prefix}settings (variable, value) VALUES ('mail_quantity', '5');
 COMMIT;
 
 # --------------------------------------------------------

+ 13 - 0
other/upgrade_2-1_mysql.sql

@@ -891,4 +891,17 @@ ADD COLUMN modified_reason varchar(255) NOT NULL;
 		)
 	);
 ---}
+---#
+
+/******************************************************************************/
+--- Adding mail queue settings
+/******************************************************************************/
+---#
+---{
+	if (empty($modSettings['mail_limit']))
+	{
+		$data = array("('mail_limit', '5')", "('mail_quantity', '5')");
+		$smcFunc['db_insert']('', '{db_prefix}settings' array('variable' => 'string-255', 'value' => 'string'), array('mail_limit', '5'), $data, array());
+	}
+---}
 ---#

+ 13 - 0
other/upgrade_2-1_postgresql.sql

@@ -991,4 +991,17 @@ ADD COLUMN modified_reason varchar(255) NOT NULL default '';
 		)
 	);
 ---}
+---#
+
+/******************************************************************************/
+--- Adding mail queue settings
+/******************************************************************************/
+---#
+---{
+	if (empty($modSettings['mail_limit']))
+	{
+		$data = array("('mail_limit', '5')", "('mail_quantity', '5')");
+		$smcFunc['db_insert']('', '{db_prefix}settings' array('variable' => 'string-255', 'value' => 'string'), array('mail_limit', '5'), $data, array());
+	}
+---}
 ---#

+ 13 - 0
other/upgrade_2-1_sqlite.sql

@@ -967,4 +967,17 @@ ADD COLUMN modified_reason varchar(255) NOT NULL default '';
 		)
 	);
 ---}
+---#
+
+/******************************************************************************/
+--- Adding mail queue settings
+/******************************************************************************/
+---#
+---{
+	if (empty($modSettings['mail_limit']))
+	{
+		$data = array("('mail_limit', '5')", "('mail_quantity', '5')");
+		$smcFunc['db_insert']('', '{db_prefix}settings' array('variable' => 'string-255', 'value' => 'string'), array('mail_limit', '5'), $data, array());
+	}
+---}
 ---#