From: Jan A. <jan...@in...> - 2005-09-24 13:42:26
|
Paul / List members, I made some progress on this vacation_local vs qmail issue. After changing the php code of the file vac_init.php I finally got the vacation_local plugin to work in combination with qmail. The unified diff with my version of the vac_init.php program and the official 2.0.1.4 version coming from www.squirrelmail.org is attached to this email. Just in case attachements are automatically discarded on the mailinglist I also copied the patch in this email. Paul, could you have a look at this code, maybe it is usefull for a following version of your plugin ? Hope to hear from you soon. Regards, Jan ======= BEGIN SNIP ====== # diff -f vac_init_paul.php vac_init_jan.php a190 // // Clean $forward_addresses // if( $forward_addresses != NULL ) { $lowcount = 0; $highcount = 0; $length = strlen($forward_addresses); while( $highcount < $length ) { if( $forward_addresses[$highcount] != "\r" ) { $tmp_addresses[$lowcount] = $forward_addresses[$highcount]; $lowcount++; } $highcount++; } unset($forward_addresses); $forward_addresses = implode($tmp_addresses); } // // End cleaning $forward_addresses // . c204 205 $forward_file_contents .= '|' . $vacation_path . ' ' . $alias_list . $username . "\r\n"; . c224 $forward_file_contents .= '/home/' . $username . '/Maildir/'; . ======== END SNIP ======= ----- Original Message ----- From: "Jan Alphenaar" <ja...@un...> To: "Squirrelmail Plugins List" <squ...@li...> Sent: Saturday, August 06, 2005 5:47 PM Subject: Re: [SM-PLUGINS] Question regarding plugin vacation_local Paul, Here is some extra information regarding my system: * Operating system is Fedora Core1 * ftp daemon is vsftpd-1.2.0-5 * This is the diff you where asking about: ================= # diff -f vac_init.php /home/jan/sources/squirrelmail/download/vacation_local/vac_init.php -f c204 205 $forward_file_contents .= '"|' . $vacation_path . ' ' . $alias_list . $username . "\"\n"; . c224 $forward_file_contents .= '\\\\' . $username . "\n"; ================= An interesting thing is that the variable $forward_addresses in vac_init.php contains the email addresses which is inserted by the user (each on a different line). When I print the variable $forward_addresses character by character, I see two characters on the place of the newline, namely "\r\n". After sending an email to the account with the vacation message activated I see that the email which is send to the $forward_addresses are still in qmail mailqueue. When I do a bin/qmail-qread I see the line: remote bl...@bl...__ Note the "__" at the end of the domain. Last week I created some code to clean up the \r\n stuff of the $forward_addresses variable, but somehow I was not very successfull. If you want me to work further on it, please let me know. Another possibility is that maybe it is possible that the vacation_local plugin copies the .qmail file in the wrong ftp mode over the ftp protocol.... And that this is what is inserting the ^M (this is how the /r/n shows up in vi) in the .qmail file, in stead of the browser ? Regards, Jan ----- Original Message ----- From: "Jan Alphenaar" <ja...@un...> To: "Squirrelmail Plugins List" <squ...@li...> Sent: Wednesday, August 03, 2005 8:48 PM Subject: Question regarding plugin vacation_local Dear list members, I am trying to install the squirrelmail vacation_local plugin. Although I was quite successfull, things are not running as they supposed to be. If anybody can give me a hand here, it is appreciated. This is my install: * apache_1.3.31 * php-4.3.7 * qmail-1.03 * squirrelmail-1.4.5 * vacation_local-2.0-1.4 After installing the plugin, it is available under 'options' in de squirrelmail GUI. Now it is possible to fill in the following fields. 1) Send auto-reply to sender 2) Vacation Subject 3) Vacation message 4) Forward incoming message to addresses listed below ? 5) No local delivery; forward and/or auto-reply only 6) Forward email addresses (one address per line) When I fill in the fields the files are created, just as I configured it to be in config.php file (see below). .vacation.fwd .vacation.msg .vacation.pref .vacation.sq .vacation.subj .qmail So far so good, but the content of the .qmail file is not what it is supposed to be: ================ email@ToBeForwarded.com "|/opt/qmail-vacation/bin/vacation jan" \jan ================ Qmail is not able to handle a .qmail file with such a syntax and therefore the vacation plugin is not working on my system. When I manually edit the .qmail file and put the following content in it, everything works fine. ================ email@ToBeForwarded.com |/opt/qmail-vacation/bin/vacation jan /home/jan/Maildir/ ================ So I started to make changes to the vac_init.php file to get things up and running. I changed the following lines which results in the fact that the vacation plugin is working if I do not enable forwarding --> Line 204 & 205 $forward_file_contents .= '|' . $vacation_path . ' ' . $alias_list . $username . "\n"; --> Line 224 $forward_file_contents .= '/home/' . $username . '/Maildir/'; When I enable forwarding everything breaks again. This is because the plugin does not strip of the ^M character at the end of each email address (inserted by the browser). Qmail now thinks that the email address is ja...@ex...^M so with the ^M at the end of the domain name. I am very surprised that I have to make such changes to the code, since approximately 21.000 people already have downloaded the plugin. Again, if anybody can help me, this is greatly appreciated. Regards, Jan |