5
Auto forwarding default behavior change (after upgrade to 8664)
Question asked by Sébastien Riccio - 12/30/2023 at 2:50 AM
Unanswered
Hello,

After upgrading our production server to build 8664 (from 8251), I've noticed that all our user auto forwards are now using their e-mail as from address and the fowarding address as recipients address.

Historically it was using the original sender and recipients, and used SRS to rewrite the sender (to avoid SPF issues).

I see there is a new option for this and that is should be enabled by default but, when creating a user from the API, it doesn't enable it by default.

Also it doesn't when creating the user from GUI:

It also seems it's turned off for all existing user forwards, which is quite a serious issue.
I can't find a way to enable the new setting for all users having existing auto fowards... 

Any idea how to handle this (except using the API to enable it for every user?)

EDIT: Actually it seems the toggle was turned on for existing forwards. Phew... I dodged a bullet here. However it still seems it's not turned on by defaut when creating new users.

Build 8629 (Aug 17, 2023)


  • Changed: "Keep original recipients when forwarded" renamed to "Keep original sender and recipients when forwarded" as it more closely describes how that functionality works.
  • Changed: Automated Forwarding's "Keep original recipient" setting enabled by default.
Sébastien Riccio
System & Network Admin

8 Replies

Reply to Thread
1
Ron Raley Replied
Agree. The option should be selected by default. We have also had to inform confused customers. 
0
Tan Replied
+1
0
Kyle Kerst Replied
Employee Post
I did a couple of quick tests on this but found this option enabled by default when creating accounts via the web interface either from the system administrator or domain administrator side. Are you only seeing this on API created users currently?
We may need to get a ticket started with you to dig into this some more.
Kyle Kerst System/Network Administrator SmarterTools Inc. (877) 357-6278 www.smartertools.com
0
Zach Sylvester Replied
Employee Post
Would you be able to share an example JSON object that you're passing in to create the user?

Thanks, 

Zach Sylvester System/Network Administrator SmarterTools Inc. (877) 357-6278 www.smartertools.com
0
Sébastien Riccio Replied
Hello Zach and Kyle,

Happy 2k24 to you (and everyone reading the thread).

I did a new test by creating a new domain and then creating a new mailbox in this domain from the GUI.
Here is the resulting autoforwarding configuration for the freshly created mailbox.


I've checked the settings.json of the freshly created user and I can see this:

Then, checking the freshly created domain settings.json, I can see this in "default_account_settings" object:

And in the main server settings.json, I find it there too in the "default_account_settings" object:

Just a guess, but, I would think that setting it to true in the server's main settings.json would enable it for newly created users or at least newly created domain users ?
I can't seem to find a place in the GUI to set the default server or domain or user value for this flag, so I think it would need us to stop the service to edit the files manually.

As for creating the user through the API from our panel:


And then when setting forward for the user:

We do not set explicitly the value of keepRecipients, so I guess it takes it would get server or domain default.

One interresting thing though is that looking at API calls for setUserDefaults, the parameter is listed in the API.
For system-wide
And for domains:

-- 

Another interresting thing is that for domains existing before we did the upgrade, I see, post-upgrade, in their settings.json files, that the flag is set to false.
It's also set to false on existing mailboxes settings.json files that had no forwarding addresses configured prior to the upgrade.

It looks to me that this flag was set to true ONLY for mailboxes that had already a forward configured prior to the upgrade, but for the domains of these mailboxes, the flag is also set to false in their domain settings.json.
So creating a new mailbox for these domain will also have this option off by default.

IMHO, in the upgrade process, this flag should be set to true at system level, for all existing domains and mailboxes and without any discrimination to keep the original behavior.
It looks like we'll have to use some API calls to set it for all our existing domains/mailboxes.

EDIT: After some hours of attempting to set the keepRecipients in system-wide user defaults and domain user defaults, I think it this is documented in the API but has no effect at all. It only works for a specific mailbox.

Kind regards.

Sébastien Riccio System & Network Admin https://swisscenter.com
0
Sébastien Riccio Replied
Out-of-topic but while looking around for this issue, I've noticed in "Error" log that since the upgrade, we have now these entries for any newly created domain and mailbox:

[2024.01.03] 03:43:07.748 [FileFunctions] File "G:\SmarterMail\Domains\testdomain.com\accounts.json" missing. No TMP file or Archived version found.
[2024.01.03] 03:43:07.748 [FileFunctions] File "G:\SmarterMail\Domains\testdomain.com\accounts.json" missing. No TMP file or Archived version found.
[2024.01.03] 03:43:07.779 [FileFunctions] File "G:\SmarterMail\Domains\testdomain.com\accounts.json" missing. No TMP file or Archived version found.
[2024.01.03] 03:43:07.779 [FileFunctions] File "G:\SmarterMail\Domains\testdomain.com\Users\postmaster\settings.json" missing. No TMP file or Archived version found.
[2024.01.03] 03:43:40.644 [FileFunctions] File "G:\SmarterMail\Domains\testdomain.com\Users\testuser\settings.json" missing. No TMP file or Archived version found.

Is that something expected ? 
It really made me think something went wrong when I created these test domain and test user. Should this appear for newly created domains and mailboxes ?
Our error log is configured on "Detailed" though.

Sébastien Riccio System & Network Admin https://swisscenter.com
1
Sébastien Riccio Replied
Well, having yet no solution provided and being unable to change this setting at system and domain level even through the API, I had to:

1) Stop the server
2) Replace "keep_recipients_on_forward":false flag to "keep_recipients_on_forward":true in:
  - main server settings.json file
  - all domains settings.json files
  - all mailboxes settings.json files
3) Start the server

Now:
- Newly created domains will have the setting enabled by default
- New mailboxes of existing domains will also have the setting enables
- All existing mailboxes have now the setting enabled (and not only the one with an existing forward)
(So back to the original behavior prior to update...)

Here is how I did it almost one-shot, using "sed" installed with bash prompt included in git for windows. Worked like a charm for me. I'm more comfortable with sed than with some PowerShell search and replace -in files stuff.

# Set setting to true server-wide
sed -i 's/\"keep_recipients_on_forward\"\:false/"keep_recipients_on_forward":true/g' "/C/Program Files (x86)/SmarterTools/SmarterMail/Service/Settings/settings.json"

# Set setting to true for existing domains
sed -i 's/\"keep_recipients_on_forward\"\:false/"keep_recipients_on_forward":true/g' /D/SmarterMail/Domains/*/settings.json

# Set setting to true for existing mailboxes
sed -i 's/\"keep_recipients_on_forward\"\:false/"keep_recipients_on_forward":true/g' /D/SmarterMail/Domains/*/Users/*/settings.json

DISCLAIMER: This will directly replace the setting in all system/domains/users json config files. Don't do it if you don't understand what you're doing. Also be sure to snapshot your VM first or at least have a backup in case of something is going wrong.  I take no responsability if something is going wrong.
Sébastien Riccio System & Network Admin https://swisscenter.com
1
Ron Raley Replied
Sébastien, you too brave yo.

Reply to Thread