This is a simplistic vacation script for postfixadmin, written in PHP.
Since postfix has already figured out who the sender is, and who the
recipient is, we can use
these values passed via the command line from the postfix pipe daemon
process when our script
is called. This avoids having to parse the email message itself, and vastly
simplifies the
program logic. It does impose some limitations, described below.
This version only supports the postgres backend database. It should be easy
to adapt to mysql,
by someone familiar with that database. Ideally, it should be
database-independent.
The main design goal is extreme simplicity, with decent error checking,
to avoid sending inappropriate vacation notifications.
It is much simpler than the vacation.pl script included with postfixadmin,
since it does not
have to parse the email headers to extract the sender and recipient.
However, it should be easily modifiable by anyone reasonably familiar with
PHP.
Features:
- Written entirely in simple, linear PHP.
- Error checking: at each step, if an error is encountered, the error is
logged and the program exits
- Relies on postfix for the sender and recipient address
- Allows a time-based repeat policy for re-sending notifications. For
example, it can be set to notify
every 10 days, every day, or even every 1 second if you want a
notification sent for each incoming
mail from each sender.
Limits:
* Postgres only, because I do not have a Mysql test DB.
I previously had the vacation-psql.pl script running when I was using
postfix 2.2, but it stopped
working when I upgraded to postfix 2.3 (which I needed for working with
dovecot SASL auth). This
vacation-psql.pl uses the vacation_notification table to keep track of
which senders have already
received a vacation notification. I did not see this table used in the
mysql vacation.pl script.
* Does not attempt to find the actual address to which the mail was sent,
it just uses the ${recipient}
macro from the postfix pipe interface to find the recipient mailbox.
Therefore, the return address of
the vacation notification is that of the user's mailbox, not necessarily
the address to which the
sender originaly sent the email, which may well be an alias to that
mailbox. My workaround for
this limitation for users who have abc123@whatever.tld type addresses is to
suggest that they put their
usual address or their name in the subject line.
Nobody/Anonymous
Vacation
None
Public
|
Date: 2008-06-14 08:32 Logged In: NO |
| Filename | Description | Download |
|---|---|---|
| README+vacation.php-script.tgz | README and vacation.php script | Download |
| Field | Old Value | Date | By |
|---|---|---|---|
| File Added | 236648: README+vacation.php-script.tgz | 2007-07-12 00:19 | waw |
Copyright © 2009 Geeknet, Inc. All rights reserved. Terms of Use