Git Product home page Git Product logo

agentj's Introduction

AgentJ dockerized repository

This is the Docker stack to set up a fully functional AgentJ antispam system at a glance.

Introduction

The AgentJ Docker stack is composed of the following services:

  • db: a MariaDB instance, it keeps track of the mail headers and other information needed to manage the e-mails life cycle (sender, recipient, amavis id, ...)
  • app: a Web UI that allows you to add and manage your domains and associated users as well as managing the incoming e-mails (block, release, white/black lists)
  • smtp: a Postfix instance that will receive the e-mails and forward them to the amavis container (Amavis/ClamAV/Spamassassin service)
  • amavis: a container running Amavis/Spamassassin and ClamAV services
  • logspout + syslogng: a Syslog-NG instance that will collect and centralize logs from the other containers
  • relay: an other Postfix instance, needed to avoid loops when forwarding the released or white-listed e-mails to their recipients(s)

Get the sources

All you have to do is to clone the repository

git clone https://github.com/Probesys/agentj.git

then, cd to the cloned repository to configure a few variables:

cd agentj

Configure

Variables

Variables are defined in the .env.example. This file is just a template, you must copy and rename it to .env:

cp .env.example .env

Then the following runtime variables must be configured in the .env file:

Variable Default Use
VERSION this AgentJ latest prod version
COMPOSE_PROJECT_NAME local this AgentJ instance name
DB_ROOT_PASSWORD secret the MariaDB instance root password
DB_NAME agentj the AgentJ database name
DB_USER agentj the AgentJ database user name
DB_PASSWORD secret the AgentJ database password
IPV4_NETWORK 172.42.42 the AgentJ Docker default network
MAIL_HOSTNAME aj.example.com the mailname used in postfix configuration
MAIL_DOMAINNAME example.com the domain name used in relay configuration
SUPER_ADMIN_USERNAME admin default super admin login
SUPER_ADMIN_PASSWORD Sup3rZECR37 default super admin password
TZ Europe/Paris the containers default timezone
PROXY_PORT 8090 default listening port for web interface
PROXY_LISTEN_ADDR 127.0.0.1 default listening address for web interface
SMTP_PORT 25 default listening port for smtp server
SMTP_LISTEN_ADDR 0.0.0.0 default listening address for smtp server
OAUTH_AZURE_CLIENT_SECRET secret client secret if using Azure auth
OAUTH_AZURE_CLIENT_ID secret client ID if using Azure auth
ENABLE_AZURE_OAUTH false enable Azure OAuth
TRUSTED_PROXIES 172.24.42.1 default stack gateway
CLAMAV_AUTOSTART true use the ClamAV instance of this stack
CLAMAV_TCPADDRESS 0.0.0.0 remote ClamAV server IP address
CLAMAV_TCPPORT 3310 remote ClamAV server TCP port

Network

The AgentJ antispam stack has its own Docker bridge and IPv4 subnet which defaults to 172.24.42.0/24 (configurable, see variables table above).

Use

It is not recommended to launch the stack as root. We recommend you to create a dedicated docker user (make sure it belongs to the docker group). After you have set the above variables, you can start the stack with following commands:

docker-compose up -d

The Web UI will be available at http://hostname:8090. The default login is admin and the default password is Sup3rZECR37.

Details

Volumes

When started, the AgentJ stack will create the following volumes:

  • amavis : the Amavis databases
  • applogs : the application logs (cron tasks)
  • clamav : the ClamAV signatures database
  • db : the MariaDB databases files
  • logs: the log files from all containers, centralized by the syslogng container
  • opendkim : DKIM signature and conf files
  • postqueue : the mail queue

Communication matrix

from ↓ \ to → amavis app db relay smtp syslog
amavis (10024/tcp) - - ? → 3306/tcp - ? → 10025/tcp ? → 514/udp
app (8090/tcp) ? → 9998/tcp - ? → 3306/tcp ??? ? → 514/udp -
db (3306/tcp) - - - - - ? → 514/udp
relay 25/tcp) - - - - - ? → 514/udp
stmp (25/tcp 10025/tcp) ? → 10024/tcp - ? → 3306/tcp ? → 25/tcp ? → 514/udp -
syslogng (514/udp) - - - - - ? → 514/udp

Upgrade

Please read the dedicated documentation as well as releases notes before upgrading.

Generally speaking, the upgrade processes consists in the following:

docker-compose down
# Change VERSION variable in your `.env` file
docker-compose up -d

About

License

This work is made available under the GNU Affero General Public License v3.0.

Development

AgentJ is a Probesys project.

agentj's People

Contributors

ctresvaux avatar ctresvauxp6 avatar dependabot[bot] avatar felag avatar sjpp avatar weblate avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

agentj's Issues

Ability to install AgentJ without Docker

Hello,

I think everything is in the title ;) . The purpose is to be able to plug AgentJ to an existing Mail/MTA infra .
If so, is there a documentation ?

Regards,

Email passed and filtered at the same time (schrodinger email)

Hi there,

I had an issue with AgentJ passing email when it should filter them. You fixed it today thanks! As requested, this issue for the followup.

Alice send an email to Bob
1- Bob receives the email
2- Alice receives the captcha email
3- Alice validated the captcha
4- Bob receives again the email

I've been playing with the configuration and probably this was the sequence which created the problem :

  • After installing AgentJ with docker
  • Setting the domain with parameter "All all emails"+"Pas de censure"
  • Declaration of an email user
  • Changing the domain policy from "All all emails"+"Pas de censure" to "Block all mails"+"Normale"

Thanks again !

docker agentj-smtp-1 can't Start

Hello
I made a Fresh install on a Fresh server
I made :
git clone https://github.com/Probesys/agentj.git
cd agentj
Edit the file .env with my information
docker compose up -d

All docker are running except :
ca832d0e5aa5 probesys38/agentj_smtp:1.6.3 "/entrypoint.sh supe…" 41 seconds ago Restarting (1) 11 seconds ago agentj-smtp-1

If a look the logs :

docker logs agentj-smtp-1

chown: cannot access '/var/spool/postfix/hold': No such file or directory
chown: cannot access '/var/spool/postfix/hold': No such file or directory
chown: cannot access '/var/spool/postfix/hold': No such file or directory

for information I use the version : VERSION=1.6.3

Someone get an Idea ?

Where to configure variables ??

Hello,
1° ) " All you have to do is to clone the repository

git clone https://github.com/Probesys/agentj.git

then, cd to the cloned repository to configure a few variables:
" # cd agentj-docker" should be replaced by "cd agentj"
2°) where can we change variables, seems that a "something.env" is missing.

Anyway, thanks, you have done a great job.

M365 connector with mail different from userPrincipalName

When M365 is used, it happens that mail and userPrincipalName attributes are different.

It would be nice that, after a connector to M365 is added to a domain in AgentJ, clicking Import button makes following steps:

  1. Import M365 mail as AgentJ account
  2. Link M365 userPrincipalName to AgentJ account to allow Microsoft auth at login
  3. Import M365 proxyAdresses as AgentJ aliases, only for M365 proxyAdresses of same domain as connector
  4. Import M365 groups as AgentJ groups, only for M365 groups of same domain as connector. Then import M365 group members as AgentJ group members

Relayhost definition on .env configuration file

Hello,

Would it be possible to define a relayhost from the .env configuration file ?
I installed agentj on a server with a bad reputation IP, and I had to change the relayhost to something more compatible with the gafam.
So I change the configuration on the postfix docker manually. It will probably be erase at the next update.

My changes on the probesys38/agentj_relay :

cat /etc/postfix/sasl_passwd
server.example.com:465 [email protected]:Mot.De,Passe

cat /etc/postfix/main.cf
[...]
relayhost = server.example.com:465
smtp_sasl_auth_enable   = yes
smtp_sasl_password_maps = texthash:/etc/postfix/sasl_passwd
smtp_sasl_security_options = noanonymous
smtp_tls_wrappermode = yes
smtp_tls_security_level = encrypt

Thanks !

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.