Loading ...
Sorry, an error occurred while loading the content.

227446Re: Programmatic access to the showq daemon/data

Expand Messages
  • Wietse Venema
    Oct 1, 2007
    • 0 Attachment
      Ward, Martin:
      > Hi,
      >
      > Is there any kind of documentation on how to access the mail queue list
      > from within a program? Perl or C would be nice!

      No.

      The mailq command (actually, postqueue -p) provides sendmail
      compatibility. It is not good for programmatic processing.

      The ad-hoc postqueue/showq protocol needs to be replaced by one
      that is more suitable for programmatic processing, and then the
      legacy mailq needs to be implemented on top of that. you can
      then plug in your scripts without having to parse mailq output.

      > I ask because I have a number of mail servers that regularly have mail
      > queues > 300,000 emails and a lot of these queues are bounces and
      > double-bounces. Right now I have a simple script that someone wrote
      > (possibly it even came with the Postfix installation since I didn't
      > perform the installation) which runs the "postqueue -p" command,
      > grep/awks out the message ID of the unwanted emails and runs "postsuper
      > -d" for each ID.

      EEEEKS!

      Don't accept mail for bogus senders, so that you don't have to
      send bounces later!

      Talk about fixing the wrong problem at the wrong end!

      > The postqueue(1) command takes the longest to run so is the most obvious
      > starting point for trying to speed this process up, and it struck me
      > that if I could write a program that could directly access the mail
      > queue and get the IDs of the unwanted emails that way, it might be
      > quicker.

      The postqueue command takes long because it has to examine every
      queue file. There is no way that you can speed that up except by
      strong the entire mail queue metadata in a database.

      Wietse
    • Show all 8 messages in this topic