Comments (11)
We are using the syslog logging driver provided by docker directly,
https://docs.docker.com/config/containers/logging/configure/#supported-logging-drivers
Below example will produce log files in /var/log/docker/postal-smtp.log
docker-compose.yml
smtp:
image: ghcr.io/postalserver/postal:3.1.1
command: postal smtp-server
network_mode: host
cap_add:
- NET_BIND_SERVICE
volumes:
- /opt/postal/config:/config
restart: always
logging:
driver: syslog
options:
tag: "postal-smtp"
and fail2ban:
jail.local:
[POSTAL]
enabled = true
port = 25
filter = postal
maxretry = 3
findtime = 3600
logpath = /var/log/docker/postal-smtp.log
filter.d > postal.conf
[Definition]
failregex = (.*)WARN Authentication failure for <HOST>
ignoreregex =
from postal.
Do feel free to start a discussion under Feature Requests to add support for brute force protection directly in the SMTP server.
This is functionality I would like to see without needing to use fail2ban.
from postal.
correct way would be a docker-compose.override.yml
This works well. I don't know why I haven't thought about this before. I will update the docs to include this for those who might find it useful.
Edit: added to the docs: https://docs.postalserver.io/features/logging#redirecting-logs-to-the-host-syslog
from postal.
DELETED
my bad
works well
from postal.
@McPizza0
try: postal stop and then postal start (postal restart does not work)
from postal.
correct way would be a docker-compose.override.yml with the following contents:
version: "3.9"
services:
smtp:
logging:
driver: syslog
options:
tag: "postal-smtp"
can also be done via the docker daemon /etc/docker/daemon.json
but this would change logging for all containers on the server, which may not be desirable.
from postal.
Logging to files within containers is not a good practice and not supported in v3 - as you have found.
Docker itself will store these logs to a file on the host machine with appropriate rotation. You should look at ingesting these logs. You can find the path to a container's log file using something like this.
docker inspect --format='{{.LogPath}}' name-of-container
from postal.
@erichk4 tried this, didnt output any logs
will try doing a fresh install
from postal.
If you can avoid making changes to your docker-compose.yml
it will make upgrades easier. These configuration options should be able to be made globally which may be sufficient to redirect the logs. I haven't tried though.
(If you do apply it globally then you'll need to restart Docker itself.)
from postal.
@adamcooke you want this in the guide (fail2ban) ?
from postal.
We are using the syslog logging driver provided by docker directly, https://docs.docker.com/config/containers/logging/configure/#supported-logging-drivers
Below example will produce log files in /var/log/docker/postal-smtp.log
docker-compose.yml
smtp: image: ghcr.io/postalserver/postal:3.1.1 command: postal smtp-server network_mode: host cap_add: - NET_BIND_SERVICE volumes: - /opt/postal/config:/config restart: always logging: driver: syslog options: tag: "postal-smtp"
and fail2ban:
jail.local:
[POSTAL] enabled = true port = 25 filter = postal maxretry = 3 findtime = 3600 logpath = /var/log/docker/postal-smtp.log
filter.d > postal.conf
[Definition] failregex = (.*)WARN Authentication failure for <HOST> ignoreregex =
Don't work in Debian 12. Debian 12 don't have syslog. It use journalctl to manage log.
from postal.
Related Issues (20)
- Messages hang in pending state when database connection fails HOT 3
- when trying to build a mailserver after fresh installation we get an internal server error HOT 2
- https://postalserver.io/config-v2 is a 404 HOT 5
- "Validation failed: Last name can't be blank" when trying to use OIDC HOT 1
- Tiny Typo HOT 2
- 500 error on login - undefined method "login_ip_country", when accessing webserver through reverse proxy HOT 1
- max_message_size in config doesn't seem to have an effect. stuck on 14MB when receiving mails
- No response after clicking the build server button HOT 1
- Unable to access the web interface
- Output: 530 Authentication required
- SMTP-IP Missing Key section
- No complaint FBL handling like SendGrid, Mailgun, Postmark, AWS... HOT 2
- MessageBounced event lacks RFC code for bounce type (Hard or Soft bounce) HOT 3
- dial tcp 127.0.0.1:25: connect: connection refused HOT 1
- Deleting an address endpoint causes not to be able to load routes anymore HOT 1
- email stay in pending postal v3
- Web UI cannot create new server
- Mail forwarded by routers does not use IP pools HOT 1
- POrt 25, ipv4 and ipv6
- Automatic Retention not working? Manual Trigger? HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from postal.