[sork] vacation not working with qmail, autorespond, vpopmail

info at centralmail.de info at centralmail.de
Tue Jun 26 18:49:54 UTC 2007


Rick Romero <rick <at> havokmon.com> writes:

> 
Hi Rick,
I think I've managed it
>Try putting an
echo $query;
before the $getdata = mysql_query line

This has been the direction!
>That should show the query in your browser.
Post that, and let's see what it's trying to do.
It showed an empty string indeed so that nothing had been passed to the 
execution

I did it like so:

$link = mysql_connect('my_localhost', 'my_vpopmail_table', 
'my_vpopmailtable_pass');
if (!$link) {
	die('Could not connect: ' . mysql_error());
}

if ($this->_params[$realm]['enablemultidomains']){
list($cur_email,$cur_domain) = split('@',$my_email,2); 
$cur_domain = str_replace(array('.','-'),"_", $cur_domain);
$query = 'SELECT ' . $this->_params[$realm]['path_col'] .
' FROM ' . $this->_params[$realm]['vpopmaildb'] . '.' .  $cur_domain . 
' WHERE (' . $this->_params[$realm]['user_col'] . ')
LIKE \'' . $cur_email . '\' ';
}
else{
$query = 'SELECT ' . $this->_params[$realm]['path_col'] .
' FROM ' . $this->_params[$realm]['vpopmaildb'] . '.' . 
$this->_params[$realm]['table'] .
' WHERE concat(' . $this->_params[$realm]['user_col'] . 
',\'@\',' . $this->_params[$realm]['domain_col'] . ') 
LIKE \'' . $my_email . '\' ';
' WHERE ' . $this->_params[$realm]['user_col'] . ' = ?';
}

echo $query;

/* Execute the query. */
$getdata = mysql_query($query);
$result = mysql_result ( $getdata, 0, 0 );
$userpath = $result; 
// Now set up the .forward file.
//if (!empty($alias) && ($alias != $my_email)) {
//$contents = '| ' . $conf['vacation']['path'] .
//   " -a $alias $my_email\.n/Maildir/";
//} else {
//$contents = '| ' . $conf['vacation']['path'] .
//   " $my_email\n./Maildir/";
//}

$contents = '| ' . $conf['vacation']['path'] .
' 86400 3 ' . $userpath . '/vacation/message ' .
$userpath . "/vacation\n" . $userpath . "/Maildir/\n";


The echo shows a properly filled result string:

SELECT pw_dir FROM vpopmail.my_domain_de WHERE (pw_name) LIKE 
'I-myself' 

but this too (only visible when echo is on):

Warning: Cannot modify header information - headers already sent by
(output started at /var/www/mail/vacation/lib/Driver/vpopmailsql.php:155)
in /var/www/mail/vacation/templates/common-header.inc on line 4

Warning: Cannot modify header information - headers already sent by
(output started at /var/www/mail/vacation/lib/Driver/vpopmailsql.php:155)
in /var/www/mail/vacation/templates/common-header.inc on line 5

BUT: if echo is off the screen is clean and I get a properly
filled .qmail file
and a proper vacation message sent back too !!! :-)))

>I was thinking you may have to modify PureFTP to work with your setup,
>but it appears to be working properly...  Are you using MySQL
>authentication with PureFTP?  If so, can you post that query?  

I don't know - compiled pureftf
 ./configure --with-extauth --with-privsep --without-inetd
found it accidentally here:
http://www.qmailinfo.org/index.php/Ftpauth

But as you can see above I had to fill in the login specs
for the vpopmail db.
Is this the correct way to do so?
> 
>If you're able to get the proper path with PureFTP,
we need to copy that
>query for vpopmail to use.
Ithink I have to get into that too :) 

So now I'm thinking that there is it: a horde vacation for vpopmail
where each domain has its own table - 
man I'm that happy! Perhaps now you can polish the
wiki? How can someone do that?
AND: many thanks for your wonderful patient help!

BTW: some post further down is a post of mine telling that I've managed
to get it to work with passwd also (with this vpopmail setup)- 
another case for the wiki?

Claus







More information about the sork mailing list