Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Postgrey logs not landing in /var/log/mail.log on Ubuntu 22.10 #98

Open
labrown opened this issue Feb 25, 2023 · 1 comment
Open

Postgrey logs not landing in /var/log/mail.log on Ubuntu 22.10 #98

labrown opened this issue Feb 25, 2023 · 1 comment

Comments

@labrown
Copy link

labrown commented Feb 25, 2023

I'm setting up a new personal email server running Ubuntu 22.10 and just implemented postgrey using the available Ubuntu package.

The logs emitted by postgrey are landing in /var/log/syslog, instead of /var/log/mail.log where I expect them to be.

These are the logs I see in /var/log/syslog when I sudo service postgrey start the daemon.

Feb 25 14:03:29 polar systemd[1]: Started Postfix greylisting policy server.
Feb 25 14:03:29 polar postgrey[45397]: 2023/02/25-14:03:29 postgrey (type Net::Server::Multiplex) starting! pid(45397)
Feb 25 14:03:29 polar postgrey[45397]: Resolved [localhost]:10023 to [::1]:10023, IPv6
Feb 25 14:03:29 polar postgrey[45397]: Resolved [localhost]:10023 to [127.0.0.1]:10023, IPv4
Feb 25 14:03:29 polar postgrey[45397]: Binding to TCP port 10023 on host ::1 with IPv6
Feb 25 14:03:29 polar postgrey[45397]: Binding to TCP port 10023 on host 127.0.0.1 with IPv4
Feb 25 14:03:29 polar postgrey[45397]: Setting gid to "999 999"
Feb 25 14:03:29 polar postgrey[45397]: Setting uid to "998"

I tried figuring out what's going on, but everything looks OK to me with my very rusty Perl skills. Not sure why the syslog_facility isn't being set on the syslog connection properly.

@bodik
Copy link

bodik commented Dec 5, 2023

I've made some digging, and on Debian Bookworm 12.2, the logging socket detection at https://github.com/schweikert/postgrey/blob/master/postgrey#L608 yields native, which turns in openlog_xs https://github.com/maddingue/Sys-Syslog/blob/a086d0279ec416ae2f3d9ac9fdcadccf08016c2e/Syslog.pm#L833 whatever that is. I guess that in 0.36 Sys::Syslog that works in favor of systemd and sends the log to stdout. This passes the message with defaults systemd service facitilty which is syslog.

One might use systemd service unit override as workaround, or file out PR for distros (https://salsa.debian.org/debian/postgrey/-/blob/main/debian/postgrey.service)

# cat /etc/systemd/system/postgrey.service.d/syslog.conf 
[Service]
SyslogFacility=mail

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants