Suped

How to set up DMARC/DKIM/SPF for Moloni

Published 14 Jul 2026
Updated 15 Nov 2026
14 min read
Summarize with
How to set up DMARC, DKIM, and SPF for Moloni
Updated on 15 Nov 2026: We clarified Moloni's DNS setup, strict DMARC alignment, and report delivery checks while preserving existing enforcement.
For moloni.pt logoMoloni custom sender mail, authorize 94.46.130.39 and 94.46.130.38 in the appropriate domain's single SPF record, publish Moloni's DKIM key at dkim._domainkey, and configure DMARC for the visible From domain. For a new DMARC deployment without an inherited policy, start with v=DMARC1; p=none; rua=mailto:dmarc@example.com, replacing the reporting address. DMARC passes when SPF or DKIM passes and satisfies the domain's alignment rules.
Moloni normally sends through faturas@moloni.pt. A custom sender on a domain you control requires the Moloni Pro custom email option and matching DNS. Moloni documents custom sender support for documents, identification templates, customer messages, pending-sales lists, scheduled events, and stock alerts. Keep an existing p=quarantine or p=reject policy in place rather than weakening it while adding Moloni. Confirm eligibility and activation in Moloni's custom sender instructions.

Prepare the Moloni custom sender

  1. Check ownership: Use an address on a domain whose DNS you can edit. A public mailbox address cannot be authenticated as your Moloni custom sender.
  2. Confirm access: Custom sender configuration is available on Moloni Pro. Accounts that previously had custom sending enabled can ask apoio@moloni.pt for reactivation after Moloni checks eligibility and SPF.
  3. Open settings: Sign in to Moloni, open Configurações, select Empresa, and choose the E-mails tab.
  4. Locate the control: Find Quero ativar envio de e-mails personalizado and the confirmation labeled Confirmo que posso configurar o SPF.
  5. Stage the sender: Choose the intended address, but leave custom sending disabled until SPF and DKIM are published and visible in public DNS.
Moloni treats the custom address as a sending identity rather than a mailbox it hosts. The address should receive replies, and its domain must match the domain being authenticated. For a domain using a hosted mailbox service, confirm the proposed changes with Moloni support first. These TXT changes do not require changing MX records or moving the mailbox.
Moloni custom email sender settings under Empresa and E-mails
Moloni custom email sender settings under Empresa and E-mails
The SPF confirmation is an operational checkpoint. Clicking it before DNS is ready can put live invoice and notification delivery at risk, so complete the next two sections first.
Use a domain you control
Do not configure a consumer mailbox or a third-party domain as the custom From address. DNS authorization must be published by the domain owner, and DMARC alignment is checked against that visible From domain.

Set up SPF

  1. Find the record: Locate the TXT value beginning with v=spf1 for the domain Moloni asks you to authorize. Confirm the envelope sender (Return-Path) domain with Moloni if it differs from the custom From domain.
  2. Merge the IPs: Insert ip4:94.46.130.39 and ip4:94.46.130.38 before the final all mechanism in the existing record. If it uses redirect= instead, retain that modifier and ask the DNS owner to review the combined policy.
  3. Create only if absent: If the domain has no SPF record and Moloni is its only sender, publish the Moloni-only example below.
  4. Preserve the final policy: Preserve the existing all mechanism, such as ~all or -all, or the existing redirect= destination. Do not add an all mechanism that disables a policy reached through redirect=.
  5. Publish and wait: Save the TXT change, allow cached DNS answers to expire according to their TTL, and verify the result through public DNS before activation.
Moloni-only SPF recordDNS
example.com. 300 IN TXT ( "v=spf1 ip4:94.46.130.39 ip4:94.46.130.38 ~all" )
These examples use DNS zone-file syntax. In a web DNS editor, select TXT and enter the record name separately. Paste only the joined TXT value, without the owner name, TTL, IN TXT, parentheses, or surrounding zone-file quotes. Use @ for example.com only if your DNS provider uses that notation.
The example is safe only when Moloni is the domain's sole sender. Most business domains already authorize a mailbox platform or another application, so edit the existing SPF value and retain every legitimate sender. The two IPs are published in Moloni's server configuration instructions.
Never publish a second SPF record
Two TXT values beginning with v=spf1 cause SPF PermError. Merge Moloni's two ip4 mechanisms into the existing record instead.
Check the published result after cached answers expire. The lookup should return one SPF record, both Moloni IPs, the intended final all mechanism or redirect= modifier, and no syntax or lookup-limit error. The two ip4 mechanisms do not consume the limit of 10 DNS-lookup-causing SPF terms. Nested include and redirect evaluations still count, as RFC 7208 explains.

SPF checker

Find SPF syntax issues, lookup limits, and weak records.

?/16tests passed
SPF authentication alone does not guarantee DMARC alignment. Inspect a delivered Moloni message and compare its Return-Path domain with the visible From domain. Moloni documents the sending IP authorization, but its published setup does not guarantee an aligned Return-Path. If the Return-Path is provider-owned, editing your From domain's SPF record cannot change that identity, and DMARC needs aligned DKIM. SPF records do not inherit to subdomains: an envelope sender on a subdomain needs authorization at that exact domain.
SPF aligned
  1. IP result: The sending IP is 94.46.130.38 or 94.46.130.39 and SPF passes.
  2. Domain result: The Return-Path and From addresses share the same organizational domain under relaxed alignment. With aspf=s, their full domains must match exactly.
SPF not aligned
  1. Header result: SPF passes for a different Return-Path domain, so DMARC cannot use that result.
  2. Safe fallback: Fully passing, aligned DKIM is enough for DMARC. Do not authorize unrelated IPs to hide an alignment error.

Set up DKIM

  1. Confirm the assignment: Ask Moloni support to confirm that selector dkim and the public key below are still assigned to your custom sender. Keys can rotate.
  2. Create the host: Publish the key as TXT at <selector>._domainkey.<signing-domain> using the values confirmed by Moloni. The example uses s=dkim and d=example.com; the signing domain comes from d=, rather than automatically from the From address.
  3. Paste the value: Use the complete value with no added spaces inside the public key. Quoted chunks in a DNS zone are joined automatically into one TXT record, not published as separate TXT records.
  4. Avoid double suffixes: If the DNS interface appends the zone name, enter only the relative name. For dkim._domainkey.example.com in the example.com zone, that is dkim._domainkey.
  5. Wait for DNS: Allow cached DNS answers to expire and verify the complete public key before enabling the custom Moloni sender.
Confirm the current Moloni key
Moloni's current support material lists this selector and key, including the t=y DKIM testing flag. That flag belongs to the DKIM key record and does not put DMARC into monitoring mode. Confirm the assignment before publishing because a rotated key will produce DKIM failures even when the DNS syntax is correct.
If dkim._domainkey already has another sender's key or a CNAME, do not overwrite it or add a second key there. Ask Moloni support for a compatible signing configuration. DKIM key storage rules require a unique key record for each selector name.
Moloni DKIM TXT recordDNS
dkim._domainkey.example.com. 300 IN TXT ( "v=DKIM1; k=rsa; t=y; " "p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCYs9Oepmx+l9Kx0SGr" "+8wKNsqbqy5bsKEBfeZXaDks0PqWmvQlMGzvqk60thSW2YyCuMQ2rF96" "spCmRmEZT43eRWynuNRAQS9uacTHCQ/D/P9z1Mqu/WFawLh3p+k3JzY" "UeRZMwVg5Ol0nPOVBICbnOX1wJJzY1bmu0HHpGT55uQIDAQAB" )
After publication, send a Moloni invoice to a mailbox where the raw message headers can be viewed. A DNS lookup proves that the key exists, while a signed test message proves that Moloni is using the matching private key.
  1. Check the selector: The DKIM-Signature header should show s=dkim.
  2. Check the domain: Its d= value must satisfy the DMARC adkim setting: the same organizational domain in relaxed mode, or the exact From domain with adkim=s.
  3. Check the result: Authentication-Results should report dkim=pass.
  4. Escalate failures: If no signature is present after DNS is correct, Moloni must enable signing for the account. DNS alone cannot add the signature.

Set up DMARC

  1. Prepare reporting: Create or choose a mailbox that can receive aggregate XML reports, or use the reporting address assigned by Suped. Replace dmarc@example.com with the actual destination.
  2. Check for DMARC: Look up _dmarc.<From-domain> and check any inherited parent policy before adding anything. Publish no more than one DMARC policy TXT record at each name.
  3. Start in monitor mode: If no applicable DMARC policy exists, publish v=DMARC1; p=none; rua=mailto:dmarc@example.com using your real reporting address.
  4. Preserve enforcement: If the sending domain already uses or inherits p=quarantine or p=reject, retain the effective policy and reporting. Do not introduce a p=none subdomain record as a workaround.
  5. Choose the correct name: For billing@example.com, use _dmarc.example.com. For billing@invoices.example.com, a separate policy belongs at _dmarc.invoices.example.com; otherwise, review the inherited parent policy.
Initial DMARC TXT recordDNS
_dmarc.example.com. 300 IN TXT ( "v=DMARC1; p=none; rua=mailto:dmarc@example.com" )
Use Suped's DMARC record generator when the reporting mailbox, subdomain policy, or alignment mode needs to change. Publish the generated value as one TXT record, not as a second DMARC record.
The p=none policy collects evidence without asking receivers to quarantine or reject failures. It does not repair SPF or DKIM, so keep testing Moloni until at least one aligned authentication path passes consistently. Receivers still apply their own spam filtering under p=none, so it does not guarantee delivery.
DMARC defaults to relaxed alignment (aspf=r and adkim=r). For billing@invoices.example.com, a passing signature with d=example.com satisfies relaxed DKIM alignment, but fails strict alignment with adkim=s. Strict SPF alignment with aspf=s similarly requires the exact From domain in the envelope sender. Check the existing settings against RFC 9989 before changing either mode.

DMARC checker

Look up a domain's DMARC record and catch policy issues.

?/7tests passed
Suped's DMARC checker should show one policy record, version DMARC1, the intended policy, and a syntactically valid rua address. Report delivery takes time and does not prove that a specific Moloni message passed alignment.
Existing enforcement stays in place
A domain already on p=quarantine or p=reject should remain there. Authenticate Moloni before enabling its custom sender, then use reports to confirm the new source passes under the existing policy.

Confirm DMARC report delivery

If rua points outside the policy domain's organizational domain, the destination must authorize reports in its DNS. RFC 9990 defines this external reporting authorization. Without it, receivers must ignore that destination.
For a policy at _dmarc.example.com with rua=mailto:reports@reports.example.net, the destination operator publishes this authorization:
External report authorization in the destination DNSDNS
example.com._report._dmarc.reports.example.net. 300 IN TXT "v=DMARC1"
The destination operator publishes this in DNS for reports.example.net. Do not add it to the example.com zone. A reporting service can provide equivalent wildcard authorization; follow the destination's instructions.
  1. Send Moloni test traffic after DNS is visible. Reports depend on a receiving provider that generates them.
  2. Reports are normally daily, not immediate. Allow time for the reporting period and delivery before investigating missing data.
  3. Check that the reporting mailbox accepts compressed XML attachments and that quota or filtering rules are not blocking them.
  4. Use fresh message headers for immediate verification. An empty reporting inbox does not establish that Moloni passed DMARC.

Stage DMARC enforcement without pct

RFC 9989 is the current DMARC specification. It made the pct tag historic because receivers applied percentage sampling inconsistently. Remove pct values such as pct=25 from new or revised records and stage enforcement through deliberate policy changes backed by aggregate reports.

Tag

Status

Operational use

pct
Historic
Remove from revised records
t=y
Current testing tag
Requests quarantine for p=reject, or none for p=quarantine; does not change reporting
No t tag
Default t=n
Requests the published policy
DMARC policy tags under RFC 9989
Do not replace pct with t=y blindly
A receiver using older DMARC rules can ignore the unfamiliar t tag and apply the published p value. For predictable cross-receiver staging, monitor at p=none, move the complete policy to p=quarantine, and use observed results before moving to p=reject. Use t=y only when its receiver behavior is understood.

Verify and troubleshoot

  1. Activate Moloni: Return to Configurações, Empresa, E-mails. Confirm SPF capability, enable custom sending, enter the address, and click Atualizar.
  2. Send a real test: Open Documentos, choose Faturas, select the email icon on a safe test document, enter a mailbox you control, and click Enviar.
  3. Read raw headers: Check Authentication-Results added by the receiving mailbox provider, together with Return-Path, From, and DKIM-Signature. An inbox delivery or a sender-supplied results header is not proof of authentication.
  4. Match the source: For a test sent directly to the recipient, the connecting IP should match a Moloni-authorized IP and the DKIM selector should be dkim, unless Moloni confirms a different assignment. Forwarded mail will show the forwarding server's IP instead.
  5. Require DMARC pass: The header should report dmarc=pass through aligned SPF, aligned DKIM, or both.
Inbox placement is not an authentication test. A message can arrive while SPF alignment fails, and it can be filtered even when every authentication result passes.
Moloni invoice email dialog used to send an authentication test
Moloni invoice email dialog used to send an authentication test
Send the test to an address where the complete original message can be retrieved. Keep the raw headers and the UTC send time so Moloni support can trace the event if signing or return-path configuration is missing. Establish a direct-delivery baseline before testing forwarding. Forwarding often breaks SPF; an intact, aligned DKIM signature can still preserve DMARC pass.
Suped's email tester provides an end-to-end check. Send a Moloni document to the generated test address, then review authentication and alignment alongside the message findings.

Email tester

Send a real email to this address. Suped shows a results button when the test is ready.

?/43tests passed
Use the result to separate DNS problems from Moloni account problems. SPF PermError or missing DNS belongs in the DNS zone. A missing DKIM-Signature after the public key resolves belongs with Moloni support.

Check

Expected

Fix

SPF
Pass; aligned if used for DMARC
Check both IPs at the envelope sender domain
DKIM
Pass; aligned if used for DMARC
Check selector, signing domain, key, and activation
DMARC
Pass
Fix one aligned path
DNS
One SPF record per domain, one DMARC policy per name, one DKIM key per selector
Remove conflicting records; retain unrelated TXT records
Expected authentication results for a Moloni custom sender
Do not chase SPF alignment blindly
Some sending paths keep a provider-owned Return-Path. In that case, SPF can pass for a domain unrelated to the visible From address and DMARC can still pass through aligned DKIM. For Moloni custom sending, check the Return-Path in a received message, but treat a fully passing aligned DKIM result as sufficient.

Monitor Moloni authentication failures

  1. Route aggregate reports: Send DMARC rua data to a reporting platform that parses XML and groups results by source.
  2. Watch both IPs: Track 94.46.130.38 and 94.46.130.39 separately so a failure on one Moloni server is visible.
  3. Alert on changes: Set alerts for rising DMARC failures and review unexpected sources. If selector dkim stops appearing in reports, compare fresh message headers with DNS rather than assuming that the key was deleted.
  4. Correlate reputation: Check domain and IP blocklist (blacklist) status alongside authentication rather than investigating each signal in isolation.
  5. Assign the fix: Give the DNS owner the failed mechanism, affected source, first-seen time, and exact correction.
Suped's DMARC monitoring parses aggregate XML and groups sending sources so you can set failure thresholds. For Moloni, review both documented IPs alongside the DKIM signing domain and selector, then investigate unexpected combinations before trusting them. An IP match alone does not establish that a message is authorized to use your domain.

Move to p=reject after verification

  1. Inventory every source: Identify all legitimate senders in DMARC data, including Moloni's two IPs, before changing policy.
  2. Fix alignment: Require each legitimate source to pass DMARC through aligned SPF, aligned DKIM, or both.
  3. Cover subdomains: List sending subdomains and check their explicit DMARC records. For subdomains without their own policy, review sp= at the organizational domain; if it is absent, p= normally applies.
  4. Enforce quarantine: Move the complete policy to p=quarantine, review aggregate data and legitimate failures, then correct every approved source that still fails.
  5. Enforce rejection: Publish p=reject when all known legitimate sources pass and new-source alerts are active.
  6. Never step backward: If the domain already has quarantine or reject, keep it and repair Moloni before enabling the custom sender.
Staged DMARC policy values (replace the existing value)DNS
# Monitor "v=DMARC1; p=none; rua=mailto:dmarc@example.com" # Enforce quarantine "v=DMARC1; p=quarantine; rua=mailto:dmarc@example.com" # Enforce rejection "v=DMARC1; p=reject; rua=mailto:dmarc@example.com"
These values are alternatives for one DMARC TXT record; publish only the current stage. Policy staging should follow observed sources rather than a calendar alone. A quiet week can miss monthly invoices, scheduled notices, or low-volume applications. For a new deployment, keep p=none until a complete sending cycle has been reviewed; retain any existing quarantine or reject policy while adding Moloni. Do not rely on pct or assume t=y will produce identical handling at every receiver.
Ready for p=reject
  1. Known mail: Every legitimate source is identified and has an owner.
  2. Moloni result: Repeated invoice tests show dmarc=pass.
  3. Operations: Failure and new-source alerts reach a responsible person.
  4. Coverage: Subdomain behavior and inactive senders are documented.
Not ready for p=reject
  1. Unknown volume: Unverified sources still send meaningful mail.
  2. Moloni result: DKIM is unsigned or both aligned paths fail.
  3. Reports: Aggregate data is unread or is not reviewed.
  4. Ownership: No person can change DNS or contact Moloni support quickly.
Suped's Hosted DMARC supports controlled policy changes without repeated direct TXT edits. Its issue detection shows which Moloni authentication path still fails, while alerts catch regressions after p=reject is active.

Frequently asked questions

Yes. Moloni documents 94.46.130.38 and 94.46.130.39 for SPF and selector dkim with a public key for DKIM. You manage DMARC for your From domain and verify that at least one passing authentication result satisfies its alignment rules.

Moloni documents both IP addresses as outbound mail servers for its custom sender option. PTR or rDNS hostnames can change, so confirm the source by matching the connecting IP, selector dkim, visible From domain, and send time.

Yes. DMARC needs one aligned authentication path. If SPF passes for a non-aligned Return-Path, an aligned dkim=pass result still produces dmarc=pass.

Do not add a second SPF record at the same domain. Add Moloni's two ip4 mechanisms to the existing policy and retain every other legitimate sender. Separate subdomains have their own SPF records, so confirm the exact envelope sender domain before editing DNS.

Common causes include a duplicated domain suffix, a truncated or outdated key, a selector conflict, or Moloni not signing the account's messages. Check s=dkim and d= in a fresh message before changing DNS again. Do not overwrite another sender's existing selector key.

Move to p=reject after every legitimate source is identified, Moloni repeatedly passes DMARC, subdomain behavior is documented, and failure alerts are active. Under RFC 9989, pct is historic, so stage through complete p=none and p=quarantine policies instead of percentage sampling. If the domain already uses p=reject, keep it and authenticate Moloni before enabling custom sending.
DMARC monitoring

Start monitoring your DMARC reports today

Suped DMARC platform dashboard
What you'll get with Suped
Real-time DMARC report monitoring and analysis
Automated alerts for authentication failures
Clear recommendations to improve email deliverability
Protection against phishing and domain spoofing