Compare commits

...

4 commits
0.4.1 ... main

4 changed files with 12 additions and 6 deletions

View file

@ -42,3 +42,8 @@ deno install \
# OR # OR
./cohamail <subcommand> -h ./cohamail <subcommand> -h
``` ```
## Configuration
You can override default config and templates with your own in
`/etc/cohabit/mailer/(config|templates)/`.

View file

@ -19,7 +19,7 @@ for (const template of Object.values(defaultTemplates)) {
} }
//Load local templates //Load local templates
const basePath = '/etc/cohabit/mailer' const basePath = '/etc/cohabit/mailer/templates'
if (await exists(basePath)) { if (await exists(basePath)) {
for await (const template of Deno.readDir(basePath)) { for await (const template of Deno.readDir(basePath)) {

View file

@ -37,7 +37,7 @@ async function readJsonFile<
return { ...defaultValue, ...json } return { ...defaultValue, ...json }
} }
const basePath = '/ect/cohabit/mailer' const basePath = '/ect/cohabit/mailer/config'
export const accounts = await readJsonFile<AccountRecord>( export const accounts = await readJsonFile<AccountRecord>(
`${basePath}/account.json`, `${basePath}/account.json`,

View file

@ -1,6 +1,6 @@
{ {
"name": "@cohabit/mailer", "name": "@cohabit/mailer",
"version": "0.3.3", "version": "0.5.2",
"exports": { "exports": {
".": "./mod.ts", ".": "./mod.ts",
"./cli": "./cli.ts", "./cli": "./cli.ts",
@ -8,8 +8,8 @@
"./templates": "./templates/mod.ts" "./templates": "./templates/mod.ts"
}, },
"tasks": { "tasks": {
"compile": "deno compile --allow-read --allow-env --allow-net=0.0.0.0 --allow-sys=osRelease,networkInterfaces --allow-run=/usr/sbin/sendmail,whoami --output=bin/mailer --target=x86_64-unknown-linux-gnu ./cli.ts", "compile": "deno compile --allow-read --allow-env --allow-net=0.0.0.0,jsr.io --allow-sys=osRelease,networkInterfaces --allow-run=/usr/sbin/sendmail,whoami --output=bin/mailer --target=x86_64-unknown-linux-gnu ./cli.ts",
"cli": "deno run --allow-read --allow-env --allow-net=0.0.0.0 --allow-sys=osRelease,networkInterfaces --allow-run=/usr/sbin/sendmail,whoami ./cli.ts" "cli": "deno run --allow-read --allow-env --allow-net=0.0.0.0,jsr.io --allow-sys=osRelease,networkInterfaces --allow-run=/usr/sbin/sendmail,whoami ./cli.ts"
}, },
"fmt": { "fmt": {
"singleQuote": true, "singleQuote": true,
@ -31,5 +31,6 @@
"compilerOptions": { "compilerOptions": {
"jsx": "react-jsx", "jsx": "react-jsx",
"jsxImportSource": "preact" "jsxImportSource": "preact"
} },
"license": "MIT"
} }