SusiMail: Remove Bcc-to-self feature,

replace with copy-to-sent config (ticket #2087)
This commit is contained in:
zzz
2018-04-21 11:18:58 +00:00
parent f040421848
commit ceeacf6a07
2 changed files with 27 additions and 35 deletions

View File

@@ -196,7 +196,6 @@ public class WebMail extends HttpServlet
private static final String NEW_TEXT = "new_text"; private static final String NEW_TEXT = "new_text";
private static final String NEW_FILENAME = "new_filename"; private static final String NEW_FILENAME = "new_filename";
private static final String NEW_UPLOAD = "new_upload"; private static final String NEW_UPLOAD = "new_upload";
private static final String NEW_BCC_TO_SELF = "new_bcc_to_self";
private static final String LIST = "list"; private static final String LIST = "list";
private static final String PREV = "prev"; private static final String PREV = "prev";
@@ -247,7 +246,7 @@ public class WebMail extends HttpServlet
private static final String CONFIG_COMPOSER_COLS = "composer.cols"; private static final String CONFIG_COMPOSER_COLS = "composer.cols";
private static final String CONFIG_COMPOSER_ROWS = "composer.rows"; private static final String CONFIG_COMPOSER_ROWS = "composer.rows";
private static final String CONFIG_BCC_TO_SELF = "composer.bcc.to.self"; private static final String CONFIG_COPY_TO_SENT = "composer.copy.to.sent";
static final String CONFIG_LEAVE_ON_SERVER = "pop3.leave.on.server"; static final String CONFIG_LEAVE_ON_SERVER = "pop3.leave.on.server";
public static final String CONFIG_BACKGROUND_CHECK = "pop3.check.enable"; public static final String CONFIG_BACKGROUND_CHECK = "pop3.check.enable";
public static final String CONFIG_CHECK_MINUTES = "pop3.check.interval.minutes"; public static final String CONFIG_CHECK_MINUTES = "pop3.check.interval.minutes";
@@ -292,14 +291,12 @@ public class WebMail extends HttpServlet
public boolean reallyDelete; public boolean reallyDelete;
String themePath, imgPath; String themePath, imgPath;
boolean isMobile; boolean isMobile;
boolean bccToSelf;
private final List<String> nonces; private final List<String> nonces;
private static final int MAX_NONCES = 15; private static final int MAX_NONCES = 15;
public final Log log; public final Log log;
SessionObject(Log log) SessionObject(Log log)
{ {
bccToSelf = Boolean.parseBoolean(Config.getProperty( CONFIG_BCC_TO_SELF, "true" ));
nonces = new ArrayList<String>(MAX_NONCES + 1); nonces = new ArrayList<String>(MAX_NONCES + 1);
caches = new HashMap<String, MailCache>(8); caches = new HashMap<String, MailCache>(8);
this.log = log; this.log = log;
@@ -2566,13 +2563,6 @@ public class WebMail extends HttpServlet
Mail.getRecipientsFromList( ccList, cc, ok ); Mail.getRecipientsFromList( ccList, cc, ok );
Mail.getRecipientsFromList( bccList, bcc, ok ); Mail.getRecipientsFromList( bccList, bcc, ok );
String bccToSelf = request.getParameter( NEW_BCC_TO_SELF );
boolean toSelf = "1".equals(bccToSelf);
// save preference in session
sessionObject.bccToSelf = toSelf;
if (toSelf && sender != null && sender.length() > 0 && !bccList.contains(sender))
bccList.add( sender );
Encoding qp = EncodingFactory.getEncoding( "quoted-printable" ); Encoding qp = EncodingFactory.getEncoding( "quoted-printable" );
Encoding hl = EncodingFactory.getEncoding( "HEADERLINE" ); Encoding hl = EncodingFactory.getEncoding( "HEADERLINE" );
@@ -2775,6 +2765,8 @@ public class WebMail extends HttpServlet
if (log.shouldDebug()) log.debug("Sent email deleted from drafts"); if (log.shouldDebug()) log.debug("Sent email deleted from drafts");
} }
// now store to sent // now store to sent
// if configured (default true)
if (Boolean.parseBoolean(Config.getProperty(CONFIG_COPY_TO_SENT, "true"))) {
mc = sessionObject.caches.get(DIR_SENT); mc = sessionObject.caches.get(DIR_SENT);
if (mc != null) { if (mc != null) {
waitForLoad(sessionObject, mc); waitForLoad(sessionObject, mc);
@@ -2799,6 +2791,7 @@ public class WebMail extends HttpServlet
mc.writeComplete(uidl, buffer, copyOK); mc.writeComplete(uidl, buffer, copyOK);
} }
} }
}
} else { } else {
sessionObject.error += relay.error; sessionObject.error += relay.error;
} }
@@ -2957,7 +2950,6 @@ public class WebMail extends HttpServlet
"<tr><td align=\"right\">" + _t("To") + ":</td><td align=\"left\"><input type=\"text\" size=\"80\" name=\"" + NEW_TO + "\" value=\"" + quoteHTML(to) + "\"></td></tr>\n" + "<tr><td align=\"right\">" + _t("To") + ":</td><td align=\"left\"><input type=\"text\" size=\"80\" name=\"" + NEW_TO + "\" value=\"" + quoteHTML(to) + "\"></td></tr>\n" +
"<tr><td align=\"right\">" + _t("Cc") + ":</td><td align=\"left\"><input type=\"text\" size=\"80\" name=\"" + NEW_CC + "\" value=\"" + quoteHTML(cc) + "\"></td></tr>\n" + "<tr><td align=\"right\">" + _t("Cc") + ":</td><td align=\"left\"><input type=\"text\" size=\"80\" name=\"" + NEW_CC + "\" value=\"" + quoteHTML(cc) + "\"></td></tr>\n" +
"<tr><td align=\"right\">" + _t("Bcc") + ":</td><td align=\"left\"><input type=\"text\" size=\"80\" name=\"" + NEW_BCC + "\" value=\"" + quoteHTML(bcc) + "\"></td></tr>\n" + "<tr><td align=\"right\">" + _t("Bcc") + ":</td><td align=\"left\"><input type=\"text\" size=\"80\" name=\"" + NEW_BCC + "\" value=\"" + quoteHTML(bcc) + "\"></td></tr>\n" +
"<tr><td align=\"right\"><label for=\"bcctoself\">" + _t("Bcc to self") + ":</label></td><td align=\"left\"><input type=\"checkbox\" class=\"optbox\" id=\"bcctoself\" name=\"" + NEW_BCC_TO_SELF + "\" value=\"1\" " + (sessionObject.bccToSelf ? "checked" : "" ) + "></td></tr>\n" +
"<tr><td align=\"right\">" + _t("Subject") + ":</td><td align=\"left\"><input type=\"text\" size=\"80\" name=\"" + NEW_SUBJECT + "\" value=\"" + quoteHTML(subject) + "\"></td></tr>\n" + "<tr><td align=\"right\">" + _t("Subject") + ":</td><td align=\"left\"><input type=\"text\" size=\"80\" name=\"" + NEW_SUBJECT + "\" value=\"" + quoteHTML(subject) + "\"></td></tr>\n" +
"<tr><td></td><td align=\"left\"><textarea cols=\"" + Config.getProperty( CONFIG_COMPOSER_COLS, 80 )+ "\" rows=\"" + Config.getProperty( CONFIG_COMPOSER_ROWS, 10 )+ "\" name=\"" + NEW_TEXT + "\">" + text + "</textarea></td></tr>" + "<tr><td></td><td align=\"left\"><textarea cols=\"" + Config.getProperty( CONFIG_COMPOSER_COLS, 80 )+ "\" rows=\"" + Config.getProperty( CONFIG_COMPOSER_ROWS, 10 )+ "\" name=\"" + NEW_TEXT + "\">" + text + "</textarea></td></tr>" +
"<tr class=\"bottombuttons\"><td colspan=\"2\" align=\"center\"><hr></td></tr>\n" + "<tr class=\"bottombuttons\"><td colspan=\"2\" align=\"center\"><hr></td></tr>\n" +

View File

@@ -11,7 +11,7 @@ susimail.pager.pagesize=30
susimail.composer.cols=80 susimail.composer.cols=80
susimail.composer.rows=15 susimail.composer.rows=15
susimail.composer.bcc.to.self=false susimail.composer.copy.to.sent=true
susimail.pop3.leave.on.server=false susimail.pop3.leave.on.server=false
susimail.pop3.check.enable=false susimail.pop3.check.enable=false