Inbox to AbraFlexi invoice importer
Find a file
2026-03-23 02:34:35 +01:00
.github Add exit code definitions to application schema 2025-11-20 23:08:07 +01:00
bin Update dependencies, improve PHP version support, and enhance import functionality 2025-05-02 13:36:59 +02:00
debian fix: remove unused composer.json.bak and update install rules for autoload.php 2026-03-23 02:34:35 +01:00
doc Migrace na Debian PHP autoloader systém 2026-03-03 23:31:42 +01:00
i18n v1.0.0 release 2024-02-18 00:12:55 +01:00
multiflexi Refactor configuration files and update application schemas for improved structure and functionality 2026-01-26 23:55:54 +01:00
nbproject build deps update 2025-08-26 19:12:55 +02:00
src Refactor invoice item conversion and enhance error handling in Mailboxer 2025-05-15 09:22:30 +02:00
tests Migrace na Debian PHP autoloader systém 2026-03-03 23:31:42 +01:00
.env-pure Migrace na Debian PHP autoloader systém 2026-03-03 23:31:42 +01:00
.gitignore Update .gitignore and enhance WARP.md; modify Jenkinsfiles and control files for improved packaging and dependencies; localize app.json files for better user experience 2025-11-30 01:12:19 +01:00
.php-cs-fixer.dist.php Update dependencies, improve PHP version support, and enhance import functionality 2025-05-02 13:36:59 +02:00
abraflexi-imap-import.svg v1.1.0 release 2024-11-17 16:13:52 +01:00
composer.json composer: update friendsofphp/php-cs-fixer requirement (#25) 2026-01-27 01:01:19 +01:00
Containerfile Containerized 2023-12-22 11:05:27 +01:00
isdoc.png Migrace na Debian PHP autoloader systém 2026-03-03 23:31:42 +01:00
isdoc.webp Migrace na Debian PHP autoloader systém 2026-03-03 23:31:42 +01:00
LICENSE Initial commit 2020-09-04 11:47:17 +02:00
Makefile v1.1.0 release 2024-11-17 16:13:52 +01:00
phpstan-default-baseline.neon v1.1.0 release 2024-11-17 16:13:52 +01:00
phpstan-default.neon.dist v1.1.0 release 2024-11-17 16:13:52 +01:00
phpunit.xml Initial tests added 2020-12-03 00:33:25 +01:00
README.md Add exit code definitions to application schema 2025-11-20 23:08:07 +01:00
social-preview.svg v1.1.0 release 2024-11-17 16:13:52 +01:00
WARP.md Update .gitignore and enhance WARP.md; modify Jenkinsfiles and control files for improved packaging and dependencies; localize app.json files for better user experience 2025-11-30 01:12:19 +01:00

AbraFlexi Email Importer

Logo

Tool for importing ISDOC/ISDOCx invoice files from IMAP email attachments into AbraFlexi accounting system.

Features:

  • Automatically monitors IMAP mailbox for new invoices
  • Supports both ISDOC and ISDOCx file formats
  • Creates new entries in Address Book for unknown suppliers
  • Creates new entries in Price List for unknown items
  • Handles storage moves and inventory management
  • Moves processed emails to designated folder
  • Comprehensive logging and result reporting
  • MultiFlexi platform ready

time tracker

Configuration

Constants/Environment variables to set:

IMAP Configuration

export IMAP_SERVER="your.imap.server.com"    # IMAP server hostname
export IMAP_PORT=993                          # IMAP server port (integer)
export IMAP_LOGIN="your.email@domain.com"    # IMAP login/email
export IMAP_PASSWORD="your_password"         # IMAP password
export IMAP_MAILBOX="INBOX"                  # IMAP mailbox to monitor
export IMAP_OPTIONS="imap/ssl"               # IMAP connection options

AbraFlexi Configuration

export ABRAFLEXI_URL="https://demo.flexibee.eu:5434"  # AbraFlexi server URL
export ABRAFLEXI_LOGIN="winstrom"                     # AbraFlexi username
export ABRAFLEXI_PASSWORD="winstrom"                  # AbraFlexi password
export ABRAFLEXI_COMPANY="demo_de"                    # AbraFlexi company database
export ABRAFLEXI_STORAGE="SKLAD"                      # Default storage code
export ABRAFLEXI_DOCTYPE="FAKTURA"                    # Document type code

Processing Configuration

export DONE_FOLDER="ImportedInvoices"        # Move processed emails here
export RESULT_FILE="result.txt"              # File with import results
export EASE_LOGGER="imap2abraflexi.log"      # Log file name

Optional Filters

export ACCEPT_PROVIDER_IDS="ico1,ico2,ico3"  # Always accept invoices from these IDs
export DENY_PROVIDER_IDS="icoA,icoB,icoC"    # Always deny invoices from these IDs

Environment Variable Details:

  • IMAP_PORT - Must be an integer (e.g., 993 for SSL, 143 for standard)
  • ABRAFLEXI_STORAGE - Code of default storage for imported items
  • ABRAFLEXI_DOCTYPE - Code of the document type for received invoices
  • DONE_FOLDER - IMAP folder where processed emails are moved
  • RESULT_FILE - File path where import results are logged
  • ACCEPT_PROVIDER_IDS - Comma-separated list of provider IDs to always accept
  • DENY_PROVIDER_IDS - Comma-separated list of provider IDs to always deny

IMAP options are described here: https://www.php.net/manual/en/function.imap-open.php

You can also create file /etc/profile.d/abraflexi-email-importer.sh with export definitions to be ready system-wide.

Requirements

System Requirements

  • PHP 8.1 or higher
  • IMAP extension
  • ZIP extension
  • Access to AbraFlexi server

Supported File Formats

  • ISDOC (.isdoc) - XML-based invoice format
  • ISDOCx (.isdocx) - Compressed ISDOC format with attachments

Email Processing

  • Monitors specified IMAP mailbox for new emails
  • Extracts ISDOC/ISDOCx attachments from emails
  • Processes invoices and imports them to AbraFlexi
  • Moves processed emails to designated folder

Command Line Usage

Usage

Command Line Usage

Run the email importer manually:

bin/imap2abraflexi

Import a specific ISDOC file:

bin/isdoc2abraflexi /path/to/invoice.isdoc

Automated Usage

For periodic imports, set up a cron job:

# Check for new invoices every 15 minutes
*/15 * * * * /usr/bin/imap2abraflexi

MultiFlexi Usage

When deployed via MultiFlexi, the application can be configured through the web interface with all necessary environment variables.

Supported by

MultiFlexi

AbraFlexi Email importer is ready to run as MultiFlexi application. The application includes two MultiFlexi configurations:

  1. Email Importer (isdoc_email_importer) - Imports ISDOC files from IMAP mailbox
  2. File Importer (isdoc_file_importer) - Imports individual ISDOC files

Both configurations are fully compliant with MultiFlexi application schema v1.19.

See the full list of ready-to-run applications within the MultiFlexi platform on the application list page.

MultiFlexi App

Installation

Method 1) for developers:

git clone git@github.com:VitexSoftware/AbraFlexi-email-importer.git
cd AbraFlexi-email-importer.git
composer install

Method 2) for users:

wget https://github.com/VitexSoftware/AbraFlexi-email-importer/archive/main.zip
unzip AbraFlexi-email-importer-main.zip
cd AbraFlexi-email-importer-main
composer.phar install

Method 3) For admins. Debian and Ubuntu based distros can use our repository to install latest version by this commands:

sudo apt install lsb-release wget
echo "deb http://repo.vitexsoftware.cz $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/vitexsoftware.list
sudo wget -O /etc/apt/trusted.gpg.d/vitexsoftware.gpg http://repo.vitexsoftware.cz/keyring.gpg
sudo apt update
sudo apt install abraflexi-email-importer

Exit Codes

This application uses the following exit codes:

  • 0: Success
  • 1: General error