From: Tzafrir Cohen on
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(a)jabber.org | VIM is
http://tzafrir.org.il | | a Mutt's
tzafrir(a)cohens.org.il | | best
tzafrir(a)debian.org | | friend


--
To UNSUBSCRIBE, email to debian-user-REQUEST(a)lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster(a)lists.debian.org
Archive: http://lists.debian.org/20100615123203.GP16560(a)pear.tzafrir.org.il
From: Patryk Cisek on
Right, I didn't read an email carefully. Sorry about that.

Try some MTA(e. g. Postfix)+procmail

That's what I used to text notifications about new mail to my
cellphone.

On Tue, Jun 15, 2010 at 06:22:14PM +0800, paragasu wrote:
> On Tue, Jun 15, 2010 at 5:59 PM, Patryk Cisek <patryk(a)debian.org> wrote:
>
> > Try ssmtp.
> >
> > On Tue, Jun 15, 2010 at 05:43:57PM +0800, paragasu wrote:
> > > On Tue, Jun 15, 2010 at 5:40 PM, Erwan David <erwan(a)rail.eu.org> wrote:
> > >
> > > > On Tue, Jun 15, 2010 at 11:33:47AM CEST, paragasu <paragasu(a)gmail.com>
> > > > said:
> > > > > 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.
> > > > >
> > > > > please advice.
> > > > >
> > > > > Thanks
> > > >
> > > > You may do this with a pipe transport in postfix.
> > > >
> > > > Note however that you must be extra careful for dealing with spams and
> > > > errors...
> > > >
> > > >
> > > > --
> > > > Erwan
> > > >
> > > >
> > > > --
> > > > To UNSUBSCRIBE, email to debian-user-REQUEST(a)lists.debian.org
> > > > with a subject of "unsubscribe". Trouble? Contact
> > > > listmaster(a)lists.debian.org
> > > > Archive:
> > http://lists.debian.org/20100615094034.GC20719(a)trusted-logic.com
> > > >
> > > >
> > > Hi Erwan,
> > >
> > > Since i only listen to 1 specific email address.
> > > I guess i can do something like firewall etc.
> > >
> > > paragasu.
> >
> >
> > --
> > To UNSUBSCRIBE, email to debian-user-REQUEST(a)lists.debian.org
> > with a subject of "unsubscribe". Trouble? Contact
> > listmaster(a)lists.debian.org
> > Archive:
> > http://lists.debian.org/20100615095940.GC24506(a)meriadoc.test-lan.net
> >
> >
> Hi Erwan,
>
> AFAIK, ssmtp is for sending email.
> I don't think i can use that
>
> paragasu


--
To UNSUBSCRIBE, email to debian-user-REQUEST(a)lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster(a)lists.debian.org
Archive: http://lists.debian.org/20100615124818.GA14580(a)meriadoc.test-lan.net
From: Joel Roth on
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.

I use a rudimentary perl script based on Net::POP3 and Email::Filter
to download and sort my messages from a POP3 mailbox.

Similar code could also be placed in a forward file, i.e. launched
the same was as procmail, for every mail delivered.

Perl can easily call a PHP script to finish handling
the mail. Or you may be able to rewrite that part of
your PHP script in Perl.

Will post my script if you are interested.

HTH

Joel

> please advice.
>
> Thanks


--
To UNSUBSCRIBE, email to debian-user-REQUEST(a)lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster(a)lists.debian.org
Archive: http://lists.debian.org/20100616090155.GA3291(a)sprite
From: H.S. on
On 15/06/10 05:33 AM, 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.
>
> please advice.
>
> Thanks
>

Wonder if procmail or heirloom-mailx can be of some help to you. I have
used the former to do stuff on my incoming mail and the latter to send
out mail based on some conditions on my machine. Do not much about
internal working of mail protocol, so just wanted to throw this out there.


--

Please reply to this list only. I read this list on its corresponding
newsgroup on gmane.org. Replies sent to my email address are just
filtered to a folder in my mailbox and get periodically deleted without
ever having been read.


--
To UNSUBSCRIBE, email to debian-user-REQUEST(a)lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster(a)lists.debian.org
Archive: http://lists.debian.org/hvai7a$b0o$1(a)dough.gmane.org
From: paragasu on
On Wed, Jun 16, 2010 at 9:05 PM, H.S. <hs.samix(a)gmail.com> wrote:

> On 15/06/10 05:33 AM, 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.
> >
> > please advice.
> >
> > Thanks
> >
>
> Wonder if procmail or heirloom-mailx can be of some help to you. I have
> used the former to do stuff on my incoming mail and the latter to send
> out mail based on some conditions on my machine. Do not much about
> internal working of mail protocol, so just wanted to throw this out there.
>
>
> --
>
> Please reply to this list only. I read this list on its corresponding
> newsgroup on gmane.org. Replies sent to my email address are just
> filtered to a folder in my mailbox and get periodically deleted without
> ever having been read.
>
>
> --
> To UNSUBSCRIBE, email to debian-user-REQUEST(a)lists.debian.org
> with a subject of "unsubscribe". Trouble? Contact
> listmaster(a)lists.debian.org
> Archive: http://lists.debian.org/hvai7a$b0o$1(a)dough.gmane.org
>
>
> Perl can easily call a PHP script to finish handling
> the mail. Or you may be able to rewrite that part of
> your PHP script in Perl.

> Will post my script if you are interested.

Hi Joel,

I have been searching for some time. And i decided to use postfix.
It is great if you can show me your code. If possible your configuration
too.

Thank a lot.

paragasu