[M-git] Mahogany sources repository. branch master updated. v0.67-806-ge3c352d7
Vadim Zeitlin via Mahogany-cvsupdates <[email protected]> Sat, 14 Nov 2020 16:26:09 +0000
| Newsgroups | gmane.mail.mahogany.cvs |
|---|---|
| Message-ID | <[email protected]> |
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Mahogany sources repository.".
The branch, master has been updated
via e3c352d7c60b383728918d290701d36ba0a45552 (commit)
from 9c06cb92836356044f8d69644cf2ff9a280ef473 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit e3c352d7c60b383728918d290701d36ba0a45552
Author: Vadim Zeitlin <[email protected]>
Date: Sat Nov 14 01:28:46 2020 +0100
Add option for addresses not to reply to automatically
This is useful in order not to include some special sender addresses in
the replies automatically.
diff --git a/CHANGES b/CHANGES
index adeb7f4d..de38e03a 100644
--- a/CHANGES
+++ b/CHANGES
@@ -9,6 +9,7 @@
Release 0.68 'Cynthia' September xx, 2010
-----------------------------------------
+2020-11-14 VZ: Add option for addresses not to reply to automatically.
2015-08-28 NB: Removed "Browser is Netscape" and "Open in new window" and
added "Open in another browser" instead
2015-03-11 VZ: Make it simpler to specify the attachment names in the message.
diff --git a/include/Moptions.h b/include/Moptions.h
index 1248f1ba..4b4b12a6 100644
--- a/include/Moptions.h
+++ b/include/Moptions.h
@@ -212,6 +212,7 @@ extern const MOption MP_COMPOSE_SHOW_FROM;
extern const MOption MP_DEFAULT_REPLY_KIND;
extern const MOption MP_LIST_ADDRESSES;
extern const MOption MP_EQUIV_ADDRESSES;
+extern const MOption MP_NEVER_SEND_TO_ADDRESSES;
extern const MOption MP_REPLY_PREFIX;
extern const MOption MP_FORWARD_PREFIX;
extern const MOption MP_REPLY_COLLAPSE_PREFIX;
@@ -836,6 +837,8 @@ extern const MOption MP_OPTION_ORIGIN_INHERITED;
#define MP_LIST_ADDRESSES_NAME "MLAddresses"
/// array of equivalent address pairs
#define MP_EQUIV_ADDRESSES_NAME "EquivAddresses"
+/// array of addresses to never send email to
+#define MP_NEVER_SEND_TO_ADDRESSES_NAME "NeverSendToAddresses"
/// prefix for subject in replies
#define MP_REPLY_PREFIX_NAME "ReplyPrefix"
/// prefix for subject in forwards
@@ -1697,6 +1700,8 @@ extern const MOption MP_OPTION_ORIGIN_INHERITED;
#define MP_LIST_ADDRESSES_DEFVAL ""
/// array of equivalent address pairs
#define MP_EQUIV_ADDRESSES_DEFVAL ""
+/// array of addresses to never send email to
+#define MP_NEVER_SEND_TO_ADDRESSES_DEFVAL ""
/// prefix for subject in replies
#define MP_REPLY_PREFIX_DEFVAL "Re: "
/// prefix for subject in forwards
diff --git a/src/classes/Moptions.cpp b/src/classes/Moptions.cpp
index 3e0d7250..4f9d73ed 100644
--- a/src/classes/Moptions.cpp
+++ b/src/classes/Moptions.cpp
@@ -272,6 +272,7 @@ const MOption MP_COMPOSE_BCC;
const MOption MP_COMPOSE_SHOW_FROM;
const MOption MP_LIST_ADDRESSES;
const MOption MP_EQUIV_ADDRESSES;
+const MOption MP_NEVER_SEND_TO_ADDRESSES;
const MOption MP_DEFAULT_REPLY_KIND;
const MOption MP_REPLY_PREFIX;
const MOption MP_FORWARD_PREFIX;
@@ -694,6 +695,7 @@ static const MOptionData MOptions[] =
DEFINE_OPTION(MP_COMPOSE_SHOW_FROM),
DEFINE_OPTION(MP_LIST_ADDRESSES),
DEFINE_OPTION(MP_EQUIV_ADDRESSES),
+ DEFINE_OPTION(MP_NEVER_SEND_TO_ADDRESSES),
DEFINE_OPTION(MP_DEFAULT_REPLY_KIND),
DEFINE_OPTION(MP_REPLY_PREFIX),
DEFINE_OPTION(MP_FORWARD_PREFIX),
diff --git a/src/gui/wxOptionsDlg.cpp b/src/gui/wxOptionsDlg.cpp
index abf2ad15..cf48ecc1 100644
--- a/src/gui/wxOptionsDlg.cpp
+++ b/src/gui/wxOptionsDlg.cpp
@@ -515,6 +515,8 @@ enum ConfigFields
ConfigField_AutoCollectOutgoing,
ConfigField_WhiteListHelp,
ConfigField_WhiteList,
+ ConfigField_NeverSendToAddressesHelp,
+ ConfigField_NeverSendToAddresses,
ConfigField_EquivAddressesHelp,
ConfigField_EquivAddresses,
#ifdef USE_BBDB
@@ -1774,6 +1776,13 @@ const wxOptionsPage::FieldInfo wxOptionsPageStandard::ms_aFields[] =
Field_Message, -1 },
{ gettext_noop("Addresses in &white list"), Field_List, -1 },
+ { gettext_noop("\nThis is a list of addresses that Mahogany will never add "
+ "to the recipients list automatically,\n"
+ "e.g. when replying. This can be useful to e.g. avoid "
+ "accidentally replying to addresses always sending a bounce back."),
+ Field_Message, -1 },
+ { gettext_noop("Addresses to &never send messages to"), Field_List, -1 },
+
{ gettext_noop("\nYou can add strings of the form \"<address1>=<address2>\" "
"here to indicate that\n"
"Mahogany should treat these addresses as being equivalent.\n"
@@ -2321,6 +2330,8 @@ const ConfigValueDefault wxOptionsPageStandard::ms_aConfigDefaults[] =
CONFIG_NONE(),
CONFIG_ENTRY(MP_WHITE_LIST),
CONFIG_NONE(),
+ CONFIG_ENTRY(MP_NEVER_SEND_TO_ADDRESSES),
+ CONFIG_NONE(),
CONFIG_ENTRY(MP_EQUIV_ADDRESSES),
#ifdef USE_BBDB
CONFIG_NONE(),
@@ -3301,7 +3312,7 @@ bool wxOptionsPage::GetListboxFromButtonEvent(const wxEvent& event,
break;
}
- CHECK( data, false, _T("button even from foreign lbox?") );
+ CHECK( data, false, _T("button event from foreign lbox?") );
if ( pLbox )
*pLbox = lbox;
@@ -4296,12 +4307,19 @@ wxOptionsPageAdb::wxOptionsPageAdb(MBookCtrl *parent,
lboxDataWhiteList->m_lboxDlgPers = _T("LastWhiteList");
lboxDataWhiteList->m_next = lboxDataMLAddr;
+ LboxData *lboxDataNeverSendToList = new LboxData;
+ lboxDataNeverSendToList->m_idListbox = ConfigField_NeverSendToAddresses;
+ lboxDataNeverSendToList->m_lboxDlgTitle = _("Addresses to not send to automatically");
+ lboxDataNeverSendToList->m_lboxDlgPrompt = _("Address");
+ lboxDataNeverSendToList->m_lboxDlgPers = _T("LastNeverSendToList");
+ lboxDataNeverSendToList->m_next = lboxDataWhiteList;
+
LboxData *lboxDataEquivList = new LboxData;
lboxDataEquivList->m_idListbox = ConfigField_EquivAddresses;
lboxDataEquivList->m_lboxDlgTitle = _("Equivalent addresses");
lboxDataEquivList->m_lboxDlgPrompt = _("Pair of equivalent addresses");
lboxDataEquivList->m_lboxDlgPers = _T("LastEquivList");
- lboxDataEquivList->m_next = lboxDataWhiteList;
+ lboxDataEquivList->m_next = lboxDataNeverSendToList;
m_lboxData = lboxDataEquivList;
}
diff --git a/src/mail/MailFolder.cpp b/src/mail/MailFolder.cpp
index d2da3670..e2a2f36b 100644
--- a/src/mail/MailFolder.cpp
+++ b/src/mail/MailFolder.cpp
@@ -63,6 +63,7 @@ extern const MOption MP_FORWARD_PREFIX;
extern const MOption MP_FROM_REPLACE_ADDRESSES;
extern const MOption MP_IMAPHOST;
extern const MOption MP_LIST_ADDRESSES;
+extern const MOption MP_NEVER_SEND_TO_ADDRESSES;
extern const MOption MP_NNTPHOST;
extern const MOption MP_PERSONALNAME;
extern const MOption MP_POPHOST;
@@ -646,6 +647,10 @@ InitRecipients(Composer *cv,
String returnAddrs = READ_CONFIG(profile, MP_FROM_REPLACE_ADDRESSES);
wxArrayString ownAddresses = strutil_restore_array(returnAddrs);
+ // addresses to exclude
+ const wxArrayString excludedAddresses =
+ strutil_restore_array(READ_CONFIG(profile, MP_NEVER_SEND_TO_ADDRESSES));
+
// is this a message from ourselves?
bool fromMyself = false;
@@ -729,7 +734,9 @@ InitRecipients(Composer *cv,
while ( n-- )
{
- cv->AddRecipients(rcptAddresses[n], (RecipientType)rcptTypes[n]);
+ const String& addr = rcptAddresses[n];
+ if ( !Address::IsInList(excludedAddresses, addr) )
+ cv->AddRecipients(addr, (RecipientType)rcptTypes[n]);
}
return;
@@ -920,7 +927,9 @@ InitRecipients(Composer *cv,
while ( n-- )
{
- cv->AddRecipients(rcptAddresses[n], (RecipientType)rcptTypes[n]);
+ const String& addr = rcptAddresses[n];
+ if ( !Address::IsInList(excludedAddresses, addr) )
+ cv->AddRecipients(addr, (RecipientType)rcptTypes[n]);
}
}
-----------------------------------------------------------------------
Summary of changes:
CHANGES | 1 +
include/Moptions.h | 5 +++++
src/classes/Moptions.cpp | 2 ++
src/gui/wxOptionsDlg.cpp | 22 ++++++++++++++++++++--
src/mail/MailFolder.cpp | 13 +++++++++++--
5 files changed, 39 insertions(+), 4 deletions(-)
hooks/post-receive
--
Mahogany sources repository.