Find the answer to your Linux question:
Results 1 to 4 of 4
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    Linux Mail Server - run external programs?

    Hello, I have a surveillance DVR which sends email messages on multiple alarm events.
    I have a (separate) spare Linux box and I want to install a Mail Server to take further actions. For example, I want to control some external hardware (buzzer, lamps, door locks etc) through parallel port. Is there any Mail Server which could filter the incoming messages (by address or subject) and run external programs accordingly?
    I prefer a Mail Server over a Mail Client because I want to run those programs (almost) in realtime (no polling interval).
    Thanx in advance for any clue.

  2. #2
    Linux Enthusiast Mudgen's Avatar
    Join Date
    Feb 2007
    You're not going to get realtime out of e-mail no matter what you do. What you're looking to do combines the functions of a mail server (MTA) and a mail client (MUA). sendmail piping to procmail can do it, there are also ways to do it with postfix.

  3. #3
    Linux Newbie nplusplus's Avatar
    Join Date
    Apr 2010
    Charlotte, NC, USA
    I would vote for Postfix, as it is relatively simple to setup a custom "queue/service" to which to send email based on any number of criteria that can then execute external scripts.


  4. $spacer_open
  5. #4
    Thank you very much! Seems like postfix is the answer.. though I have to read tons of man/conf pages to actually find out "how"!

    @nplusplus: I can't figure out a way to set up that custom service. Could you be more specific, please? Or, could you send me a link (example, tutorial) or something? Thanks a lot!

    The content filter can be set up with the Postfix spawn service, which is the Postfix equivalent of inetd. For example, to instantiate up to 10 content filtering processes on localhost port 10025:

    # ================================================== =================
    # service type private unpriv chroot wakeup maxproc command
    # (yes) (yes) (yes) (never) (100)
    # ================================================== =================
    localhost:10025 inet n n n - 10 spawn
    user=filter argv=/path/to/filter localhost 10026

    If you want to have your filter listening on port localhost:10025 instead of Postfix, then you must run your filter as a stand-alone program, and must not use the Postfix spawn service.
    Is that what I need? /path/to/filter is where my script should be? And.. how to send the current email message as an argument to my script? Thanks alot.
    Last edited by lifer; 04-19-2012 at 11:12 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts