aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/main/java/com/juick/server/EmailManager.java5
-rw-r--r--src/main/java/com/juick/server/api/Service.java5
2 files changed, 7 insertions, 3 deletions
diff --git a/src/main/java/com/juick/server/EmailManager.java b/src/main/java/com/juick/server/EmailManager.java
index 3939d706..768dd8de 100644
--- a/src/main/java/com/juick/server/EmailManager.java
+++ b/src/main/java/com/juick/server/EmailManager.java
@@ -185,8 +185,9 @@ public class EmailManager implements NotificationListener {
message.setHeader("List-Post", "<mailto:juick@juick.com>");
message.setHeader("List-Owner", "<mailto:support@juick.com>");
message.setHeader("List-Archive", "<https://juick.com/>");
- message.setHeader("List-Unsubscribe", String.format("https://juick.com/settings/unsubscribe?hash=%s",
- userService.getHashByUID(emailUser.getUid())));
+ message.setHeader("List-Unsubscribe",
+ String.format("<mailto:unsubscribe@juick.com>,<https://juick.com/settings/unsubscribe?hash=%s>",
+ userService.getHashByUID(emailUser.getUid())));
message.setHeader("List-Unsubscribe-Post", "List-Unsubscribe=One-Click");
}
message.saveChanges();
diff --git a/src/main/java/com/juick/server/api/Service.java b/src/main/java/com/juick/server/api/Service.java
index 12a9167f..d056d9b0 100644
--- a/src/main/java/com/juick/server/api/Service.java
+++ b/src/main/java/com/juick/server/api/Service.java
@@ -23,6 +23,7 @@ import com.juick.model.CommandResult;
import com.juick.server.CommandsManager;
import com.juick.server.EmailManager;
import com.juick.server.ServerManager;
+import com.juick.server.util.HttpBadRequestException;
import com.juick.server.util.HttpForbiddenException;
import com.juick.service.EmailService;
import com.juick.service.MessagesService;
@@ -188,7 +189,9 @@ public class Service {
User visitor = userService.getUserByEmail(from);
if (!visitor.isAnonymous()) {
-
+ if (!emailService.disableEmail(visitor, from)) {
+ throw new HttpBadRequestException();
+ }
}
} else {
throw new HttpForbiddenException();