You appear to be a little lost here, Amit. I'll try to shed some light for you.

I think you want to use formail with the -s option in the .qmail file. Send one message on to preline as in the default .qmail file, and send another to your perl program. Then have your perl program do its thing. You should use perl capabilities to grab $from and $subj values as they pass by (from your input file), then post to the web site once you have both variables. If you reach the end of the input file before finding the variables you're looking for, you should terminate appropriately, perhaps by sending an email notification or log message somewhere.

Note, I don't believe you can invoke formail from your perl script as you've done, as you haven't given it any input or output. formail is designed to use stdin and stdout, in traditional *nix fashion.

HTH.

Amit wrote:
Now I'm getting below error in my send log. Any idea

2010-10-08 19:57:55.934604500 delivery 1: deferral: 
can't_handle_mbox_delivery_for_./sms1.pl <http://sms1.pl>

Amit



On Fri, Oct 8, 2010 at 11:50 AM, Amit Dalia <a...@ikf.co.in <mailto:a...@ikf.co.in>> wrote:

    I'm trying with formail. Please find details below how I'm
    proceeding further. May be I'm somewhere wrong and someone may
    correct me.
    Initially I'm trying with my postmaster email id as that email id is
    not used by anyone.

    1) .qmail file of postmaster

    |/var/qmail/bin/preline /usr/bin/maildrop -A 'Content-Filter:
    maildrop-toaster' /etc/mail/mailfilter
    |./sms1.pl <http://sms1.pl>

    Here sms1.pl <http://sms1.pl> is my perl script.

    2) Content of sms1.pl <http://sms1.pl>

    #!/usr/bin/perl
    use Shell;
    use HTTP::Request::Common;
    use LWP::UserAgent;
    $from = system('formail -zx From:');
    $subj = system('formail -zx Subject:');
    #$msg = 'Test Amit ';
      $ua = LWP::UserAgent->new;
      $ua-> request(POST
    
'http://59.162.167.36:8085/api/MessageCompose?user=username:password&senderID=AMITTEST&receipientno=mymobno&msgtxt='.$from.'&reseller=myresellerid&state=2'
    
<http://59.162.167.36:8085/api/MessageCompose?user=username:password&senderID=AMITTEST&receipientno=mymobno&msgtxt=%27.$from.%27&reseller=myresellerid&state=2%27>);

    Problem is I'm getting sms when any mail comes on postmaster email
    id but I'm getting value 0 in sms.

    Thanks and Regards,

    Amit





    At Friday, 08-10-2010 on 0:19 Rob wrote:

        The message header extraction was actually from using formail
        not procmail
        so see if you can use that.

        On Thu, 07 Oct 2010 10:11:15 -0700, Amit Dalia <a...@ikf.co.in
        <mailto:a...@ikf.co.in>> wrote:

         > Ok. I have created a perl script through which I was able to
        call my
         > SMS server URL and generate SMS if passed all paramenters
        manually.
         > Now I'm working on second phase of the same on how to get and
        pass
         > from id and subject from mail to my perl script.
         > As per Bob's mail I can do it from procmail but want to know
        can I
         > get from id and subject value via maildrop and pass them to
        my perl
         > script. If I install procmail then will it conflict with
        maildrop.
         >
         > Regards,
         >
         > Amit
         >
         > At Wednesday, 06-10-2010 on 19:39 Eric Shubert wrote:
         >
         > Try curl?
         >
         > Amit Dalia wrote:
         >> I tried to use wget but instead of sending url with values it is
         > just
         >> downloading pages. I think wget is use for downloading files
        from
         > remote
         >> server.
         >>
         >> At Wednesday, 06-10-2010 on 6:34 Rob wrote:
         >>
         >> > I got a SMS API as mentioned below:
         >> >
         >> >
         >>
         >
        
http://59.162.167.36:8085/api/MessageCompose?user=smsserverusername:smsserverpassword&senderID=smsserversenderid&receipientno=mobilenumber&msgtxt=msgtosend&reseller=mysmsprovider&state=2
         >> >
         >> > Whenever I call this URL with respective details it send
        the sms.
         >> > Now here smsserverusername, smsserverpassword,
        smsserversenderid
         > &
         >> > mysmsprovider details will remain same for all users. Only
         > details
         >> > going to change is mobilenumber and msgtosend variable.
        Even we
         > can
         >> > say mobile number will be same for respective user.
         >> >
         >> > Now is there any way to get from id and subject from mail and
         > pass
         >> > those details into above URL while mail is getting
        delivered to
         >> > Maildir.
         >>
         >> Grab the appropriate variables via formail (ala procmail) and
         > execute a
         >> shell script (probably against a lookup table/file with
         > user-to-number
         >> values) with a wget/curl in it to that URL.
         >>
         >> This seems to get more complex as the thread goes on...
         >>
         >> --
         >> Rob Ayer

         >>
         >>
         >
        
---------------------------------------------------------------------------------
         >> Qmailtoaster is sponsored by Vickers Consulting Group
         >> (www.vickersconsulting.com <http://www.vickersconsulting.com>)
         >> Vickers Consulting Group offers Qmailtoaster support and
         > installations.
         >> If you need professional help with your setup, contact them
        today!
         >>
         >
        
---------------------------------------------------------------------------------
         >> Please visit qmailtoaster.com <http://qmailtoaster.com> for
        the latest news, updates, and
         >> packages.
         >>
         >> To unsubscribe, e-mail:
         > qmailtoaster-list-unsubscr...@qmailtoaster.com
        <mailto:qmailtoaster-list-unsubscr...@qmailtoaster.com>
         >> For additional commands, e-mail:
         > qmailtoaster-list-h...@qmailtoaster.com
        <mailto:qmailtoaster-list-h...@qmailtoaster.com>
         >>
         >


-- Rob Ayer
        phone: 360-531-1823
        gtalk: robayer
        skype: robayer


        
---------------------------------------------------------------------------------
        Qmailtoaster is sponsored by Vickers Consulting Group
        (www.vickersconsulting.com <http://www.vickersconsulting.com>)
        Vickers Consulting Group offers Qmailtoaster support and
        installations.
        If you need professional help with your setup, contact them today!
        
---------------------------------------------------------------------------------
        Please visit qmailtoaster.com <http://qmailtoaster.com> for the
        latest news, updates, and packages.

        To unsubscribe, e-mail:
        qmailtoaster-list-unsubscr...@qmailtoaster.com
        <mailto:qmailtoaster-list-unsubscr...@qmailtoaster.com>
        For additional commands, e-mail:
        qmailtoaster-list-h...@qmailtoaster.com
        <mailto:qmailtoaster-list-h...@qmailtoaster.com>




--
-Eric 'shubes'


---------------------------------------------------------------------------------
Qmailtoaster is sponsored by Vickers Consulting Group 
(www.vickersconsulting.com)
   Vickers Consulting Group offers Qmailtoaster support and installations.
     If you need professional help with your setup, contact them today!
---------------------------------------------------------------------------------
    Please visit qmailtoaster.com for the latest news, updates, and packages.
To unsubscribe, e-mail: qmailtoaster-list-unsubscr...@qmailtoaster.com
    For additional commands, e-mail: qmailtoaster-list-h...@qmailtoaster.com


Reply via email to