- Table of contents
- 01 Email Description
- 02 Incoming email gateway (parsing)
- 03 Outgoing notifications
- 04 SMTP connection settings
- 05 Notification settings in EDI-Web
- 06 Which sender address is used
- 07 Test and support
01 Email Description¶
- Email is one of the transmission channels Docura uses to exchange business documents with partners. Two independent mechanisms are involved:
- Incoming - a mailbox on the Docura mail server where partners send documents for automatic parsing and delivery into Docura (section 02).
- Outgoing - notifications that Docura sends to partners when a document is received or sent, with the document itself as an attachment (section 03).
- Email is convenient because the partner needs no EDI software, no FTP account and no certificates - a mailbox is enough. This makes email the fastest way to connect a counterparty that has no EDI at all.
- The weak points of email are deliverability (SPF, DKIM and DMARC of the sender domain, see section 06) and the fact that mail clients compose letters in very different ways (see section 02).
02 Incoming email gateway (parsing)¶
- For incoming documents Docura creates a mailbox on its own mail server, in the domain @edi.docura.net. The mailbox is created by Docura support in the mail server admin panel - the sender only needs to know the address.
- Naming is agreed with Docura support. Typical patterns:
- companyname@edi.docura.net - the standard case, one gateway per counterparty. The company name is written without spaces and short readable abbreviations are fine (for example ep@ for Eesti Pagar).
- companyname.country@edi.docura.net - when several countries or formats are involved, for example fristar.lv@edi.docura.net
- companyname.doctype@edi.docura.net - when document types are handled separately, for example wolt.ee.aperak@edi.docura.net
- The mailbox is monitored: Docura periodically collects the letters, extracts the content, converts it into the agreed format and delivers the document into the client's Docura environment. This also works for counterparties that do not want a real EDI connection at all - sometimes called "blind" EDI.
- There is no strict rule about the letter itself - the sender does not have to send one document per letter:
- A letter may contain several documents, or a single archive (for example zip) with many files inside - everything is picked up and processed.
- What has to match is the agreed document layout and format, not the number of files per letter.
- Content that can be parsed:
- Excel price lists - loaded as PRODUCTCATALOG / PRICAT (the layout is agreed in advance)
- XML documents - Docura XML or another agreed format (INVOICE, ORDER, DESADV and others)
- Other formats by agreement - EDIFACT, CSV, Telema/Edisoft XML
- Two modes of taking the document out of the letter (chosen per relation together with Docura support):
- Attachment - all attachments of the letter are taken one by one and each one is processed. This is the usual mode.
- Body - the whole letter is converted into XML and processed. Used when the data sits in the letter text rather than in a file.
- Filters decide what is accepted and what is ignored. They are configured by Docura on the relation:
- Sender filter (regular expression) - accept letters only from an agreed address mask.
- Subject filter (regular expression) - accept letters only with a matching subject.
- File name filter (regular expression, for example
(?i)(.*)(.xls|.xlsx)) together with the file filter type (for exampleError without notification). This exists because senders often add logos, pictures and signatures, while every attachment is processed - the filter cuts such files off.
- So the sender needs no special discipline: it is enough to send to the agreed address, and the odd extra file will simply be filtered out instead of breaking the parsing.
- What does not pass the filters is not lost: where the relation is configured that way, the letter is forwarded unchanged to the error address, with the original From and To moved into the subject (otherwise such a letter would end up in spam).
- The original letter can also be forwarded to the client (
Copy email) - used when free-format letters have to be seen by a human. - A working example is Fristar_SIA: the address fristar.lv@edi.docura.net accepts price lists (Excel) and XML invoices, and the page describes the whole flow from the partner's side.
- The gateway is not meant for mass mailings: the receive rate is limited (about 150 letters per minute). Above that the letters go to the reject log and the sender is blocked for 24 hours. Bulk exchange is done over FTP or API.
03 Outgoing notifications¶
- Outgoing letters are notifications about documents. A notification is configured per relation: document type, document status, direction and partner, so one organization may have several notifications with different settings.
- Recipients are collected from several sources:
To- the receiver e-mail taken from the document itself (Document-Invoice/Document-Parties/Receiver/E-mail)- plus any addresses listed explicitly in the notification
- plus, for some partners, addresses taken from the receiver LOCCAT - used when one invoice must be delivered to many shops or delivery points
Reply-tois taken from the sender e-mail in the document (Document-Invoice/Document-Parties/Sender/E-mail), so the partner's answer reaches the right person.- The letter body is built by an XSLT template (
Email xslt), and the document can be attached as a file. - By default all notifications are sent from the Docura domain: docuway@docura.net.
04 SMTP connection settings¶
An SMTP connection is the stored set of credentials that tells Docura which mailbox and which server to use for sending. It is created and maintained in the Docura web application (tab Notifications, window Update smtp connection):
| Field | Meaning |
|---|---|
Description |
Free comment, usually the mail server name |
serverName |
SMTP server host of the sender mailbox |
serverPort |
SMTP port, usually 25, 465 or 587 |
Username |
The mailbox login, i.e. the address the mail is really sent from |
User password |
Password of that mailbox |
Connection security |
Encryption mode, usually SSL_TLS |
- The button
Test connectionverifies the saved credentials before the notification is switched over. - An SMTP connection can also be created through the API (operation
createSmtpConnection):organizationId,description,fromName,serverName,serverPort,userName,userPassword,connectionSecurity.
05 Notification settings in EDI-Web¶
Sender addresses are not global - they are set on the notification itself: Notifications - Edit, tab Notification information.
| Field | Meaning |
|---|---|
Email |
Recipient address(es) of the notification |
From name (name <email>) |
The address the notification is sent FROM |
Reply to (name <email>) |
The address the partner's answer will go to |
Partner |
Partner organization the notification belongs to |
Smtp connection |
Which SMTP connection (mailbox) is used for sending |
Email xslt |
XSLT template that builds the letter body |
Enabled |
Enabled / disabled |
- The tab SMTP shows the connection used by this notification, the tab XSLT shows the template.
- Recipients that are not in the document itself can be added additionally in the notification, see section 03.
06 Which sender address is used¶
- Default: the Docura domain. From = docuway@docura.net, Reply to = the client's address. Deliverability is guaranteed, because the Docura domain has correct SPF, DKIM, DMARC and PTR records. This covers most cases and is the recommended setup.
- From = the client's own domain. Two options:
- Through the client's own mail server - the client's SMTP server, login and password are stored as the SMTP connection. SPF and DKIM of the client domain pass, because the mail is really sent by their server. This is the safest option for a client From.
- Through the Docura mail server, keeping the client's address in From. Then the client's DNS must be prepared first, otherwise such letters go to spam or are rejected:
TXT mail._domainkey "v=DKIM1; k=rsa; p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAq4dvMit/5L1okysL1nzm3d+qsl1XYeEg8sUzuBHSWRzX8UQ2Xai6cYukmBU7N4Brn69+1xc8DbdUwlP1mpiYhf2qTK7yaYjZTnfyyyumTCFhkHGDfJmga6p2JsOIUQ5dFhlE4gQBUI4FY3a3XZM2gbUVTr08dGkpEJA3yrsbJ5akl88tJsvX4Osw1EJl6i9dn" "1yzX+VxFlD6imjDDgYvyu2sxzWhU6dGtvg7KsP+8x0mXXp9gGFT/odo5zbLjmD0VT9KMWNwRUlBAsOT7bCJgauEXk9ygSnCazZ5UpmGgKfPuXIEXGTEUzRSblTNqKsUjGZtdiWxBo2FXPqnT+AIPwIDAQAB" TXT @ "v=spf1 ip4:78.46.44.41 ip4:78.46.44.49 ip4:178.63.30.140 a mx ~all" TXT _dmarc "v=DMARC1;p=none"
01 Through Docura, keeping the client's address in From. DNS¶
DNS records for a client From (SPF, DKIM, DMARC). Needed only for option 2.2 above. All three are TXT records on the same domain that is used in From - @@ means the root of that domain, not a subdomain.
01 SPF¶
Only one SPF record is allowed per domain. If you already have one, do not create a second - add the Docura addresses to the existing record, keeping everything that is already there.
TXT @ "v=spf1 ip4:78.46.44.41 ip4:78.46.44.49 ip4:178.63.30.140 a mx ~all"
~all is the soft mode - mail from other addresses is marked as suspicious but delivered. -all rejects it, so with -all every sender of the domain must be listed.
02 DKIM¶
A new record, it replaces nothing. mail is the selector, so other services signing mail for your domain are not affected.
TXT mail._domainkey "v=DKIM1; k=rsa; p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAq4dvMit/5L1okysL1nzm3d+qsl1XYeEg8sUzuBHSWRzX8UQ2Xai6cYukmBU7N4Brn69+1xc8DbdUwlP1mpiYhf2qTK7yaYjZTnfyyyumTCFhkHGDfJmga6p2JsOIUQ5dFhlE4gQBUI4FY3a3XZM2gbUVTr08dGkpEJA3yrsbJ5akl88tJsvX4Osw1EJl6i9dn" "1yzX+VxFlD6imjDDgYvyu2sxzWhU6dGtvg7KsP+8x0mXXp9gGFT/odo5zbLjmD0VT9KMWNwRUlBAsOT7bCJgauEXk9ygSnCazZ5UpmGgKfPuXIEXGTEUzRSblTNqKsUjGZtdiWxBo2FXPqnT+AIPwIDAQAB"
Two quoted strings because one TXT string cannot exceed 255 characters - DNS joins them when read.
03 DMARC¶
Only one DMARC record is allowed per domain. If you already have one, leave it as it is. The record below is only for domains that have none.
TXT _dmarc "v=DMARC1;p=none"
04 PTR and HELO¶
Belong to the Docura sending servers, not to your domain. Maintained by Docura, nothing to do on your side.
05 After adding¶
DNS changes take from a few minutes up to 24 hours depending on the TTL. When the records are visible, ask Docura support for a test letter, see section 07. Until it passes, keep sending from the Docura domain.
07 Test and support¶
- Ask Docura support to send a test letter to the client's address and check the raw headers (
From,Reply-to, SPF/DKIM/DMARC result). - For the incoming gateway, send one order or invoice (a normal letter, with whatever extra files your mail client adds) to the edi.docura.net address and ask support to confirm that it was parsed correctly.
- Write to support@docura.net or use the chat in EDI-Web for any question on gateway mailboxes, filters, sender addresses and DNS records.