mirror of https://github.com/M66B/FairEmail.git
Conditinally use example.com as Report-UA
This commit is contained in:
parent
74f5ff2040
commit
9d7c1af493
|
@ -635,17 +635,26 @@ public class MessageHelper {
|
||||||
plainPart.setContent(plainContent, "text/plain; charset=" + Charset.defaultCharset().name());
|
plainPart.setContent(plainContent, "text/plain; charset=" + Charset.defaultCharset().name());
|
||||||
report.addBodyPart(plainPart);
|
report.addBodyPart(plainPart);
|
||||||
|
|
||||||
|
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
|
||||||
|
boolean client_id = prefs.getBoolean("client_id", true);
|
||||||
|
|
||||||
String from = null;
|
String from = null;
|
||||||
if (message.from != null && message.from.length > 0)
|
if (message.from != null && message.from.length > 0)
|
||||||
from = ((InternetAddress) message.from[0]).getAddress();
|
from = ((InternetAddress) message.from[0]).getAddress();
|
||||||
|
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
sb.append("Reporting-UA: ")
|
|
||||||
.append(BuildConfig.APPLICATION_ID).append("; ")
|
sb.append("Reporting-UA: ");
|
||||||
.append(context.getString(R.string.app_name)).append(' ')
|
if (client_id)
|
||||||
.append(BuildConfig.VERSION_NAME).append("\r\n");
|
sb.append(BuildConfig.APPLICATION_ID).append("; ")
|
||||||
|
.append(context.getString(R.string.app_name)).append(' ')
|
||||||
|
.append(BuildConfig.VERSION_NAME).append("\r\n");
|
||||||
|
else
|
||||||
|
sb.append("example.com").append("\r\n");
|
||||||
|
|
||||||
if (from != null)
|
if (from != null)
|
||||||
sb.append("Original-Recipient: rfc822;").append(from).append("\r\n");
|
sb.append("Original-Recipient: rfc822;").append(from).append("\r\n");
|
||||||
|
|
||||||
sb.append("Disposition: manual-action/MDN-sent-manually; displayed").append("\r\n");
|
sb.append("Disposition: manual-action/MDN-sent-manually; displayed").append("\r\n");
|
||||||
|
|
||||||
BodyPart dnsPart = new MimeBodyPart();
|
BodyPart dnsPart = new MimeBodyPart();
|
||||||
|
|
Loading…
Reference in New Issue