I'm trying to tweak roundcubemail to allow recipient addresses without a domain - e.g., "billy" instead of "billy@example.com". I'm sure this is completely invalid, but postfix and my old webmail will tolerate it for local users.
I'd like to do this "correctly" rather than just hack my changes in so as to avoid upgrade problems later on (at least as much as possible). Adding a config setting to selectively enable the behavior is straightforward on the PHP side, but there's also a javascript-based validation I need to bypass. Does the project have any standard or recommended way for exposing main.inc.php settings to javascript?
Patch of what I changed is attached if it helps clarify. For the sake of readability, it references the .js.src file instead of the minified one.
--- 8< --- detachments --- 8< --- The following attachments have been detached and are available for viewing. http://detached.gigo.com/rc/ca/aCDpcLdH/rcm-omit-domain.patc.gz Only click these links if you trust the sender, as well as this message. --- 8< --- detachments --- 8< ---
List info: http://lists.roundcube.net/dev/ BT/aba52c80
On Tue, Feb 21, 2012 at 22:25, Andy Theuninck gohanman@gmail.com wrote:
I'm trying to tweak roundcubemail to allow recipient addresses without a domain - e.g., "billy" instead of "billy@example.com". I'm sure this is completely invalid, but postfix and my old webmail will tolerate it for local users.
I assume you're not the only one with such a configuration.
I'd like to do this "correctly" rather than just hack my changes in so as to avoid upgrade problems later on (at least as much as possible). Adding a config setting to selectively enable the behavior is straightforward on the PHP side, but there's also a javascript-based validation I need to bypass. Does the project have any standard or recommended way for exposing main.inc.php settings to javascript?
The preferred way to pass config options to the client script is something like this:
$RCMAIL->output->set_env('allow_omit_domain', $RCMAIL->config->get('smtp_allow_omit_domain', false);
On the client you can access the property with rcmail.env.allow_omit_domain. For this specific case I'd suggest to pass the option as an additional argument when calling rcube_check_email() from with in the rcmail class:
rcube_check_email('<email>', true, this.env.allow_omit_domain);
I hope this helps...
~Thomas _______________________________________________ List info: http://lists.roundcube.net/dev/ BT/aba52c80
The preferred way to pass config options to the client script is something like this:
$RCMAIL->output->set_env('allow_omit_domain', $RCMAIL->config->get('smtp_allow_omit_domain', false);
On the client you can access the property with rcmail.env.allow_omit_domain. For this specific case I'd suggest to pass the option as an additional argument when calling rcube_check_email() from with in the rcmail class:
rcube_check_email('<email>', true, this.env.allow_omit_domain);
Thanks, exactly what I was looking for. _______________________________________________ List info: http://lists.roundcube.net/dev/ BT/aba52c80