Kryptonian
Explore posts from serversSending email with SMTP and Deno, with InReplyTo headers failing
It seems that currently it's not possible to send emails using denomailer with InReplyTo headers, as it chockes on the
in
in the header name.
Any other ideas as to how I should do sending email?
I'm using the following code currently, or trying to:
import { SMTPClient as DenoMailerSMTPClient } from "https://deno.land/x/[email protected]/mod.ts";
type Smtp = {
host: string;
port: number;
};
type EmailObject = {
from: string;
cc?: string;
subject: string;
content: string;
inReplyTo?: string; // Added inReplyTo field
references?: string; // Added references field
};
export async function send_smtp_email(
smtp_res: Smtp,
to_email: string,
from_email: string,
subject: string,
content: string,
cc_email?: string,
inReplyTo?: string,
references?: string,
) {
const client = new DenoMailerSMTPClient({
debug: {
allowUnsecure: true,
},
connection: {
hostname: smtp_res.host,
port: smtp_res.port,
},
});
const headers: { [key: string]: string } = {
from: from_email,
to: to_email,
cc: cc_email || '', // Use the cc_email parameter here
subject: subject,
inReplyTo: inReplyTo || '', // Add In-Reply-To header if provided
references: references || '', // Add References header if provided
};
await client.send({
headers,
content,
});
await client.close();
return `Email sent from ${from_email} to ${to_email}`;
}
export async function main(email: EmailObject, smtpResource: Smtp) {
if (email != null) {
const currentDate = new Date().toLocaleDateString("fi-FI");
const emailBody = "Hei"
`On ${currentDate}, ${email.from} wrote:\n` +
`\"${email.content}\"\n\n`
const sendEmail = await send_smtp_email(
smtpResource,
email.from,
"sender",
`Re: ${email.subject}`,
emailBody,
"cc",
email.inReplyTo,
email.references,
);
return sendEmail;
} else {
return "NOOP";
}
}
import { SMTPClient as DenoMailerSMTPClient } from "https://deno.land/x/[email protected]/mod.ts";
type Smtp = {
host: string;
port: number;
};
type EmailObject = {
from: string;
cc?: string;
subject: string;
content: string;
inReplyTo?: string; // Added inReplyTo field
references?: string; // Added references field
};
export async function send_smtp_email(
smtp_res: Smtp,
to_email: string,
from_email: string,
subject: string,
content: string,
cc_email?: string,
inReplyTo?: string,
references?: string,
) {
const client = new DenoMailerSMTPClient({
debug: {
allowUnsecure: true,
},
connection: {
hostname: smtp_res.host,
port: smtp_res.port,
},
});
const headers: { [key: string]: string } = {
from: from_email,
to: to_email,
cc: cc_email || '', // Use the cc_email parameter here
subject: subject,
inReplyTo: inReplyTo || '', // Add In-Reply-To header if provided
references: references || '', // Add References header if provided
};
await client.send({
headers,
content,
});
await client.close();
return `Email sent from ${from_email} to ${to_email}`;
}
export async function main(email: EmailObject, smtpResource: Smtp) {
if (email != null) {
const currentDate = new Date().toLocaleDateString("fi-FI");
const emailBody = "Hei"
`On ${currentDate}, ${email.from} wrote:\n` +
`\"${email.content}\"\n\n`
const sendEmail = await send_smtp_email(
smtpResource,
email.from,
"sender",
`Re: ${email.subject}`,
emailBody,
"cc",
email.inReplyTo,
email.references,
);
return sendEmail;
} else {
return "NOOP";
}
}
5 replies
IImmich
•Created by Kryptonian on 4/10/2023 in #help-desk-support
Transcoding difficulties
It seems that ffprobe is having difficulty so end result is no transcoded video. 🤔
[Nest] 1 - 04/10/2023, 1:35:38 PM ERROR [MediaService] Failed to handle video conversion for asset: ad2d646a-1b58-48dd-a6f2-81effb02bd67
Error: ffprobe exited with code 1
ffprobe version 4.4.1 Copyright (c) 2007-2021 the FFmpeg developers
built with gcc 10.3.1 (Alpine 10.3.1_git20210424) 20210424
configuration: --prefix=/usr --enable-avresample --enable-avfilter --enable-gnutls --enable-gpl --enable-libass --enable-libmp3lame --enable-libvorbis --enable-libvpx --enable-libxvid --enable-libx264 --enable-libx265 --enable-libtheora --enable-libv4l2 --enable-libdav1d --enable-postproc --enable-pic --enable-pthreads --enable-shared --enable-libxcb --enable-libsrt --enable-libssh --enable-libvidstab --disable-stripping --disable-static --disable-librtmp --enable-vaapi --enable-vdpau --enable-libopus --enable-vulkan --enable-libsoxr --enable-libwebp --enable-libaom --disable-debug
libavutil 56. 70.100 / 56. 70.100
libavcodec 58.134.100 / 58.134.100
libavformat 58. 76.100 / 58. 76.100
libavdevice 58. 13.100 / 58. 13.100
libavfilter 7.110.100 / 7.110.100
libavresample 4. 0. 0 / 4. 0. 0
libswscale 5. 9.100 / 5. 9.100
libswresample 3. 9.100 / 3. 9.100
libpostproc 55. 9.100 / 55. 9.100
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f59b77ef640] Format mov,mp4,m4a,3gp,3g2,mj2 detected only with low score of 1, misdetection possible!
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f59b77ef640] moov atom not found
upload/upload/2c5f26ae-fa8a-4b2e-a1b8-be487f226950/19fe0b16-e1f0-40f8-80a9-4ec9219de719.mp4: Invalid data found when processing input
at ChildProcess.<anonymous> (/usr/src/app/node_modules/fluent-ffmpeg/lib/ffprobe.js:233:22)
at ChildProcess.emit (node:events:527:28)
at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12)
[Nest] 1 - 04/10/2023, 1:35:38 PM ERROR [MediaService] Failed to handle video conversion for asset: ad2d646a-1b58-48dd-a6f2-81effb02bd67
Error: ffprobe exited with code 1
ffprobe version 4.4.1 Copyright (c) 2007-2021 the FFmpeg developers
built with gcc 10.3.1 (Alpine 10.3.1_git20210424) 20210424
configuration: --prefix=/usr --enable-avresample --enable-avfilter --enable-gnutls --enable-gpl --enable-libass --enable-libmp3lame --enable-libvorbis --enable-libvpx --enable-libxvid --enable-libx264 --enable-libx265 --enable-libtheora --enable-libv4l2 --enable-libdav1d --enable-postproc --enable-pic --enable-pthreads --enable-shared --enable-libxcb --enable-libsrt --enable-libssh --enable-libvidstab --disable-stripping --disable-static --disable-librtmp --enable-vaapi --enable-vdpau --enable-libopus --enable-vulkan --enable-libsoxr --enable-libwebp --enable-libaom --disable-debug
libavutil 56. 70.100 / 56. 70.100
libavcodec 58.134.100 / 58.134.100
libavformat 58. 76.100 / 58. 76.100
libavdevice 58. 13.100 / 58. 13.100
libavfilter 7.110.100 / 7.110.100
libavresample 4. 0. 0 / 4. 0. 0
libswscale 5. 9.100 / 5. 9.100
libswresample 3. 9.100 / 3. 9.100
libpostproc 55. 9.100 / 55. 9.100
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f59b77ef640] Format mov,mp4,m4a,3gp,3g2,mj2 detected only with low score of 1, misdetection possible!
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f59b77ef640] moov atom not found
upload/upload/2c5f26ae-fa8a-4b2e-a1b8-be487f226950/19fe0b16-e1f0-40f8-80a9-4ec9219de719.mp4: Invalid data found when processing input
at ChildProcess.<anonymous> (/usr/src/app/node_modules/fluent-ffmpeg/lib/ffprobe.js:233:22)
at ChildProcess.emit (node:events:527:28)
at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12)
54 replies
IImmich
•Created by Kryptonian on 1/12/2023 in #help-desk-support
Github tags & Renovate
Hi there,
Could someone share some insights to why would Renovate even find an major update for it?
https://github.com/samip5/k8s-cluster/actions/runs/3904758120/jobs/6670946037#step:5:3495
7 replies