Goldfish, A PHP Autoresponder Script
Goldfish, A PHP Autoresponder Script For The HowtoForge "Virtual Users And Domains With Postfix, Courier, MySQL And SquirrelMail " SetupsVersion 1.0 Goldfish is a quite simple autoresponder script (written in PHP) for Postfix. It consists of only one PHP file which can be started through a cronjob. It works with our "Virtual Users And Domains With Postfix, Courier, MySQL And SquirrelMail" tutorials (it cannot be used for other setups, especially Postfix setups that don't use a MySQL database). I do not issue any guarantee that this will work for you!
1 Preliminary NoteI'm assuming that you already have a working "Virtual Users And Domains With Postfix, Courier, MySQL And SquirrelMail" setup, e.g.:
2 Installing And Using GoldfishFirst we connect to our MySQL mail database and create an additional table called autoresponder: mysql -u root -p USE mail; CREATE TABLE `autoresponder` ( quit; Afterwards we download the latest goldfish release to /tmp and rename the goldfish PHP script to autoresponder.php: cd /tmp Then we open autoresponder.php and adjust the Configuration section. Make sure you fill in the correct database details (you can use the existing mail_admin MySQL user); in the $conf['q_mailbox_path'] line, make sure that you replace the table name view_users with users: vi autoresponder.php
Afterwards we move autoresponder.php to /usr/local/bin, make it owned by the user and group vmail, and make it executable: mv autoresponder.php /usr/local/bin chown vmail:vmail /usr/local/bin/autoresponder.php Now we create the log file /var/log/goldfish and make it owned by the user and group vmail: touch /var/log/goldfish I want autoresponder.php to be executed every five minutes, therefore I create a cron job for it which will be run by the user vmail: crontab -u vmail -e
That's it! Now you can create autoresponders in the autoresponder table, e.g. with phpMyAdmin or on the command line, e.g. as follows: mysql -u root -p USE mail; INSERT INTO `autoresponder` (`email`, `descname`, `from`, `to`, `message`, `enabled`, `subject`) VALUES('sales@example.com', 'sales@example.com Autoresponder', '2009-06-08', '2009-06-12', 'I will be out the week of June 8 with very limited access to email.\r\nI will respond as soon as possible.\r\nThanks!\r\nFalko', 1, 'Out of Office'); quit; This creates an autoresponder for the email address sales@example.com which is active between June 8, 2009, and June 12, 20009. Because the autoresponder cron job is executed only every five minutes, the autoresponder message will not be sent immediately, but within five minutes after an email is sent to the sales@example.com address. You should see something like this in the /var/log/goldfish log file whenever an autoresponder is sent from the sales@example.com address: 2009-06-08 07:00:01 Connection to database established successfully
3 Links
|
www.seamlessenterprise.com
One number. One voicemail. Seize the lead. Sprint Mobile Integration.
www.seamlessenterprise.com
One Number. One Voicemail.
Make it easier for clients to reach you. Turn your desk phone and mobile phone into one with Sprint Mobile Integration.
www.seamlessenterprise.com
One number. One voicemail. Sprint Mobile Integration.
www.seamlessenterprise.com
AT&T Synaptic Compute as a Service. Boost your power on demand.
Trial: IBM Cognos Express Reporting, Analysis & Planning







Recent comments
5 hours 54 min ago
7 hours 55 min ago
11 hours 6 min ago
13 hours 25 min ago
14 hours 36 min ago
15 hours 54 min ago
19 hours 58 min ago
23 hours 31 min ago
23 hours 43 min ago
1 day 14 hours ago