This commit is contained in:
parent
08bf2a39e4
commit
9c4ea7a434
|
@ -447,7 +447,6 @@ export default function killTheNewsletter(
|
|||
disabledCommands: ["AUTH", "STARTTLS"],
|
||||
async onData(stream, session, callback) {
|
||||
try {
|
||||
const atHost = "@" + new URL(webApplication.get("email")).hostname;
|
||||
const email = await mailparser.simpleParser(stream);
|
||||
const from = email.from?.text ?? "";
|
||||
const subject = email.subject ?? "";
|
||||
|
@ -459,8 +458,11 @@ export default function killTheNewsletter(
|
|||
(smtpServerAddress) => smtpServerAddress.address
|
||||
)
|
||||
)) {
|
||||
if (!address.endsWith(atHost)) continue;
|
||||
const feedReference = address.slice(0, -atHost.length);
|
||||
const addressParts = address.split("@");
|
||||
if (addressParts.length !== 2) continue;
|
||||
const [feedReference, hostname] = addressParts;
|
||||
if (hostname !== new URL(webApplication.get("email")).hostname)
|
||||
continue;
|
||||
const feed = database.get<{ id: number }>(
|
||||
sql`SELECT "id" FROM "feeds" WHERE "reference" = ${feedReference}`
|
||||
);
|
||||
|
|
Loading…
Reference in New Issue