postfixadmin-devel Mailing List for PostfixAdmin (Page 15)
Brought to you by:
christian_boltz,
gingerdog
You can subscribe to this list here.
2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
(39) |
Nov
(29) |
Dec
(4) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2008 |
Jan
(5) |
Feb
|
Mar
(8) |
Apr
(8) |
May
|
Jun
(11) |
Jul
(21) |
Aug
(4) |
Sep
(9) |
Oct
(5) |
Nov
(25) |
Dec
(11) |
2009 |
Jan
(40) |
Feb
(16) |
Mar
(1) |
Apr
(46) |
May
(3) |
Jun
|
Jul
(1) |
Aug
(9) |
Sep
(9) |
Oct
(27) |
Nov
(35) |
Dec
(20) |
2010 |
Jan
(3) |
Feb
(2) |
Mar
(8) |
Apr
(1) |
May
(9) |
Jun
(8) |
Jul
(1) |
Aug
(7) |
Sep
(2) |
Oct
(2) |
Nov
(12) |
Dec
(7) |
2011 |
Jan
(45) |
Feb
(11) |
Mar
(18) |
Apr
(15) |
May
(20) |
Jun
|
Jul
(5) |
Aug
(1) |
Sep
|
Oct
(8) |
Nov
|
Dec
(14) |
2012 |
Jan
(30) |
Feb
(36) |
Mar
(6) |
Apr
(32) |
May
(20) |
Jun
(5) |
Jul
(2) |
Aug
|
Sep
(4) |
Oct
|
Nov
(22) |
Dec
(1) |
2013 |
Jan
(13) |
Feb
(4) |
Mar
(70) |
Apr
(10) |
May
(6) |
Jun
(11) |
Jul
(1) |
Aug
(3) |
Sep
(2) |
Oct
(15) |
Nov
(4) |
Dec
(4) |
2014 |
Jan
|
Feb
|
Mar
(2) |
Apr
(2) |
May
(3) |
Jun
(2) |
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
(8) |
Dec
(2) |
2015 |
Jan
(1) |
Feb
(9) |
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
(6) |
Oct
|
Nov
|
Dec
|
2016 |
Jan
(4) |
Feb
|
Mar
(10) |
Apr
(3) |
May
|
Jun
(2) |
Jul
|
Aug
|
Sep
(1) |
Oct
(4) |
Nov
|
Dec
(13) |
2017 |
Jan
(1) |
Feb
(6) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(2) |
Dec
(3) |
2018 |
Jan
(2) |
Feb
|
Mar
(2) |
Apr
(7) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2019 |
Jan
|
Feb
|
Mar
(10) |
Apr
|
May
(1) |
Jun
(2) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(7) |
Dec
|
2020 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
|
Dec
|
2021 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(2) |
Dec
|
2023 |
Jan
|
Feb
(2) |
Mar
(3) |
Apr
|
May
|
Jun
(3) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2024 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(2) |
Dec
(3) |
From: Tanstaafl <tan...@li...> - 2012-04-10 11:37:16
|
Thanks for the easiest and best app to manage my mail system! |
From: Christian B. <pos...@cb...> - 2012-04-06 22:32:07
|
Hello, (sorry for not responding earlier - I really need days with more than 24 hours...) Am Donnerstag, 22. März 2012 schrieb s_p...@ru...: > I am happy to attach the codes for creating bulk email id for the > second review. > > I will appreciate for your comments, suggestions and advice. Should > you have any inquires on my works please free to contact me. I will > be happy to provide an information. I did some tests this time (not only reading code) and found some bugs: - the check for the allowed number of mailbox is wrong. You are testing with check_mailbox() - but this function only checks if you are allowed to create _one_ more mailbox on the domain. Please add a TODO in your code for now - I'll probably change check_mailbox so that the number of to-be-created mailboxes can be specified - even if mailbox creation aborts because I hit the maximum number of the allowed mailboxes, I get a success message - some of your *.csv files come with an invalid header, which (of course) lets them fail - "Please select Domain" and "Delimiter: : " are hardcoded in the tpl file - please move them to en.lang (without the " ") - $PALANG['pCreate_mailbox_csvdomian'] contains a typo (csvdom*ia*n). Anyway, please use $PALANG['pOverview_get_domain'] instead - it already exists and is translated. - when selecting "\t" as delimiter, I get Notice: fgetcsv(): delimiter must be a single character in .../model/UploadCsvFile.php on line 86 I'd guess you don't convert \t to a "real" tab character. There are also some things that are not bugs, but could be done better: - displaying errors could be done in a table: line number | username | error message IMHO, this will make the list easier readable. It would also allow to shorten some texts: - $PALANG['pCreate_csvmailbox_errMsg'] = 'Your uploaded CSV file contains the following errors:'; - $PALANG['InvalidEmailExisit'] = ' already exists'; - remove "Error line number:" from all texts - it will be shown in the first column of the table already - the background colors in the error list are very dark and make the text hard to read. I'm not sure if we really need the background color - I'd just use the "normal" table formatting we have in list-domain etc. - if all CSV entries are invalid or duplicates, please still display the detailed error messages. Replacing the buttons with the "wrong entries" error message is enough. - if the upload form is re-displayed because of errors, it should remember the selected domain and delimiter - coding style: please include the opening curly brackets in the statement's line, for example if ($foo == 'bar') { # do something } else { # something else } There's no need to go through all files just to adjust this - but if you change a code section anyway, please do the formatting this way. - sometimes you tend to split everything out to functions. While this is often a good idea, sometimes doing it without another (very small) function makes the code easier to understand. getReport() and setErrorMsg() are two examples. I have also attached a patch with inline comments and small changes for UploadCsvFile.php. That all said: This version looks much better than the files you initially sent :-) - and I'll *always* find something to criticize [1], so don't worry too much if the list above looks long ;-) Regards, Christian Boltz [1] I'm doing openSUSE betatests since some years, and reported more than 1000 bugs in this time ;-) -- dU hAsT nAtUeRlIcH rEcHt. MaN mUsS sIcH bEiM lEsEn NuR dArAn GeWoEhNeN. mAcHt DaNn KeInEn UnTeRsChIeD mEhR. [Andreas Kneib in suse-linux] |
From: Rudi F. <rud...@go...> - 2012-04-06 15:27:04
|
As i mentioned times ago, we shouldn't use a pipe. A Better way is to adapt the dovecot pw crypt methods to php and write a small php library. Am 06.04.2012 17:29, schrieb Patrick Herrmann: > Hi, > > I have hacked the pacrypt function in functions.inc.php to support > "dovecot pw" password verification (quick'n dirty). > > I decided to use "dovecot pw -t" to simply the process of verifying a > given password. My changes also don't break generating of new passwords. > > For this, I adapted a forum's post (don't know where I found it, but its > somehwere in the postfix forum). In this post it was also mentioned that > it may not work with dovecot versions between 2.0.6 and 2.0.8, I think. > > The ugly code is listed below (I have stripped unchanged stuff though). > > Do you think there are any security relevant issues which may arise > because of this hack? > > Thanks, > Patrick > > (Dovecot version 2.1, Postfixadmin version 2.3.5) > > ---------- > function pacrypt ($pw, $pw_db="") > { > [...] > // dovecot uses salts and has its own method to valid password, so use > // it > if(empty($pw_db)) { > $pipe = proc_open("$dovecotpw '-s' $method", $spec, $pipes); > > if (!$pipe) { > die("can't proc_open $dovecotpw"); > } else { > [...] > // get rid of "\n" > $password = substr($password, 0, strlen($password)); > [...] > > // if $pw_db is given assume that a password has to be verified, do > // that here > } else { > // use "doveadm pw" to verify a given password (don't have to deal > // with salt and stuff > $pipe = proc_open("$dovecotpw '-s' $method '-t' $pw_db", $spec, > $pipes); > > if(!$pipe) { > die("can't proc_open $dovecotpw"); > } else { > // only one write is needed here > fwrite($pipes[0], $pw . "\n", 1+strlen($pw)); usleep(1000); > fclose($pipes[0]); > } > > $password = fread($pipes[1], "200"); > > // strip the verified suffix (if any, else its garbage) > $password = substr($password, 0, > strlen($password) - strlen(" (verified)") - 1); > } > > fclose($pipes[1]); > fclose($pipes[2]); > proc_close($pipe); > > // Do not strip the method prefix > $password = trim(str_replace('{' . $method . '}', '', $password)); > $passord = trim($password); > } > [...] > > ------------------------------------------------------------------------------ > For Developers, A Lot Can Happen In A Second. > Boundary is the first to Know...and Tell You. > Monitor Your Applications in Ultra-Fine Resolution. Try it FREE! > http://p.sf.net/sfu/Boundary-d2dvs2 > _______________________________________________ > Postfixadmin-devel mailing list > Pos...@li... > https://lists.sourceforge.net/lists/listinfo/postfixadmin-devel |
From: Patrick H. <Pat...@gm...> - 2012-04-06 15:24:57
|
Hi, I have hacked the pacrypt function in functions.inc.php to support "dovecot pw" password verification (quick'n dirty). I decided to use "dovecot pw -t" to simply the process of verifying a given password. My changes also don't break generating of new passwords. For this, I adapted a forum's post (don't know where I found it, but its somehwere in the postfix forum). In this post it was also mentioned that it may not work with dovecot versions between 2.0.6 and 2.0.8, I think. The ugly code is listed below (I have stripped unchanged stuff though). Do you think there are any security relevant issues which may arise because of this hack? Thanks, Patrick (Dovecot version 2.1, Postfixadmin version 2.3.5) ---------- function pacrypt ($pw, $pw_db="") { [...] // dovecot uses salts and has its own method to valid password, so use // it if(empty($pw_db)) { $pipe = proc_open("$dovecotpw '-s' $method", $spec, $pipes); if (!$pipe) { die("can't proc_open $dovecotpw"); } else { [...] // get rid of "\n" $password = substr($password, 0, strlen($password)); [...] // if $pw_db is given assume that a password has to be verified, do // that here } else { // use "doveadm pw" to verify a given password (don't have to deal // with salt and stuff $pipe = proc_open("$dovecotpw '-s' $method '-t' $pw_db", $spec, $pipes); if(!$pipe) { die("can't proc_open $dovecotpw"); } else { // only one write is needed here fwrite($pipes[0], $pw . "\n", 1+strlen($pw)); usleep(1000); fclose($pipes[0]); } $password = fread($pipes[1], "200"); // strip the verified suffix (if any, else its garbage) $password = substr($password, 0, strlen($password) - strlen(" (verified)") - 1); } fclose($pipes[1]); fclose($pipes[2]); proc_close($pipe); // Do not strip the method prefix $password = trim(str_replace('{' . $method . '}', '', $password)); $passord = trim($password); } [...] |
From: OVC_SonamPenjor <s_p...@ru...> - 2012-04-04 05:49:49
|
Hi, Any comments and suggestions on the codes that I have attached in a month of March. Thanks Sonam Penjor |
From: <s_p...@ru...> - 2012-03-22 11:02:27
|
Hi, I am happy to attach the codes for creating bulk email id for the second review. I will appreciate for your comments, suggestions and advice. Should you have any inquires on my works please free to contact me. I will be happy to provide an information. Thanks Sonam Penjor -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. |
From: Christian B. <pos...@cb...> - 2012-03-09 19:07:58
|
Hello, Am Dienstag, 28. Februar 2012 schrieb Sonam Penjor: > However, after some time, the following > error occurs in chrome : * > "This webpage has a redirect loop* > The webpage > at*http://localhost/pa/trunk/create-bulkmailbox.php?filecsv=postfixadm > in&line_no=309&execTime=26.59564614296*has resulted in too many > redirects. > I am stuck with the above problem. I am even thinking of creating > .htaccess file but I am not quite sure whether this will overcome the > problems. This looks like a browser-side restriction to me [1], so you probably won't be able to solve it on the server side. I'd try client-side redirects using a meta header like <meta http-equiv="refresh" content="0; url=http://example.com/"> (should also work with url="file.php?foo=bar" without giving the complete URL) If you want to make it even nicer, use some javascript to display a nice progress bar and do Ajax requests in background. Unfortunately, this also means more coding etc. - so if the meta tag works, just use it ;-) Regards, Christian Boltz [1] Restricting the number of redirects makes sense in most cases (because there could be an endless redirect loop) - but in this case it bites us ;-) -- Nur beim Account meines Hundes (der ist mein Test-User) sind alle Desktop-Icons weg [...] Aber der geht eh nicht so oft an den Rechner. [Bernd Kloss in suse-linux] |
From: David G. <da...@co...> - 2012-03-09 15:23:29
|
You really need an exit(0) or something after a header("location: ....") call as PHP will keep executing code after the header if there is any. David David Goodwin Pale Purple Ltd. http://www.palepurple.co.uk 0845 0046746 07792 380669 On 9 Mar 2012, at 14:35, Rudi Floren <rud...@go...> wrote: > How do you redirect? > Using a Location Header? > > In a several project i used the following code snippet: > > if ($stillItemsInCVS && !$this->debug){ > header("Location: ".DIR."cron.php?line_no=".$lastLine); > } elseif ($stillItemsInCVS && $this->debug){ > print "<a href=\"".Conf::read('host')."cron.php?line_no=".$lastLine."\" >Continue...</a>\n"; > } > Additionally you can add an 301 Header > Am 08.03.2012 12:18, schrieb Sonam Penjor: >> >> Hi, >> >> I would appreciate if you could help me on my last problems (regarding the redirection problems). I have been trying and browsing google for the help but in vain. I didn't get definite and concrete solution to the problems. >> >> Thank You >> >> Sonam >> >> On 2/28/2012 4:23 PM, Sonam Penjor wrote: >>> >>> Hi, >>> >>> I am trying to upload around 2000 users to create mail box. If there are less number of user (300), it works fine. However, number of users are more (2000) it gives problem when redirect function call to create mail box again. >>> >>> The brief technical overview. >>> >>> 1. storing all the email id in session (no problem) >>> 2. from session using loop, mail box is created one by one before 5 seconds of maximum execution time and unset the session of created mail box. >>> 3. every after the max execution time, again it redirects using csv line number and execution time (as recommended) and create again (If redirect call is less then it works fine, but if it is multiple calls, then error occurs) . However, after some time, the following error occurs in chrome : >>> >>> "This webpage has a redirect loop >>> The webpage at http://localhost/pa/trunk/create-bulkmailbox.php?filecsv=postfixadmin&line_no=309&execTime=26.59564614296 has resulted in too many redirects. Clearing your cookies for this site or allowing third-party cookies may fix the problem. If not, it is possibly a server configuration issue and not a problem with your computer. " >>> >>> same cases with IE and Mozilla. It creates only the certain number of mail boxes. >>> >>> I am stuck with the above problem. I am even thinking of creating .htaccess file but I am not quite sure whether this will overcome the problems. >>> >>> I would appreciate for your advice, recommendations and comments. >>> >>> Thanks >>> >>> Sonam >>> >>> >>> >>> >> >> >> -- >> This message has been scanned for viruses and >> dangerous content by MailScanner, and is >> believed to be clean. >> >> ------------------------------------------------------------------------------ >> Virtualization & Cloud Management Using Capacity Planning >> Cloud computing makes use of virtualization - but cloud computing >> also focuses on allowing computing to be delivered as a service. >> http://www.accelacomm.com/jaw/sfnl/114/51521223/ >> >> >> _______________________________________________ >> Postfixadmin-devel mailing list >> Pos...@li... >> https://lists.sourceforge.net/lists/listinfo/postfixadmin-devel > > <rudi_floren.vcf> > ------------------------------------------------------------------------------ > Virtualization & Cloud Management Using Capacity Planning > Cloud computing makes use of virtualization - but cloud computing > also focuses on allowing computing to be delivered as a service. > http://www.accelacomm.com/jaw/sfnl/114/51521223/ > _______________________________________________ > Postfixadmin-devel mailing list > Pos...@li... > https://lists.sourceforge.net/lists/listinfo/postfixadmin-devel |
From: Sonam P. <s_p...@ru...> - 2012-03-08 11:18:30
|
Hi, I would appreciate if you could help me on my last problems (regarding the redirection problems). I have been trying and browsing google for the help but in vain. I didn't get definite and concrete solution to the problems. Thank You Sonam On 2/28/2012 4:23 PM, Sonam Penjor wrote: > Hi, > > I am trying to upload around 2000 users to create mail box. If there > are less number of user (300), it works fine. However, number of users > are more (2000) it gives problem when redirect function call to create > mail box again. > > The brief technical overview. > > 1. storing all the email id in session (no problem) > 2. from session using loop, mail box is created one by one before 5 > seconds of maximum execution time and unset the session of created > mail box. > 3. every after the max execution time, again it redirects using csv > line number and execution time (as recommended) and create again (If > redirect call is less then it works fine, but if it is multiple calls, > then error occurs) . However, after some time, the following error > occurs in chrome : > * > "This webpage has a redirect loop* > The webpage > at*http://localhost/pa/trunk/create-bulkmailbox.php?filecsv=postfixadmin&line_no=309&execTime=26.59564614296*has > resulted in too many redirects. Clearing your cookies for this site or > allowing third-party cookies may fix the problem. If not, it is > possibly a server configuration issue and not a problem with your > computer. " > > same cases with IE and Mozilla. It creates only the certain number of > mail boxes. > > I am stuck with the above problem. I am even thinking of creating > .htaccess file but I am not quite sure whether this will overcome the > problems. > > I would appreciate for your advice, recommendations and comments. > > Thanks > > Sonam > > > > -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. |
From: Sonam P. <s_p...@ru...> - 2012-02-28 10:23:36
|
Hi, I am trying to upload around 2000 users to create mail box. If there are less number of user (300), it works fine. However, number of users are more (2000) it gives problem when redirect function call to create mail box again. The brief technical overview. 1. storing all the email id in session (no problem) 2. from session using loop, mail box is created one by one before 5 seconds of maximum execution time and unset the session of created mail box. 3. every after the max execution time, again it redirects using csv line number and execution time (as recommended) and create again (If redirect call is less then it works fine, but if it is multiple calls, then error occurs) . However, after some time, the following error occurs in chrome : * "This webpage has a redirect loop* The webpage at*http://localhost/pa/trunk/create-bulkmailbox.php?filecsv=postfixadmin&line_no=309&execTime=26.59564614296*has resulted in too many redirects. Clearing your cookies for this site or allowing third-party cookies may fix the problem. If not, it is possibly a server configuration issue and not a problem with your computer. " same cases with IE and Mozilla. It creates only the certain number of mail boxes. I am stuck with the above problem. I am even thinking of creating .htaccess file but I am not quite sure whether this will overcome the problems. I would appreciate for your advice, recommendations and comments. Thanks Sonam -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. |
From: Tanstaafl <tan...@li...> - 2012-02-23 20:48:35
|
On 2012-02-23 3:43 PM, Tanstaafl <tan...@li...> wrote: > On 2012-02-23 7:04 AM, Tanstaafl<tan...@li...> wrote: >> On 2012-02-22 7:37 PM, Christian Boltz<pos...@cb...> wrote: >>> Am Mittwoch, 22. Februar 2012 schrieb Tanstaafl: >>>>> sub check_and_clean_from_address { >>>>> >>>>> my ($address) = @_; >>>>> my $logger = get_logger(); >>>>> >>>>> if($address =~ >>>>> /^(bounce|daemon|facebook|linkedin|listserv|mailer|majord >>>>> omo|mediapost|myspace|noreply|owner|plus.google|postmaster >>>>> |request|twitter)/i ) { >> >>> This checks for addresses _starting with_ the texts in the list - I >>> doubt you want that for myspace or plus.google ;-) > > Well, damn, I just saw another vacation message go out that had an > envelope sender of c.3...@ca... > > If what I had was indeed a 'contains' search, that should have been > blocked by the 'bounce' string... so, obviously, it still isn't working > like I want. > > Please, please, please can someone tell me how to simply make that check > above perform a 'contains' search on the entire envelope sender (both > local and domain parts)? Crapcrud... never mind, I just noticed that with all the changes I was making, somehow the change that Rudi had suggested: > The RegexString of your last emails /^*(linkedin|facebookmail|twitter|myspace)*/i > has to be: /^.*(linkedin|facebookmail|twitter|myspace).*/i got reverted... So, I just applied this change, hopefully this will fix me up... |
From: Tanstaafl <tan...@li...> - 2012-02-23 20:43:33
|
On 2012-02-23 7:04 AM, Tanstaafl <tan...@li...> wrote: > On 2012-02-22 7:37 PM, Christian Boltz <pos...@cb...> wrote: >> Am Mittwoch, 22. Februar 2012 schrieb Tanstaafl: >>>> sub check_and_clean_from_address { >>>> >>>> my ($address) = @_; >>>> my $logger = get_logger(); >>>> >>>> if($address =~ >>>> /^(bounce|daemon|facebook|linkedin|listserv|mailer|majord >>>> omo|mediapost|myspace|noreply|owner|plus.google|postmaster >>>> |request|twitter)/i ) { > >> This checks for addresses _starting with_ the texts in the list - I >> doubt you want that for myspace or plus.google ;-) Well, damn, I just saw another vacation message go out that had an envelope sender of c.3...@ca... If what I had was indeed a 'contains' search, that should have been blocked by the 'bounce' string... so, obviously, it still isn't working like I want. Please, please, please can someone tell me how to simply make that check above perform a 'contains' search on the entire envelope sender (both local and domain parts)? |
From: Tanstaafl <tan...@li...> - 2012-02-23 12:23:15
|
On 2012-02-22 7:52 PM, Christian Boltz <pos...@cb...> wrote: > Am Donnerstag, 16. Februar 2012 schrieb Tanstaafl: >> I opened this Feature Request a while back: >> >> https://sourceforge.net/tracker/?func=detail&aid=3150300&group_id=1915 >> 83&atid=937967 >> >> I'm fairly certain it is a trivial change - > "trivial" is relative when it comes to PHP - does open_basedir ring a > bell? ;-) Heh... no, actually - remember, ianap... ;) But it doesn't surprise me to learn that what I thought would be a trivial change may not be so trivial... > dirname(__FILE__) . '/etc/postfixadmin/config.local.php' will result in > something like > /var/www/pfa.example.com/htdocs/db_version/etc/postfixadmin/config.local.php > > You most probably want to use > > if (file_exists('/etc/postfixadmin/config.local.php')) { > include('/etc/postfixadmin/config.local.php'); > } > > To avoid flooding the error log with open_basedir warnings, using > @file_exists() (to supress the error message) _might_ be needed > (untested, as usual in past-midnight mails ;-) Ok, but ... are you saying to simply add the '@' character, like: if (@file_exists('/etc/postfixadmin/config.local.php')) { include('/etc/postfixadmin/config.local.php'); } ? Also, I'm guessing that there may only be an error *if* the file actually doesn't exist (which, in my case, it always should)? > That said: if we find a solution that does not cause problems with > open_basedir restrictions, I'll happily include it. Sounds good... and it isn't a huge deal for me to maintain this change manually myself per your and Davids instructions, but the less things I have to manually maintain the better. >> Hmmm... just had a thought... why not also add optional support for >> putting the custom vacation.conf settings into config.local.php too? > I understand your usecase/problem, but it's very hard to implement. > The problem is that we use different programming languages - > config.*.php is PHP code, but vacation.pl is written in perl. It would > be quite difficult to parse config.*.php from perl (because it may > contain _anything_ that is valid PHP, not only variables) Ok, understood... like I said it was just a thought, but I readily admit sometimes my casual thoughts (like this one) reflect my ignorance to a much greater degree than I would like... ;) |
From: Tanstaafl <tan...@li...> - 2012-02-23 12:04:29
|
On 2012-02-22 7:37 PM, Christian Boltz <pos...@cb...> wrote: > Am Mittwoch, 22. Februar 2012 schrieb Tanstaafl: >> So, seeing that this is most likely caused by something weird with the >> elsif, I decided to just replace the whole shebang with my new string >> line, like so: >>> sub check_and_clean_from_address { >>> >>> my ($address) = @_; >>> my $logger = get_logger(); >>> >>> if($address =~ >>> /^(bounce|daemon|facebook|linkedin|listserv|mailer|majord >>> omo|mediapost|myspace|noreply|owner|plus.google|postmaster >>> |request|twitter)/i ) { > This checks for addresses _starting with_ the texts in the list - I > doubt you want that for myspace or plus.google ;-) Far be it from me to argue with someone who obviously has much more programming knowledge, but my (one tiny little) test seems to say otherwise... maybe you can point out where my understanding is falling short? Here is the excerpt from vacation.log for my test: 2012/02/22 11:23:36 DEBUG> /var/spool/vacation/vacation.pl:548 main:: - Script argument SMTP recipient is : 'ValidUser#med...@au...dia-brokers.c om' and smtp_sender : 's-X...@bo...' 2012/02/22 11:23:36 DEBUG> /var/spool/vacation/vacation.pl:578 main:: - Converted autoreply mailbox back to normal style - from ValidUser#media-brokers.com@autore ply.media-brokers.com to Val...@me... 2012/02/22 11:23:36 DEBUG> /var/spool/vacation/vacation.pl:588 main:: - Email headers have to: 'First Last <Val...@me...>' and From: 'LinkedIn E mail Confirmation <ema...@li...>' 2012/02/22 11:23:36 DEBUG> /var/spool/vacation/vacation.pl:531 main::check_and_clean_from_address - sender LinkedIn Email Confirmation <ema...@li... > contains LinkedIn - will not send vacation message As you can see, the envelope sender definitely doesn't start with 'linkedin', and in the last line it says it is not sending because it 'contains LinkedIn'... > If you want to check for the domain part, you should use something like Actually, what I want is to test the *entire* envelope sender address - ie, I don't want to differentiate between the local and host parts, if the string is contained on *either*, I want the test to return true. > if ($address =~ /@(myspace|plus\.google|linkedin)/i { > > Note that a dot has to be escaped as \. - otherwise it's interpreted as > "any character". In other words: "plus.google" of course matches > "plus.google", but it also matches "plus4google". Ok, thanks, fixed that in my current setup... One other question - am I correct that the string 'facebook' would also be a positive match for something coming from 'facebookmail.com', since facebookmail contains facebook? > Please specify the domains as exact as possible - I'd guess > plus\.google\.com would be better than just plus\.google. > If you specify the whole domain everywhere, you can (and should) add a $ > to the regex (which matches the end of the string - in other words: > plus\.google\.com$ will not match "plus.google.com.is.funny.com" > (without the $, it would match) I honestly don't care about that use case... I am *much* more concerned about *not* replying when I *shouldn't* than I am about *replying* when it *should*... Understand - I am one of those who sees vacation responder systems as *evil* - albeit a necessary one for businesses. I make it very clear to my users that our vacation system is configured in such a way as to *always* err on the side of safety, and that a vacation message should *not* be replied upon for business critical situations - if money is on the line, pick up the phone. > VIRTUAL_VACATION/tests/ has some test mails and a test script. Interesting, I'll give it a look, thanks... > It would be nice to have more test mails there - can you provide the > linkedin mail (with all headers), please? Attached... >> Also, if there is a good reason for NOT doing it the way I'm doing it, >> please by all means tell me! ;) > In general, vacation.pl has a quite difficult job: it must reply to all > mails - except if it must NOT reply to a mail ;-) In other words: false > positives and false negatives are both bad, and the goal is to limit > those to a very small percentage. This also means that checks need to be > as specific as possible. I understand what you are saying, and agree that the *defaults* should always be as safe and precise as possible, but as I said above, I - and there are *many* others like me - look at vacation responders differently... I do *not* consider a non-reply when it maybe should have replied as all that bad... if avoidable, sure, but not even *remotely* as bad as replying when it shouldn't. On top of that, I prefer simple, and having a single check that examines the entire envelope sender just seems simpler/cleaner to me. > IMHO we should have a separate check for the domain part. Reasons: > - easier to read regex (avoid monster regex whenever possible) > - easier when adding more "do not reply" domains > - the domain part check could even use an array instead of a regex, > which makes customization easier Totally agree, especially if there could be a GUI option for managing these domain strings... > If there are cases where the combination of localpart and domain is > relevant, then I'll of course accept such a check. However I can't > imagine that this happens with real-world mails (feel free to prove me > wrong ;-) and therefore prefer separate checks for localpart and domain. Agree as well... Another thought - maybe my new simpler check for the entire envelope sender address (once we are all sure it is working like I want/expect) could be added as an optional (commented out) 'paranoid' section, with comments explaining the differences, and that it may/will be more prone to false positives (ie, not sending a reply when it maybe should)? Thanks for taking the time to discuss this with me Christian... I'll be keeping a close watch on the vacation.log for the next few days/weeks, to make sure everything is working like I want. |
From: Christian B. <pos...@cb...> - 2012-02-23 00:52:31
|
Hello, Am Donnerstag, 16. Februar 2012 schrieb Tanstaafl: > I opened this Feature Request a while back: > > https://sourceforge.net/tracker/?func=detail&aid=3150300&group_id=1915 > 83&atid=937967 > > I'm fairly certain it is a trivial change - "trivial" is relative when it comes to PHP - does open_basedir ring a bell? ;-) > can someone confirm that > all that is needed is to change the path that is provided at the > bottom of the config.inc.php file, ie, change: > > if (file_exists(dirname(__FILE__) . '/config.local.php')) { > include(dirname(__FILE__) . '/config.local.php'); > > to > > if (file_exists(dirname(__FILE__) > '/etc/postfixadmin/config.local.php')) { include(dirname(__FILE__) > '/etc/postfixadmin/config.local.php'); dirname(__FILE__) . '/etc/postfixadmin/config.local.php' will result in something like /var/www/pfa.example.com/htdocs/db_version/etc/postfixadmin/config.local.php You most probably want to use if (file_exists('/etc/postfixadmin/config.local.php')) { include('/etc/postfixadmin/config.local.php'); } To avoid flooding the error log with open_basedir warnings, using @file_exists() (to supress the error message) _might_ be needed (untested, as usual in past-midnight mails ;-) That said: if we find a solution that does not cause problems with open_basedir restrictions, I'll happily include it. > So, if the devs agree that this makes sense (since that is one of the > two default dirs for the custom vacation.conf file already), I'm > hoping that someone can make this the default for future installs... > > Hmmm... just had a thought... why not also add optional support for > putting the custom vacation.conf settings into config.local.php too? I understand your usecase/problem, but it's very hard to implement. The problem is that we use different programming languages - config.*.php is PHP code, but vacation.pl is written in perl. It would be quite difficult to parse config.*.php from perl (because it may contain _anything_ that is valid PHP, not only variables) Regards, Christian Boltz -- > Und jemand, der "NT" nutzt, ist kein Sysadmin, sondern ein > Reboot-Sklave. Und wenn er einen MCSE hat, dann ist er zertifizierter Bootmanager [Ralph Angenendt in dasr] |
From: Christian B. <pos...@cb...> - 2012-02-23 00:38:07
|
Hello, Am Mittwoch, 22. Februar 2012 schrieb Tanstaafl: > So, seeing that this is most likely caused by something weird with the > elsif, I decided to just replace the whole shebang with my new string > line, like so: > > sub check_and_clean_from_address { > > > > my ($address) = @_; > > my $logger = get_logger(); > > > > if($address =~ > > /^(bounce|daemon|facebook|linkedin|listserv|mailer|majord > > omo|mediapost|myspace|noreply|owner|plus.google|postmaster > > |request|twitter)/i ) { This checks for addresses _starting with_ the texts in the list - I doubt you want that for myspace or plus.google ;-) If you want to check for the domain part, you should use something like that (untested): if ($address =~ /@(myspace|plus\.google|linkedin)/i { Note that a dot has to be escaped as \. - otherwise it's interpreted as "any character". In other words: "plus.google" of course matches "plus.google", but it also matches "plus4google". Please specify the domains as exact as possible - I'd guess plus\.google\.com would be better than just plus\.google. If you specify the whole domain everywhere, you can (and should) add a $ to the regex (which matches the end of the string - in other words: plus\.google\.com$ will not match "plus.google.com.is.funny.com" (without the $, it would match) > And tested, and it seems to work just as I want. I even subbed a test > account to linkedin, and the confirmation email did not generate a > vacation message and it properly identified the LinkedIn string as the > reason... VIRTUAL_VACATION/tests/ has some test mails and a test script. It would be nice to have more test mails there - can you provide the linkedin mail (with all headers), please? (Replacing your mail address etc. with fo...@ex... is not a problem as long as you do it in a consistent way.) David can probably tell you more details about the test script. > Last question: is there any particular reason to test a combination of > the local part and the host part? Or would this modification seem > appropriate to incorporate into the core code? I'll be happy to > submit a patch if the devs think so... > > Also, if there is a good reason for NOT doing it the way I'm doing it, > please by all means tell me! ;) In general, vacation.pl has a quite difficult job: it must reply to all mails - except if it must NOT reply to a mail ;-) In other words: false positives and false negatives are both bad, and the goal is to limit those to a very small percentage. This also means that checks need to be as specific as possible. IMHO we should have a separate check for the domain part. Reasons: - easier to read regex (avoid monster regex whenever possible) - easier when adding more "do not reply" domains - the domain part check could even use an array instead of a regex, which makes customization easier If there are cases where the combination of localpart and domain is relevant, then I'll of course accept such a check. However I can't imagine that this happens with real-world mails (feel free to prove me wrong ;-) and therefore prefer separate checks for localpart and domain. Regards, Christian Boltz -- Wenn du in deiner procmail spamassassin stehen hast, dann wird für jede eintrudelnde Mail das komplette Programm gestartet, inclusive Initialisierung und PiPaPo - also, ich mache meine Wohnung am liebsten mit der Zentralheizung warm, nicht mit meiner Festplatte. ;-) [Ratti in suse-linux] |
From: Tanstaafl <tan...@li...> - 2012-02-22 16:37:11
|
Hi Rudy, Ok, many thanks for that! I applied the correction, and was still getting an error: > 2012/02/22 10:41:37 DEBUG> /var/spool/vacation/vacation.pl:548 main:: - Script argument SMTP recipient is : 'validuser#med...@au...' and smtp_sender : 'val...@Me...' > 2012/02/22 10:41:37 DEBUG> /var/spool/vacation/vacation.pl:578 main:: - Converted autoreply mailbox back to normal style - from validuser#med...@au... to val...@me... > 2012/02/22 10:41:37 DEBUG> /var/spool/vacation/vacation.pl:588 main:: - Email headers have to: 'First Last <val...@me...>' and From: 'First Last <val...@Me...>' > 2012/02/22 10:41:38 ERROR> /var/spool/vacation/vacation.pl:536 main::check_and_clean_from_address - Address is not valid; exiting So, seeing that this is most likely caused by something weird with the elsif, I decided to just replace the whole shebang with my new string line, like so: > sub check_and_clean_from_address { > my ($address) = @_; > my $logger = get_logger(); > > if($address =~ /^(bounce|daemon|facebook|linkedin|listserv|mailer|majordomo|mediapost|myspace|noreply|owner|plus.google|postmaster|request|twitter)/i ) { > $logger->debug("sender $address contains $1 - will not send vacation message"); > exit(0); > } > $address = strip_address($address); > if($address eq "") { > $logger->error("Address $address is not valid; exiting"); > exit(0); > } > #$logger->debug("Address cleaned up to $address"); > return $address; > } And tested, and it seems to work just as I want. I even subbed a test account to linkedin, and the confirmation email did not generate a vacation message and it properly identified the LinkedIn string as the reason... So, I think I will keep this modification permanently... Last question: is there any particular reason to test a combination of the local part and the host part? Or would this modification seem appropriate to incorporate into the core code? I'll be happy to submit a patch if the devs think so... Also, if there is a good reason for NOT doing it the way I'm doing it, please by all means tell me! ;) Thanks again Rudy... Charles |
From: Rudi F. <rud...@go...> - 2012-02-22 13:43:30
|
the ^ after / indicates that the adress has to begin with this like facebook@bla See the Regex Doc @ Wikipdia. It is a good starting point. * is not a wildcard symbol! . means any character * means that a char can occur n times The RegexString of your last emails /^*(linkedin|facebookmail|twitter|myspace)*/i has to be: /^.*(linkedin|facebookmail|twitter|myspace).*/i Am 22.02.2012 14:36, schrieb Tanstaafl: > On 2012-02-22 8:27 AM, Tanstaafl<tan...@li...> wrote: >> if($address = >> /^(bounce|daemon|facebook|linkedin|listserv|mailer|majordomo|mediapost|myspace|noreply|owner|postmaster|request|twitter)/i) > Two more questions... > > 1. This is a 'contains' match, right? > > and > > 2. Do dots/periods have to be escaped? > > The reason I ask #2 is I just got a google+ email, and they come from > from plus.google.com, so, can I add it like this: > > if($address = > /^(bounce|daemon|facebook|linkedin|listserv|mailer|majordomo|mediapost|myspace|noreply|owner|plus.google|postmaster|request|twitter)/i) > > ? > > ------------------------------------------------------------------------------ > Virtualization& Cloud Management Using Capacity Planning > Cloud computing makes use of virtualization - but cloud computing > also focuses on allowing computing to be delivered as a service. > http://www.accelacomm.com/jaw/sfnl/114/51521223/ > _______________________________________________ > Postfixadmin-devel mailing list > Pos...@li... > https://lists.sourceforge.net/lists/listinfo/postfixadmin-devel |
From: Tanstaafl <tan...@li...> - 2012-02-22 13:36:19
|
On 2012-02-22 8:27 AM, Tanstaafl <tan...@li...> wrote: > if($address = > /^(bounce|daemon|facebook|linkedin|listserv|mailer|majordomo|mediapost|myspace|noreply|owner|postmaster|request|twitter)/i) Two more questions... 1. This is a 'contains' match, right? and 2. Do dots/periods have to be escaped? The reason I ask #2 is I just got a google+ email, and they come from from plus.google.com, so, can I add it like this: if($address = /^(bounce|daemon|facebook|linkedin|listserv|mailer|majordomo|mediapost|myspace|noreply|owner|plus.google|postmaster|request|twitter)/i) ? |
From: Tanstaafl <tan...@li...> - 2012-02-22 13:28:02
|
On 2012-02-21 2:55 PM, Tanstaafl <tan...@li...> wrote: > Ok, applied the change, sent a test message to someone that I know who > has vacation enabled (just to make sure normal vacations work properly), > and got the following error: > > Command output: elseif should be elsif at > /var/spool/vacation/vacation.pl line 530. ^* matches null string many > times in regex; marked by<-- HERE in m/^*<-- HERE > (linkedin|facebook|twitter|myspace)*/ at > /var/spool/vacation/vacation.pl line 530. Actually, I guess I can't read... tried another modification, and got the same error, then noticed the explicit wording of the above... Changed elseif to elsif, removed the *, and the error is gone. I also just saw two more vacation messages that should not have gone out, so I modified it a bit more - now I have: sub check_and_clean_from_address { my ($address) = @_; my $logger = get_logger(); if($address =~ /^(noreply|postmaster|mailer\-daemon|listserv|majordomo|owner\-|request\-|bounces\-)/i || $address =~ /\-(owner|request|bounce|bounces)\@/i ) { $logger->debug("sender $address contains $1 - will not send vacation message"); exit(0); } elsif($address = /^(bounce|facebook|linkedin|mediapost|myspace|twitter)/i) { $logger->debug("sender $address contains $1 - will not send vacation message"); exit(0); } $address = strip_address($address); if($address eq "") { $logger->error("Address $address is not valid; exiting"); exit(0); } #$logger->debug("Address cleaned up to $address"); return $address; } But I have one more question that may simplify this a lot... If I wanted to not send a vacation message for anything that had any of these strings *anywhere* in the envelope sender address (ie, I didn't care about testing the localpart and host part individually), and I didn't care about differentiating the hyphenated versions of some of these, couldn't I simply modify the above to: sub check_and_clean_from_address { my ($address) = @_; my $logger = get_logger(); if($address = /^(bounce|daemon|facebook|linkedin|listserv|mailer|majordomo|mediapost|myspace|noreply|owner|postmaster|request|twitter)/i) { $logger->debug("sender $address contains $1 - will not send vacation message"); exit(0); } $address = strip_address($address); if($address eq "") { $logger->error("Address $address is not valid; exiting"); exit(0); } #$logger->debug("Address cleaned up to $address"); return $address; } ? This looks much simpler, and will be much easier to add new strings to... Thanks again David... this will be very helpful... |
From: Tanstaafl <tan...@li...> - 2012-02-21 19:55:25
|
On 2012-02-21 2:39 PM, Tanstaafl <tan...@li...> wrote: > On 2012-02-21 1:07 PM, David Goodwin<da...@co...> wrote: >>>> Maybe add an elseif in there, so something like: >>>> >>>> if($address =~ >>>> /^(noreply|postmaster|mailer\-daemon|listserv|majordomo|owner\-|request\-|bounces\-)/i >>>> || >>>> $address =~ /\-(owner|request|bounces)\@/i ) { >>>> $logger->debug("sender $address contains $1 - will not send >>>> vacation message"); >>>> exit(0); >> } >>>> elseif($address = /^*(linkedin|facebookmail|twitter|myspace)*/i) { >>>> $logger->debug("sender $address contains $1 - will not send >>>> vacation message"); >>>> exit(0); >>>> } >> >> >> The above ought to work. I've added a missing ) on line 4 ($address =~ /.…….@/i )<-- >> and a missing } after the 'exit(0)'. > > Cool, I'll give it a shot... Ok, applied the change, sent a test message to someone that I know who has vacation enabled (just to make sure normal vacations work properly), and got the following error: Feb 21 14:47:59 myhost postfix/pipe[8670]: BBD4F9A0CC2: to=<validuser#med...@au...>, orig_to=<val...@me...>, relay=vacation, delay=0.92, delays=0.29/0.01/0/0.63, dsn=5.3.0, status=bounced (Command died with status 255: "/var/spool/vacation/vacation.pl". Command output: elseif should be elsif at /var/spool/vacation/vacation.pl line 530. ^* matches null string many times in regex; marked by <-- HERE in m/^* <-- HERE (linkedin|facebook|twitter|myspace)*/ at /var/spool/vacation/vacation.pl line 530. syntax error at /var/spool/vacation/vacation.pl line 530, near ") {" Global symbol "$address" requires explicit package name at /var/spool/vacation/vacation.pl line 534. Global symbol "$address" requires explicit package name at /var/spool/vacation/vacation.pl line 534. Global symbol "$address" requires explicit package name at /var/spool/vacation/vacation.pl line 535. Global symbol "$address" requires explicit package name at /var/spool/vacation/vacation.pl line 536. Global symbol "$address" requires explicit package name at /var/spool/vacation/vacation.pl line 540. syntax error at /var/spool/vacation/vacation.pl line 541, near "}" Execution of /var/spool/vacation/vacation.pl aborted due to compilation errors. ) So, looks like it didn't like my wildcard? |
From: Tanstaafl <tan...@li...> - 2012-02-21 19:39:41
|
On 2012-02-21 1:07 PM, David Goodwin <da...@co...> wrote: >> > Maybe add an elseif in there, so something like: >> > >> > if($address =~ >> > /^(noreply|postmaster|mailer\-daemon|listserv|majordomo|owner\-|request\-|bounces\-)/i >> > || >> > $address =~ /\-(owner|request|bounces)\@/i ) { >> > $logger->debug("sender $address contains $1 - will not send >> > vacation message"); >> > exit(0); > } >> > elseif($address = /^*(linkedin|facebookmail|twitter|myspace)*/i) { >> > $logger->debug("sender $address contains $1 - will not send >> > vacation message"); >> > exit(0); >> > } > > > The above ought to work. I've added a missing ) on line 4 ($address =~ /.…….@/i )<-- > and a missing } after the 'exit(0)'. Cool, I'll give it a shot... Thanks! |
From: David G. <da...@co...> - 2012-02-21 18:08:31
|
>> >> if($address =~ >> /^(noreply|postmaster|mailer\-daemon|listserv|majordomo|owner\-|request\-|bounces\-)/i >> >> || >> $address =~ /\-(owner|request|bounces)\@/i { >> $logger->debug("sender $address contains $1 - will not send >> vacation message"); >> exit(0); >> >> I'm sure my code sample is wrong, but maybe you could tweak it? > > Hmmm... this wouldn't work, because it would require a match on the > localpart too, right? Or would it... > > Maybe add an elseif in there, so something like: > > if($address =~ > /^(noreply|postmaster|mailer\-daemon|listserv|majordomo|owner\-|request\-|bounces\-)/i > || > $address =~ /\-(owner|request|bounces)\@/i ) { > $logger->debug("sender $address contains $1 - will not send > vacation message"); > exit(0); } > elseif($address = /^*(linkedin|facebookmail|twitter|myspace)*/i) { > $logger->debug("sender $address contains $1 - will not send > vacation message"); > exit(0); > } The above ought to work. I've added a missing ) on line 4 ($address =~ /.…….@/i ) <-- and a missing } after the 'exit(0)'. David. |
From: Tanstaafl <tan...@li...> - 2012-02-21 17:43:50
|
On 2012-02-21 9:56 AM, Tanstaafl <tan...@li...> wrote: > Maybe something as simple as: > > if($address =~ > /^(noreply|postmaster|mailer\-daemon|listserv|majordomo|owner\-|request\-|bounces\-)/i > > || > $address =~ /\-(owner|request|bounces)\@/i { > $logger->debug("sender $address contains $1 - will not send > vacation message"); > exit(0); > > I'm sure my code sample is wrong, but maybe you could tweak it? Hmmm... this wouldn't work, because it would require a match on the localpart too, right? Or would it... Maybe add an elseif in there, so something like: if($address =~ /^(noreply|postmaster|mailer\-daemon|listserv|majordomo|owner\-|request\-|bounces\-)/i || $address =~ /\-(owner|request|bounces)\@/i { $logger->debug("sender $address contains $1 - will not send vacation message"); exit(0); elseif($address = /^*(linkedin|facebookmail|twitter|myspace)*/i) { $logger->debug("sender $address contains $1 - will not send vacation message"); exit(0); } ? |
From: Tanstaafl <tan...@li...> - 2012-02-21 14:56:55
|
On 2012-02-21 8:02 AM, David Goodwin <da...@co...> wrote: >> So, with this in mind, if I modified the above to, say, something like: >> >> if($address =~ >> /^(noreply|postmaster|mailer\-daemon|listserv|majordomo|owner\-|request\-|bounces\-)/i >> || >> $address =~ /\-(owner|request|bounce|bounces)\@/i ) { >> $logger->debug("sender $address contains $1 - will not send >> vacation message"); >> exit(0); >> } >> >> (I simply added 'bounce' before 'bounces') >> >> Would that catch the example I gave from linkedin, since it is >> from=blahblah.bounce.linkedin.com (bounce is singular, not plural)? > What you've added is looking for -bounce@ > > Which will not match bla...@bo... Oh!? Maybe I just realized... ok, so looking more closely, that section of code is assembling two strings separated by a '-', but only for the localpart of the sender address, correct? So, if I wanted to add a section to match on only something in the host part (ie, *@*$string*, can you provide the code to do that? Maybe something as simple as: if($address =~ /^(noreply|postmaster|mailer\-daemon|listserv|majordomo|owner\-|request\-|bounces\-)/i || $address =~ /\-(owner|request|bounces)\@/i || $address =~ /\(linkedin|facebookmail|twitter|myspace)/i) { $logger->debug("sender $address contains $1 - will not send vacation message"); exit(0); } I'm sure my code sample is wrong, but maybe you could tweak it? I'll be happy to provide a patch once I have a working/tested version. Thanks again David... |