Backlog t60: DATEV Unternehmen Online takes receipts by mail only from registered senders. Strato forwarded invoice@ with the supplier as sender, so DATEV rejected every invoice that came straight from a supplier (Hetzner, OpenAI, Anthropic, …). In October they were uploaded by hand.
What changes. With INTAKE_DATEV_ADDRESS set, the intake sends every invoice mail received on or after INTAKE_DATEV_SINCE on to DATEV Upload Mail, from invoice@ through ERPNext (frappe.core.doctype.communication.email.make):
The sent mail replies to the received one (in_reply_to). That is the "already forwarded" marker, so the service stays stateless. It also shows in the mail's timeline, and ERPNext's Email Queue retries a failed send.
An XRechnung goes as XML only (DATEV reads it, and the PDF rendering would be a second receipt). Otherwise every PDF goes.
DATEV's own mails (*.datev.de) and bounces (mailer-daemon, postmaster) are never forwarded, so nothing loops. They now become ToDos with their own reason instead of "Keine PDF-Anlage".
A failed forward doesn't stop the drafts, and the other way round (errors.Join).
Off by default: without INTAKE_DATEV_ADDRESS nothing changes. -dry-run reports "N forwarded to DATEV" without sending.
Before switching it on (orca-infra PR to follow, which also bumps the image digest):
In DATEV Unternehmen Online: register invoice@breakpilot.com as an Upload Mail sender.
In ERPNext: turn on outgoing mail (Strato SMTP) for the Email Account "Eingangsrechnung" (invoice@). Without it, Frappe falls back to the default outgoing account.
At Strato: remove the copy of invoice@ to the DATEV address, otherwise every founder-forwarded mail arrives twice.
Set the DATEV address as an orca secret. It never appears in logs or in this repo.
Tests: 7 new (internal/invoiceintake): forward once and stable across processes, XML-only for XRechnung, cut-off date, DATEV/bounce mails, dry run, forward failure keeps drafts and retries, config validation. go test -race and go vet pass, and coverage is 87.4 %.
Backlog t60: DATEV Unternehmen Online takes receipts by mail only from registered senders. Strato forwarded invoice@ with the supplier as sender, so DATEV rejected every invoice that came straight from a supplier (Hetzner, OpenAI, Anthropic, …). In October they were uploaded by hand.
**What changes.** With `INTAKE_DATEV_ADDRESS` set, the intake sends every invoice mail received on or after `INTAKE_DATEV_SINCE` on to DATEV Upload Mail, **from invoice@ through ERPNext** (`frappe.core.doctype.communication.email.make`):
- The sent mail replies to the received one (`in_reply_to`). That is the "already forwarded" marker, so the service stays stateless. It also shows in the mail's timeline, and ERPNext's Email Queue retries a failed send.
- An XRechnung goes as XML only (DATEV reads it, and the PDF rendering would be a second receipt). Otherwise every PDF goes.
- DATEV's own mails (`*.datev.de`) and bounces (`mailer-daemon`, `postmaster`) are never forwarded, so nothing loops. They now become ToDos with their own reason instead of "Keine PDF-Anlage".
- A failed forward doesn't stop the drafts, and the other way round (`errors.Join`).
- Off by default: without `INTAKE_DATEV_ADDRESS` nothing changes. `-dry-run` reports "N forwarded to DATEV" without sending.
**Before switching it on** (orca-infra PR to follow, which also bumps the image digest):
1. In DATEV Unternehmen Online: register `invoice@breakpilot.com` as an Upload Mail sender.
2. In ERPNext: turn on outgoing mail (Strato SMTP) for the Email Account "Eingangsrechnung" (invoice@). Without it, Frappe falls back to the default outgoing account.
3. At Strato: remove the copy of invoice@ to the DATEV address, otherwise every founder-forwarded mail arrives twice.
4. Set the DATEV address as an orca secret. It never appears in logs or in this repo.
**Tests:** 7 new (`internal/invoiceintake`): forward once and stable across processes, XML-only for XRechnung, cut-off date, DATEV/bounce mails, dry run, forward failure keeps drafts and retries, config validation. `go test -race` and `go vet` pass, and coverage is 87.4 %.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
DATEV Unternehmen Online takes receipts by mail only from registered
senders. Strato forwarded invoice@ with the supplier as sender, so DATEV
rejected every invoice that came straight from a supplier (backlog t60).
With INTAKE_DATEV_ADDRESS set, the intake sends each invoice mail received
on or after INTAKE_DATEV_SINCE on to that address, from invoice@, through
ERPNext (communication.email.make). The sent mail replies to the received
one (in_reply_to): that is the marker, it shows in the mail's timeline,
and ERPNext's Email Queue retries a failed send. An XRechnung goes as XML
only, so its PDF rendering doesn't become a second receipt. DATEV's own
answers and bounces are never forwarded; they become ToDos with their own
reason instead of "no PDF". A failed forward doesn't stop the drafts, and
the other way round.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
sharang
merged commit 286f50c5fb into main2026-11-02 11:59:01 +00:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Backlog t60: DATEV Unternehmen Online takes receipts by mail only from registered senders. Strato forwarded invoice@ with the supplier as sender, so DATEV rejected every invoice that came straight from a supplier (Hetzner, OpenAI, Anthropic, …). In October they were uploaded by hand.
What changes. With
INTAKE_DATEV_ADDRESSset, the intake sends every invoice mail received on or afterINTAKE_DATEV_SINCEon to DATEV Upload Mail, from invoice@ through ERPNext (frappe.core.doctype.communication.email.make):in_reply_to). That is the "already forwarded" marker, so the service stays stateless. It also shows in the mail's timeline, and ERPNext's Email Queue retries a failed send.*.datev.de) and bounces (mailer-daemon,postmaster) are never forwarded, so nothing loops. They now become ToDos with their own reason instead of "Keine PDF-Anlage".errors.Join).INTAKE_DATEV_ADDRESSnothing changes.-dry-runreports "N forwarded to DATEV" without sending.Before switching it on (orca-infra PR to follow, which also bumps the image digest):
invoice@breakpilot.comas an Upload Mail sender.Tests: 7 new (
internal/invoiceintake): forward once and stable across processes, XML-only for XRechnung, cut-off date, DATEV/bounce mails, dry run, forward failure keeps drafts and retries, config validation.go test -raceandgo vetpass, and coverage is 87.4 %.🤖 Generated with Claude Code