Page 1 of 1

Trailing Space When Using Mail Receive

Posted: Mon Nov 28, 2016 6:29 pm
by rgpepper
When using the Mail Receive configurator, a random email will come through with a trailing space in the subject, which results in a folder being created (using Switch on Windows) on a Windows server with a space at the end, which is a problem - it can only be deleted from the command prompt. So you end up with this folder that you (practically) can't delete.

Any tricks to not allow this to happen or to strip the space off the end before creating the directory?

Re: Trailing Space When Using Mail Receive

Posted: Mon Nov 28, 2016 7:33 pm
by gabrielp
Hey man,
That's what switch-variable-scrubber was designed to do. I haven't used the mail receive before, but if you can get the subject as a variable and then scrub it before making the folder with it, it should give you the desired result.

Otherwise, you can probably apply some sort of regex with a variable expression to specifically look for and remove trailing spaces on that variable.

Re: Trailing Space When Using Mail Receive

Posted: Tue Nov 29, 2016 8:52 am
by freddyp
When using a variable that is a string you can always trim or norm it. Trimming means: remove leading and trailing spaces, norming means trimming and replacing multiple spaces by one space.

If you are collecting the mail files into a job folder, rename that job by replacing the name of the job by [Job.Name:Space="norm"]. If you are using the mail subject in "Set hierarchy path" then you simply set the path to [Job.Name:Space="norm"].

Re: Trailing Space When Using Mail Receive

Posted: Tue Nov 29, 2016 11:06 pm
by rgpepper
I'm first trying your suggestion Freddy thanks, that's the kind of solution I was envisioning.