Since windows file sharing and hence the original samba had no concept of symlinks it would normally delete all of the folder tree through a symlink. However you might try changing to unix extensions = yes
as your OSX may understand this too.
From the page https://www.samba.org/samba/docs/man/manpages/smb.conf.5.html#UNIXEXTENSIONS
unix extensions (G)
This boolean parameter controls whether Samba implements the CIFS UNIX
extensions, as defined by HP. These extensions enable Samba to better
serve UNIX CIFS clients by supporting features such as symbolic links,
hard links, etc... These extensions require a similarly enabled
client, and are of no current use to Windows clients.
Note if this parameter is turned on, the wide links parameter will
automatically be disabled.
See the parameter allow insecure wide links if you wish to change this
coupling between the two parameters.
Default: unix extensions = yes
You may want to investigate the insecure wide links option more as you may want to turn that off to achieve the results you are after.
The above may still not work as you desire due to the way that many systems implement deleting a folder structure. Normally the sequence proceeds as
- client incorrectly detect object to be deleted is a folder structure instead of a symlink.
- client recursively proceed to the deepest levels of the tree and delete all contents of those folders.
- the client it works its way back from the deepest levels back to the folder you told it to delete, deleting those as it goes
- then finally once the folder is empty the client will send the command to delete the folder
- however because the folder is actually a symlink the host only deletes the symlink.
This is how the content of the target is deleted along with the symlink, but not the actual target folder.
Similarly when it is instructed to delete a symlinked file only the symlink is deleted. The issue with the symlinked folder structure is that the samba client sends the delete command to all of the content before instructing the server to delete the symlink to the folder.