DocumentationGetting started

Connecting a mailbox

Connect the mailbox your suppliers send invoices to, for example invoices@ or accounts@. Vierkant then picks up the invoices itself and, if you want, tidies up the rest of the mail too. You can connect a Microsoft 365 mailbox or any other mailbox via IMAP, including Gmail and Google Workspace.

How it works

On the Connections tab, in the Mailbox for invoices block, you choose one of two ways:

  • Microsoft 365 / Outlook: you enter the mailbox's email address and sign in with Microsoft. There, someone with admin rights in Microsoft gives consent for your organisation. Vierkant only reads the mailboxes you connect. By default, though, the consent in Microsoft applies to all mailboxes of the organisation; your IT admin can restrict it (see Restricting access).
  • Gmail or other (IMAP): you enter the server, port, username and password. For Gmail, Google Workspace and other services with two-step verification, use an app password, not your normal password.

Passwords go encrypted into a separate vault. Nobody can see them in the app afterwards. For IMAP on port 993, Vierkant immediately tests whether logging in and opening the folder works; if not, you see why and nothing is saved.

Both ways support everything Vierkant does with mail: picking up invoices, filing mail in folders and forwarding.

Setting up

Microsoft 365 / Outlook

  1. Go to Settings → Connections and choose Microsoft 365 / Outlook.
  2. Under Mailbox where invoices arrive, enter the address, for example invoices@yourcompany.com.
  3. Choose Connect Microsoft 365.
  4. Sign in with Microsoft. Someone with admin rights in Microsoft has to give consent. If that isn't you, ask your IT admin to do this step.
  5. You return to Vierkant with Connection successful.

Gmail, Google Workspace or another mailbox (IMAP)

  1. Go to Settings → Connections and choose Gmail or other (IMAP).
  2. Using Gmail, Hostinger, KPN, TransIP or Zoho? Pick it under Quick fill. Server and port are filled in.
  3. Otherwise, enter your mail provider's details under Server (IMAP) and Port. Port 993 is the secure default.
  4. Enter Username (usually the email address) and Password or app password.
  5. Leave Folder at INBOX, or enter the folder where invoices arrive.
  6. Choose Connect mailbox. Vierkant tests the connection. If it works, you see Mailbox connected. Logging in and opening the folder worked. If not, you see what went wrong (server unreachable, login rejected or unknown folder).

Gmail

You connect Gmail and Google Workspace via IMAP with an app password, not the normal password.

  1. Turn on 2-Step Verification in the mailbox's Google account (Google Account → Security).
  2. Create an app password. Google explains how in Sign in with app passwords.
  3. In Vierkant choose Gmail or other (IMAP), click Gmail under Quick fill, enter the address and the app password and choose Connect mailbox.

No app password option for a Google Workspace address? Then the Google Workspace admin has turned them off. Ask the admin to allow them, or use the submission address.

More mailboxes

Do invoices arrive at more than one address, for example invoices@ and purchasing@? Choose Connect another mailbox. You can connect up to 5 mailboxes per company; Vierkant reads them all. An extra mailbox in the same Microsoft environment connects without asking for consent again. Disconnect … removes one mailbox.

If the same email arrives in two mailboxes (for example in cc), Vierkant makes one invoice from it. The copy is tidied up like the original: into the same folder when Mailbox cleanup is Live, but never forwarded again. Each invoice shows which mailbox it arrived in.

Restricting access

With Microsoft 365, the consent you give applies to all mailboxes of the organisation by default. Vierkant only reads the connected mailboxes, but if your IT admin wants to enforce that in Microsoft too, it can be done with Exchange Online (PowerShell). Microsoft recommends RBAC for Applications:

  1. In Microsoft Entra, find Vierkant's app under Enterprise applications and note the Application ID and Object ID.
  2. Create a service principal in Exchange Online: New-ServicePrincipal -AppId <Application ID> -ObjectId <Object ID> -DisplayName "Vierkant".
  3. Create a scope for the mailbox: New-ManagementScope -Name "Vierkant-invoices" -RecipientRestrictionFilter "PrimarySmtpAddress -eq 'invoices@yourcompany.com'".
  4. Assign the roles within that scope: New-ManagementRoleAssignment -App <Object ID> -Role "Application Mail.ReadWrite" -CustomResourceScope "Vierkant-invoices", and the same with "Application Mail.Send" (needed for forwarding).
  5. Then remove the organisation-wide consent for Mail.ReadWrite and Mail.Send from the app in Entra. That consent adds up with the scope; as long as it's there, it applies to all mailboxes.
  6. Check with Test-ServicePrincipalAuthorization -Identity "Vierkant" -Resource invoices@yourcompany.com.

It can take 30 minutes to 2 hours before the restriction applies. Test first, before removing the organisation-wide consent. If you later connect an extra mailbox, add it to the scope as well. More: RBAC for Applications in Exchange Online.

Example

Verhoef Accountants receive invoices for their client Groen Gardening at invoices@groengardening.example, a Google Workspace address. The owner creates an app password in his Google account. You choose Gmail or other (IMAP), click Gmail under Quick fill, enter the address and the app password and choose Connect mailbox. After the next run, the mailbox shows Active and the first invoices appear in Vierkant.

Good to know

  • There is no separate button to sign in with Google for Gmail and Google Workspace. You connect them via IMAP with an app password.
  • The Connect Microsoft 365 button is for business Microsoft 365 accounts, where an admin gives consent. Connect any other mailbox via IMAP.
  • You can connect up to 5 mailboxes per company. Connecting the same address again updates the existing connection.
  • Personal Outlook.com and Hotmail addresses can't be connected: the Microsoft button is for business accounts, and Microsoft no longer allows IMAP sign-in with a password for those addresses. Use the submission address instead.
  • What Vierkant does with the rest of the mail (leave it, file it in folders, forward it) is set under Settings → Mail. Mail is only moved once Mailbox cleanup is set to Live in the live status. Vierkant never deletes mail.
  • Only the organisation's admin can connect, and only if the subscription includes Self-service connections (mail and accounting). Otherwise the Vierkant team sets it up with you.
  • Not connecting a mailbox? Forward invoices to the submission address instead.

See also

Questions? support@vierkantboekhouden.nl