Trailing Space When Using Mail Receive

Post Reply
rgpepper
Member
Posts: 38
Joined: Wed Oct 14, 2015 2:09 am

Trailing Space When Using Mail Receive

Post 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?
User avatar
gabrielp
Advanced member
Posts: 577
Joined: Fri Aug 08, 2014 4:31 pm
Location: Boston
Contact:

Re: Trailing Space When Using Mail Receive

Post 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.
Chat: open-automation @ gitter
Code: open-automation & dominickp @ GitHub
Tools: Switch, Pitstop, EPMS, Veracore, PageDNA, SmartStream, Metrix
freddyp
Advanced member
Posts: 413
Joined: Thu Feb 09, 2012 3:53 pm

Re: Trailing Space When Using Mail Receive

Post 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"].
rgpepper
Member
Posts: 38
Joined: Wed Oct 14, 2015 2:09 am

Re: Trailing Space When Using Mail Receive

Post by rgpepper »

I'm first trying your suggestion Freddy thanks, that's the kind of solution I was envisioning.
Post Reply