Closed (fixed)
Project:
Mail Redirect
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
3 Jan 2012 at 05:27 UTC
Updated:
20 Sep 2013 at 13:23 UTC
Jump to comment: Most recent file
Comments
Comment #1
KeyboardCowboyHere's a patch to add the feature to redirect all mail to a single address.
Comment #2
achtonThe patch above adds some whitespace cleanup and CVS stuff, and doesn't apply to 7.x-1.0. It does apply to the master branch though (there's no 7.x-1.x branch in the Git repo for this project).
Here's a patch that leaves out the whitespace fixing and CVS cleanup and applies to 1.0. No functional changes.
Comment #3
Pedro Lozano commentedReroll against lates dev version and fixed indentation issues.
Comment #4
Pedro Lozano commentedFixing title.
Comment #5
rooby commentedHere is an updated version of the patch that changes:
* Some more indenting fixes.
* Some minor comment tweaks.
* Added #states support to settings so that the fields how and hide based on the mothod of redirecting.
* Rmoved redundenat code from mail_redirect_mail_alter() where it called mail_redirect_recipients() and then had the same code that was already in mail_redirect_recipients().
* Removed the $form['#validate'][] part of the form function because it is not required.
* Changes the update hook to be 7101 to follow naming convention. 7100 would be for upgrading from major version 7.x-0.x to 7.x-1.x
Still required (I didn't have time sorry):
* Update the mail_redirect_requirements() function so it works properly with the new settings.
Comment #6
liquidcms commentedseems like a reasonable addition to this module - thanks for the submission; a couple comments:
- i just fixed up a few things and released a 7.x-1.3 rel prior to seeing this patch; so patch likely won't apply as is anymore; but my changes were minor so likely it is close
- it doesn't look like your "to single address" is within the skip (which is mostly the area i made bug fixes to) - it needs to be covered by the "skip" option
- i don't really like the idea of adding text to the address body; but i guess when going to a single address it is the only way to see where it was headed. but then by that logic we should be doing that for the domain redirect as well since it only lets you see partially where it was originally intended. anyway; i would really prefer not to modify the email body - how about simply adding [@to] after the original subject?
Comment #7
liquidcms commentedComment #8
tomb-2 commentedRe-rolled rooby's patch in #5 for latest version.
Modified it to append the subject instead of the body.
Edit: Named the patch wrong sorry, should be 1392248-8.
Comment #9
rooby commentedFixing status.
Comment #10
anybodyThe patch works great! Tested on several websites.
Thank you so much! Can we get this into the next .dev or even stable?
Comment #11
liquidcms commentedsetting to needs review should have triggered patch tester.. not sure why it didn't. when i run patch locally it fails.
setting back to needs review to try to trigger autotester
Comment #12
anybodyAre you sure that automated tests are enabled in the project settings (for the issues)? I think that may be required to run the test automatically here.
Comment #13
anybodyBut again I can confirm that the patch works correctly in manual tests. I've just re-tried the whole process and everything works fine. :)
Comment #14
KeyboardCowboyUpdating status.
Comment #15
liquidcms commentedthanks. i enabled the autotester.
i have a very low tolerance for GiT. can you just attach a zip/tar of your entire version of folder and i can check it out and then just commit the entire thing.
Comment #16
sheldon rampton commented@liquidcms: Improving your git tolerance will make life as developer easier. I speak as someone who struggled for awhile myself with git, but now I use it all the time and have come to appreciate it.
You might also want to check out dreditor:
https://drupal.org/project/dreditor
It's a web browser extension that makes it really easy to review and test patches without needing to use git directly. With a single click from within your web browser, you can spin up a test instance of Drupal using simplytest.me, including your module the patch already applied. I just tested it that way myself, and the patch applied cleanly and seemed to work. (I didn't test it fully, since other people have already done so.)
Comment #17
anybodyYou can find attached the latest .dev Version of this module, patched with the latest patch above.
Comment #18
rooby commented@liquidcms:
I would say patches would make things easier.
You can just do:
You can also use
git apply -v mail_redirect-single_address-7397034-8.patchinstead of patch -p1 if you prefer.There are actually more steps to commit the changes from a zip file than a patch.
Comment #19
liquidcms commentedthanks to everyone that is contributing to this; I especially like the #states support which i have not used before (but certainly will in the future).
a couple issues remaining as i am testing the zip included in #17 above:
1. many places in the code/docs that do not match the new changes: install, uninstall, requirements hook for status report entry, .info file, readme, etc - i think i have made all these changes to match the new feature - and tested.. :).
2. bigger issue is you did not do the part i mentioned in #6 about falling within the SKIP feature nor are you handling the case where a "To address" could actually be an address list (see comment in code about various email formats that drupal mail deals with).
i just have that fix to make and then will commit a new release.
@Anybody re: #10 - it is a pretty common thing to state "have tested" but testing is a pita for sure and only as good as the list of test cases. i would guess this works well for the 2 or 3 test cases you ran it on; but there are another 5-10 test cases i think you may have missed.
Comment #20
liquidcms commentedmore changes required to support this than i originally thought; but should all be done now. please retest with published 7.x-2.0 rel.
one slight downside to how this was done was that existing site settings.php configs are no longer valid (and as a result a site upgrading to 2.0 rel with settings.php set will no longer have their mail redirected). for those who don't use this on larger sites that have live QA servers you may not see the significance of this - but it is an issue. i could have coded to be backward compatible; but didn't bother - although i made some BOLD comments concerning this on the project page.
Comment #21
kenorb commentedSee also:
https://drupal.org/project/reroute_email