Thomas Landauer via Postfix-users: > Hi, > > my use case: > I need to find out if an outgoing message was successfully delivered or not. > I know this can be achieved by setting up some filesystem watcher for > the logfile, and/or by having a cronjob searching through the logfile > for the line containing `status=`. > But it would be so much nicer if Postfix would support this out of the > box :-)
Poatfix logs events with the queue ID of the corresponding mail transaction. The quueue ID is the primary grouping mechanism when searching for a specific message in the logs. > Adding a full-blown events layer with user-configurable commands for > each event, is probably not so easy ;-) > But what about extending the built-in logging mechanism? When a setting > like `pipe_log_to_command=` is given, then (additionally to writing them > to a file) send the logfile entries to that command. FIrst,, it is not hard to 'tail' a logfile (and skip to the next file after logfile rotation). Logfile watcher programs already do this. Second, logging to command is already available on Linux and non-Linux systems. 1) On Linux specify "|/path/to/fifo" as an additional destination in /etc/rsyslog.conf, and read the FIFO. 2) On non-Linux specify "|command" as an additional destination in /etc/syslog.conf. Caution: the command may run as root. For security reasons, individual Postfix daemons do not have the privilege to execute commands that run outside of Postfix. That leaves this: 3) Specify "maillog_file = /path/to/fifo" in Postfix main.cf., and read the FIFO. You'd be responsible for also writing this to a logfile, and rotating that file. This requires Postfix 3.4 or later. Wietse _______________________________________________ Postfix-users mailing list -- postfix-users@postfix.org To unsubscribe send an email to postfix-users-le...@postfix.org