Postfix queue

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

Postfix queue

j.emerlik
Lately I wrote in python postfix policy service that can do something for me what I want.
Now I am thinking about next service butI don't know maybe it is not possible.

That is my question:

There is posssible write some service similar  to eg.

check_policy_service unix:private/policy-spf

It is possible to write some policy service that will be working with postfix queue ?

I would like have policy service that will be able to write do data base some information eg. when exactly  message was sent, message ID, DSN if soemthing goes wrong. That means it should be working with Postfix queue.

But policy services can be configured with smtpd_sender_restrictions and smtpd_recipient_restrictions.
It 's possible configure some policy service with postfix queue ?

Regards,
MattX
Reply | Threaded
Open this post in threaded view
|

Re: Postfix queue

Ralph Seichter
On 12.02.2018 16:06, j.emerlik wrote:

> I would like have policy service that will be able to write do data
> base some information eg. when exactly message was sent, message ID,
> DSN if soemthing goes wrong. That means it should be working with
> Postfix queue.

That's not really a specific description of your needs or design goals,
so you can expect answers to be similarly vague. ;-) Have you looked
into postqueue(1) and/or showq(8) yet?

-Ralph

Reply | Threaded
Open this post in threaded view
|

RE: Postfix queue

Fazzina, Angelo
In reply to this post by j.emerlik

Hi, I would think you could write a script to do what you need ?

 

Here is one I use that is in Python.

 

 

[root@mta3 alf02013]# Summary

 

 

   Usage:  Summary -s -h {-|POSTFIX_LOG} [ POSTFIX_LOG .. ]

 

   Summarize postfix mail log.  Gzipped files are OK.

 

   Print one line for each delivered email, with these columns

 

      TIME_RECEIVED       TIME_SENT           ELAPSED QUEUEID      SOURCE_IP       AUTHENTICATE_USER  FINAL_STATUS  FROM_ADDR  TO_ADDRS

 

   OPTIONS

     -h  Print column headers

     -s  Include email subject (if in Postfix log)

 

 

 

 

-ANGELO FAZZINA

 

ITS Service Manager:

Spam and Virus Prevention

Mass Mailing

G Suite/Gmail

 

[hidden email]

University of Connecticut,  ITS, SSG, Server Systems

860-486-9075

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of j.emerlik
Sent: Monday, February 12, 2018 10:07 AM
To: [hidden email]
Subject: Postfix queue

 

Lately I wrote in python postfix policy service that can do something for me what I want.

Now I am thinking about next service butI don't know maybe it is not possible.

That is my question:

There is posssible write some service similar  to eg.

check_policy_service unix:private/policy-spf

It is possible to write some policy service that will be working with postfix queue ?


I would like have policy service that will be able to write do data base some information eg. when exactly  message was sent, message ID, DSN if soemthing goes wrong. That means it should be working with Postfix queue.

But policy services can be configured with smtpd_sender_restrictions and smtpd_recipient_restrictions.

It 's possible configure some policy service with postfix queue ?

Regards,

MattX

Reply | Threaded
Open this post in threaded view
|

Re: Postfix queue

Viktor Dukhovni
In reply to this post by j.emerlik


> On Feb 12, 2018, at 10:06 AM, j.emerlik <[hidden email]> wrote:
>
> It is possible to write some policy service that will be working with postfix queue ?

No.  That's a bad idea anyway.  To track message flow, parse the logs.

--
        Viktor.

Reply | Threaded
Open this post in threaded view
|

Re: Postfix queue

j.emerlik
In reply to this post by Ralph Seichter
I would like have database and there information : Message ID, Sent Date (or last date of send trying), DSN, number of send attempts, Mail_From, RCPT_TO.

It would be helpful to create statistics  or check exacly what happened with the messages sent, eg, six months ago.

 

2018-02-12 16:22 GMT+01:00 Ralph Seichter <[hidden email]>:
On 12.02.2018 16:06, j.emerlik wrote:

> I would like have policy service that will be able to write do data
> base some information eg. when exactly message was sent, message ID,
> DSN if soemthing goes wrong. That means it should be working with
> Postfix queue.

That's not really a specific description of your needs or design goals,
so you can expect answers to be similarly vague. ;-) Have you looked
into postqueue(1) and/or showq(8) yet?

-Ralph


Reply | Threaded
Open this post in threaded view
|

Re: Postfix queue

Ralph Seichter
On 12.02.2018 16:44, j.emerlik wrote:

> I would like have database and there information : Message ID, Sent
> Date (or last date of send trying), DSN, number of send attempts,
> Mail_From, RCPT_TO.

That type of information should be extracted from the Postfix logs,
as existing tools like 'pflogsumm' do.

-Ralph
Reply | Threaded
Open this post in threaded view
|

Re: Postfix queue

Wietse Venema
In reply to this post by Viktor Dukhovni
Viktor Dukhovni:
>
>
> > On Feb 12, 2018, at 10:06 AM, j.emerlik <[hidden email]> wrote:
> >
> > It is possible to write some policy service that will be working with postfix queue ?
>
> No.  That's a bad idea anyway.  To track message flow, parse the logs.

The closest that comes to this is a daemon that responds to
transport_maps queries. If you must do that, I suggest using a
socketmap table.

http://www.postfix.org/transport.5.html
http://www.postfix.org/socket_table.5.html

But, it will drain performance.

        Wietse
Reply | Threaded
Open this post in threaded view
|

Re: Postfix queue

Wietse Venema
In reply to this post by j.emerlik
j.emerlik:
> I would like have policy service that will be able to write do data base
> some information eg. when exactly  message was sent, message ID, DSN if
> soemthing goes wrong. That means it should be working with Postfix queue.

You can use "postqueue -j" to get a machine-readable queue listing
with arrival time, and why mail is still in the queue.

However for historical information of past deliveries you will have
to rely on Postfix logs.

        Wiietse
Reply | Threaded
Open this post in threaded view
|

Re: Postfix queue

j.emerlik
I am generalny using postfix-logwatch for tracking log files.

However, I was thinking about something that is working in real time, scripts can be run by cron in some period time.
Then the best could be write some syslog phraser or redirect syslog to some application eg. written in Java to interpret log file in realtime.


2018-02-12 17:59 GMT+01:00 Wietse Venema <[hidden email]>:
j.emerlik:
> I would like have policy service that will be able to write do data base
> some information eg. when exactly  message was sent, message ID, DSN if
> soemthing goes wrong. That means it should be working with Postfix queue.

You can use "postqueue -j" to get a machine-readable queue listing
with arrival time, and why mail is still in the queue.

However for historical information of past deliveries you will have
to rely on Postfix logs.

        Wiietse

Reply | Threaded
Open this post in threaded view
|

Re: Postfix queue

j.emerlik
I am generally using postfix-logwatch for tracking log files.

However, I was thinking about something that is working in real time,
scripts can be run by cron in some period time.
Then the best solution could be write some syslog phraser or redirect syslog to some
application eg. written in Java to interpret log file in realtime.

Maybe someone has a better idea?