diff options
| author | Anders Betts <anders.betts@gmail.com> | 2026-09-21 10:34:13 +0200 |
|---|---|---|
| committer | Anders Betts <anders.betts@gmail.com> | 2026-09-21 10:34:13 +0200 |
| commit | e25a8c9ae70e5a310c1a82be55d0dbf58ba71250 (patch) | |
| tree | 3368133cb605fef92548838c90c7e0bd7cea502d | |
| parent | ecf1e1098969c36580fc274cb70a8fd60412edf6 (diff) | |
| download | bokf-e25a8c9ae70e5a310c1a82be55d0dbf58ba71250.tar.gz bokf-e25a8c9ae70e5a310c1a82be55d0dbf58ba71250.zip | |
mail: honor smtp_reply_to; mention payroll in agent instructions
| -rw-r--r-- | src/commands.c | 3 | ||||
| -rw-r--r-- | src/mail.c | 1 | ||||
| -rw-r--r-- | src/smtp.c | 5 | ||||
| -rw-r--r-- | src/smtp.h | 1 |
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" @@ -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; @@ -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: "); @@ -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 */ |
