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

Re: limiting messages sent from command line

Expand Messages
  • Victor Duchovni
    ... What would you do with additional messages sent by a local user? Do you allow the use of tools such as procmail to forward received email to a
    Message 1 of 4 , Jul 27 7:36 AM
      On Wed, Jul 27, 2011 at 02:30:09AM -0300, Alexandre Biancalana wrote:

      > I need to limit the quantity of messages sent by my users from
      > command line (calling sendmail directly), ie: 100 messages by day per
      > user.

      What would you do with additional messages sent by a local user?

      Do you allow the use of tools such as "procmail" to forward received
      email to a user-selected external mailbox?

      Do you allow cron jobs to send mail to the user when they generate output?

      Should the limit apply to mail addressed to the sender, or to other
      local users?

      Have you thought through all the related use-cases and defined your
      goals and constraints clearly?

      > After playing a little with milter and write a initial filter,
      > everything works great except that I can't find the any symbol
      > provided by postfix containing the uid of sendmail the caller user.
      > Does this symbol exists ?

      Postfix sends no milter macro of this form.

      I believe that milters don't get to inspect the top-most Received header,
      which (for locally submitted mail) is added by the pickup(8) service and
      contains the effective uid of the process that invoked sendmail/postdrop
      (really the owner of the queue file in the Postfix "maildrop" directory).

      Actually, it is really the top-most header that is hidden from milters,
      so it may be possible to use a header-check to PREPEND another header
      above the topmost Received header, which will then expose the subsequent
      Received header to the milter, but this seems a rather convoluted solution,
      I can't say I'd recommend this, exhaust all other options first.

      A better option is likely passing the message through an SMTP hop first,
      and then running it through a milter or content-filter there.

      Speaking of content-filters, they don't suffer the (Sendmail)
      compatibility requirement that causes Postfix to hide the top-most header.

      Mixing milters and PREPEND actions in header_checks breaks the contract
      with milters, which expect to see the original external content, sans
      local modifications.

    Your message has been successfully submitted and would be delivered to recipients shortly.