Axigen#
This documentation applies to Piler enterprise edition 2.2.4+ and piler-smtp 1.1.6+
Revision #1
Publication date: 2026-OCT-17
Axigen sends the archive copies with Acceptance & Routing rules and
their Add recipient action. The Axigen variables %currentRcptLocalPart%
and %currentRcptDomain% build the encoded archive address of each
recipient, so the Bcc recipients are archived too. See
Mail server integration for the address format and
Envelope recipients for the Piler side.
Tested with the axigen/axigen Docker image:
- The rules run on the On Recipient event, once for each recipient, including recipients that are only in the SMTP envelope (Bcc).
- The encoded addresses of an email reach
piler-smtpin one SMTP transaction, so the email is archived once, with all its recipients.
The examples below use the tenant customer1 with the domain
customer1.com, and archive.example.com as the archive hostname.
1. Prepare Piler#
Follow steps 1-3 of Envelope recipients:
restrict piler-smtp to your Axigen servers and enable envelope files
(enable_envelope_sidecar=1). Do this before creating the rules below,
otherwise piler-smtp rejects the encoded addresses, and Axigen queues the
copies.
2. Deliver to piler-smtp#
Axigen delivers email for archive.example.com like any other remote
domain: by its MX record, or by a routing rule that sends it to the
piler-smtp host, port 25.
Axigen verifies the certificate that piler-smtp offers for STARTTLS. With
a self-signed certificate the delivery fails, and the piler-smtp log
shows:
SSL routines:ssl3_read_bytes:tlsv1 alert unknown ca
ERROR: TLS negotiation failed
Give piler-smtp a certificate that Axigen trusts, e.g. one issued for
the archive hostname, or turn off the certificate check for this delivery
in Axigen.
3. Create the rules#
In WebAdmin: Security & Filtering → Acceptance & Routing → Advanced Settings, add a rule for incoming and one for outgoing email, per tenant.
Incoming email#
For the emails the tenant's users receive.
| Rule name | archive_customer1_incoming |
| Conditions | Recipient domain Is customer1.com |
| Action | Add recipient: customer1+%currentRcptLocalPart%=%currentRcptDomain%@archive.example.com |
For a tenant with several domains, add a Recipient domain condition for each, and match ANY of the conditions.
Outgoing email#
For the emails the tenant's users send to external recipients. Match ALL of the conditions:
| Rule name | archive_customer1_outgoing |
| Conditions | Is Authenticated (Settings) |
Sender domain Is customer1.com |
|
Recipient domain Is not customer1.com |
|
Recipient domain Is not archive.example.com |
|
| Action | Add recipient: customer1+%currentRcptLocalPart%=%currentRcptDomain%@archive.example.com |
The rules also run for the recipients the rules add:
- Without the Is not
archive.example.comcondition, the outgoing rule encodes the archive address added by the incoming rule a second time:customer1+customer1+anna=customer1.com=archive.example.com@archive.example.com.piler-smtp1.1.6+ logs and ignores such an address, older versions archive it as a recipient. - The tenant's own recipients are covered by the incoming rule, so the
outgoing rule leaves them out (Is not
customer1.com).
With a tenant of several domains, add a Sender domain condition (with ANY) or a separate outgoing rule for each domain.
A DR site#
To send every email to a second Piler site as well, give each rule a
second Add recipient action with the DR site's archive hostname, e.g.
customer1+%currentRcptLocalPart%=%currentRcptDomain%@archive-dr.example.com,
and exclude that hostname in the outgoing rule too
(Recipient domain Is not archive-dr.example.com).
4. Verify#
Send an email from an external address to two users of the tenant, one of them in Bcc. In Axigen's queue the email shows the two recipients and their two encoded archive addresses.
The piler daemon log shows the envelope recipients:
worker=0, /var/piler/tmp/0/customer1-BOQ04O6OZU06EUQJLSEW has 2 envelope recipients
Both users, the Bcc recipient included, find the email in the archive.
Then send an email as an authenticated user of the tenant to an external address, with a Bcc to another external address: both external recipients are archived.
Troubleshooting#
| Symptom | Cause |
|---|---|
The archive copies stay in Axigen's queue, tlsv1 alert unknown ca in the piler-smtp log |
Axigen doesn't trust the certificate of piler-smtp, see step 2 |
piler-smtp answers 451 for the tenant |
The tenant doesn't exist in Piler yet |
envelope recipient ... is an archive address, not recorded in the piler-smtp log |
The outgoing rule lacks the Recipient domain Is not archive.example.com condition |
| An archive address of another host (e.g. the DR site) is archived as a recipient | The outgoing rule lacks the Is not condition for that hostname |
| A Bcc recipient doesn't find the email | enable_envelope_sidecar is not set, or the rule doesn't cover the recipient's domain |
Axigen references#
- How to Implement Email Archiving with Axigen
- Advanced Acceptance & Routing Rules
- How to redirect a message to the same user on another mail server and also keep a local copy: the
%currentRcptLocalPart%and%currentRcptDomain%variables