Re: how execute command on every mail received



On Tue, Jun 15, 2010 at 05:33:47PM +0800, paragasu wrote:
Hi all,

I wonder if there is a simple SMTP deamon.
This deamon will execute a specific command on every email received.

I have a PHP program that will parse the email and
send SMS to specific mobile phone number thereafter.

Assuming you have postfix: See aliases(7).

Generally you can have the following line in /etc/postfix/aliases:

sms: |/path/to/command


Alternatively, in $HOME/.forward (of user 'sms?' put:

|/path/to/command


However you may want to only send some of those mails. In such a case,
you can use something like procmail to e.g. pipe only mails with a
specific subject (or some other specific header).


Note: I assumed you use postfix. Other decent MTAs have similar
concepts and capabilities.

--
Tzafrir Cohen | tzafrir@xxxxxxxxxx | VIM is
http://tzafrir.org.il | | a Mutt's
tzafrir@xxxxxxxxxxxxx | | best
tzafrir@xxxxxxxxxx | | friend


--
To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx
with a subject of "unsubscribe". Trouble? Contact listmaster@xxxxxxxxxxxxxxxx
Archive: http://lists.debian.org/20100615123203.GP16560@xxxxxxxxxxxxxxxxxxx



Relevant Pages

  • Re: how execute command on every mail received
    ... I wonder if there is a simple SMTP deamon. ... To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx ... Hi Erwan, ... paragasu. ...
    (Debian-User)
  • Re: how execute command on every mail received
    ... I wonder if there is a simple SMTP deamon. ... I have a PHP program that will parse the email and ... To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx ... Trouble? ...
    (Debian-User)
  • Re: how execute command on every mail received
    ... I wonder if there is a simple SMTP deamon. ... This deamon will execute a specific command on every email received. ... I have a PHP program that will parse the email and ... To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx ...
    (Debian-User)
  • Re: how execute command on every mail received
    ... I wonder if there is a simple SMTP deamon. ... This deamon will execute a specific command on every email received. ... I have a PHP program that will parse the email and ... To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx ...
    (Debian-User)