aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAnders Betts <anders.betts@gmail.com>2026-09-21 10:34:13 +0200
committerAnders Betts <anders.betts@gmail.com>2026-09-21 10:34:13 +0200
commite25a8c9ae70e5a310c1a82be55d0dbf58ba71250 (patch)
tree3368133cb605fef92548838c90c7e0bd7cea502d /src
parentecf1e1098969c36580fc274cb70a8fd60412edf6 (diff)
downloadbokf-main.tar.gz
bokf-main.zip
mail: honor smtp_reply_to; mention payroll in agent instructionsHEADmain
Diffstat (limited to 'src')
-rw-r--r--src/commands.c3
-rw-r--r--src/mail.c1
-rw-r--r--src/smtp.c5
-rw-r--r--src/smtp.h1
4 files changed, 10 insertions, 0 deletions
diff --git a/src/commands.c b/src/commands.c
index 56e7010..5d5d7c1 100644
--- a/src/commands.c
+++ b/src/commands.c
@@ -123,6 +123,9 @@ static const char AGENT_INSTRUCTIONS[] =
" next number, stores the PDF and posts the voucher in one transaction.\n"
" `invoice.send` e-mails the stored PDF; it needs the org's SMTP settings\n"
" and sends to the customer's address unless `to` overrides it.\n"
+ "- Payroll: `payroll.run_preview` then `payroll.run_post` per period;\n"
+ " `payroll.agi` returns the values for the manual arbetsgivardeklaration;\n"
+ " `payroll.payslip` renders and `payroll.payslip_mail` sends the payslip.\n"
"\n"
"## Discovery\n"
"- `describe` lists every implemented command with permissions.\n"
diff --git a/src/mail.c b/src/mail.c
index 52d429c..ca35f6d 100644
--- a/src/mail.c
+++ b/src/mail.c
@@ -148,6 +148,7 @@ int mail_send_pdf(sqlite3 *db, int64_t org_id, const struct mail_message *m,
sm.password = c.password ? c.password : "";
sm.from = c.from;
sm.from_name = c.from_name;
+ sm.reply_to = c.reply_to && *c.reply_to ? c.reply_to : NULL;
sm.to = m->to;
sm.subject = m->subject;
sm.body = m->body;
diff --git a/src/smtp.c b/src/smtp.c
index ed70519..6a90424 100644
--- a/src/smtp.c
+++ b/src/smtp.c
@@ -751,6 +751,11 @@ static int build_message(const struct smtp_message *m, const char *from,
}
buf_appendf(out, "<%s>\r\n", from);
buf_appendf(out, "To: <%s>\r\n", to);
+ if (m->reply_to && m->reply_to[0]) {
+ char *rt = sanitize_dup(m->reply_to);
+ buf_appendf(out, "Reply-To: <%s>\r\n", rt);
+ free(rt);
+ }
char *subject = sanitize_dup(m->subject ? m->subject : "");
buf_append_str(out, "Subject: ");
diff --git a/src/smtp.h b/src/smtp.h
index a6c4a34..0c1924a 100644
--- a/src/smtp.h
+++ b/src/smtp.h
@@ -11,6 +11,7 @@ struct smtp_message {
const char *password;
const char *from; /* envelope + From address */
const char *from_name; /* display name, may be NULL */
+ const char *reply_to; /* Reply-To address, may be NULL */
const char *to;
const char *subject;
const char *body; /* UTF-8 text body */