PDA

View Full Version : Autoresponder trick


manarak
3rd February 2011, 14:06
I would like the autoresponder message to be dynamic, i.e. how can I program the autoresponder message to send back a password that changes every day or similar?

It would be great if the autoresponder text could be replaced by the output of a given script for example.

manarak
4th February 2011, 14:38
anyone?

where is the autoresponder message stored?
in the database?
can I make a cron job that changes the message every day?

till
4th February 2011, 14:49
where is the autoresponder message stored?

That depends on the lda that you use. For courier, it is tored in a file in the /var/vmail/mailfilters/..... folder. For dovecot the message is stored in the .sieve file in the root of the maildir folder.

can I make a cron job that changes the message every day?

You can change the autoresponder text with the ispconfig remote API withe the mail user update function.

manarak
4th February 2011, 15:07
found it in mailfilters, thank you!

will try to use a script to change it every day.

manarak
4th February 2011, 17:48
can't get it to work.

I chmodded .vacation.msg to 777 and added
/var/vmail/mailfilters/mydomain.com/passwords
to the openbasedir...

and I try
$fh = fopen('/var/vmail/mailfilters/mydomain.com/passwords/.vacation.msg', 'w')
(passwords is the email alias)


but I still get


Warning: fopen(/var/vmail/mailfilters/mydomain.com/passwords/.vacation.msg) [function.fopen]: failed to open stream: Permission denied in /var/www/clients/client2/web7/web/change_autoresponder.php on line 3

ideas anyone?

manarak
4th February 2011, 23:54
what else than file permissions and openbasedir is denying access here please?

manarak
4th March 2011, 11:16
still stumped by this problem.

.vacation.msg has 777 permissions, as well as the directory containing the file.

I added the path to PHP openbasedir.

I still get

Warning: fopen(/var/vmail/mailfilters/mydomain.com/passwords/.vacation.msg) [function.fopen]: failed to open stream: Permission denied in /var/www/clients/client2/web7/web/change_autoresponder.php on line 3


Can someone help me or tell me why I can't open the file for writing?

falko
5th March 2011, 13:43
Did you check the permissions/ownerships of all directories in the path to /var/vmail/mailfilters/mydomain.com/passwords/.vacation.msg?

manarak
5th March 2011, 14:04
thank you Falko

that is the probable cause why it doesn't work, but I don't want to potentially mess up my system by changing the groups on the directories

instead, I try to copy files there, but it doesn't work either:
http://www.howtoforge.com/forums/showthread.php?t=51754

the script works fine when started manually, but not with the cron job...