Auto respond - Yaa and time limited

Discussion in 'HOWTO-Related Questions' started by Isterklister, Apr 11, 2007.

  1. Isterklister

    Isterklister New Member

    Hello,
    I have installed by "Autoresponders to accompany Virtual Users and Domains with Postfix, Courier and MySQL:) " and I wrote my own php script to let the user edit there autoreply.

    Now to my problem: This does'n take notise about tstart and tfinish. How can I enable that?

    Pelle
     
  2. falko

    falko Super Moderator ISPConfig Developer

    What exactly have you done, and what's in your PHP script?
     
  3. Isterklister

    Isterklister New Member

    I have installed Ubuntu 6.10
    "The Perfect Setup - Ubuntu 6.10 Server (Edgy Eft)",
    "Virtual Users And Domains With Postfix, Courier And MySQL (Ubuntu 6.10 Edgy Eft)" and
    "Autoresponders to accompany Virtual Users and Domains with Postfix, Courier and MySQL" and on top of that eGroupware.

    In the php-script you log in and you get a form with all options in table "autoresponder" the users should change. Time are converted to Unix Timestamp (the user see a small java-calender).

    I have tried to change the post "autoresponder" directly in database and thrue my script but it is something in comunication between postfix and yaa I think.
    In yaa.conf one line are
    'sql_select' => "select active,message,subject,charset,forward from autoresponder where address = %m and active='1'",

    It does'n read the lines with tstart and tfinish. How could I send tfinsish and tstart to yaa? :confused:

    Could it be as simple as:
    'sql_select' => "select active,message,subject,charset,forward,tstart,tfinish from autoresponder where address = %m and active='1'",?

    or (I see now) should I change the SQL query to test time to?
    where address = %m and active='1'" and - [time are between tstart and tfinish] in some way? How to write such a query?
     
    Last edited: Apr 12, 2007
  4. falko

    falko Super Moderator ISPConfig Developer

    I'd try something like this:

    'sql_select' => "select active,message,subject,charset,forward,tstart,tfin ish from autoresponder where address = %m and active='1' and tstart < [current_time] and t_finish > [current_time]"

    But I'm not sure if there's a variable available in yaa.conf that holds the current time.
     
  5. Isterklister

    Isterklister New Member

    Solved tstart and tfinish

    Ia used this line in yaa.conf
    'sql_select' => "select active,message,subject,charset,forward from autoresponder where address = %m and active='1' and tstart < unix_timestamp() and tfinish > unix_timestamp()",

    It is working excelent! Now yaa doesn't have to take care of tstart and tfinish because the query solves that.

    Thank you! :)
     
    Last edited: Apr 16, 2007

Share This Page