mendelson as2 - how to copy the file to other location - b2b

We are using mendelson as2 for B2B. It copies the sent file, by sender, to inbox folder of receiver. Can we instruct it to copy the same file to another location that we required?
Thanks in advance.

It's possible to define events per partner that are executed after receipt. Setup a script or command there that moves your file to the new location.

Related

Trigger a task on file Creates/Edits/Deletes in specific folder (AWS FSx)

I have a network path from AWS FSx (Already allowed Auditing from Folder's Advance Security Settings).
I need to log file Create/Delete/Edit on that network path from my server(Windows).
I tried to create a Custom view on Windows Event Viewer with event ID 4663.
But the problem is, that it shows logs from other folders as well.
I want to filter only the events from my network path and trigger a windows task, based on that Custom event view.
As it was a bit complicated to catch the detailed event from AWS, I changed the approach to accomplish my task.
I created a background worker to track all file changes in the given folder
using .Net Directory, File and FileSystemWatcher classes.

mutt + offlineimap and only few folder offline

I have been trying to understand offlineimap with mutt configuration but I probably do not. In the end, I realised that what i need is to have offline only e.b. Inbox and Sent. That configuration one can find on internet but I also need to be able to access the other folders in mutt but without having to download them offline.
E.g.
I want all mails in Inbox to be downloaded offline to the computer and mutt accessing them from the local repository. But I also need to access folder Inbox/SomeMore but without having to reconfigure mutt and offlineimap and most importantly without donwloading the whole content of that folder to the computer.
Is this doable? And exactly how?
offlineimap's job is to download mails and make them available in offline situations. There is no way to temporary download the content of some mail folders. It might be possible to go for a hacky solution. Specify the folders you don't want to sync with the folderfilter option and additionally set up mutt to access the other IMAP folders.
You can specify a folder filter that excludes specific folders. Instead of adding the subfolder's name to the list it might be even possible to exclude it like this INBOX/foo (in case of having multiple folders with the same name):
folderfilter = lambda folder: folder in ['INBOX', 'Sent', 'Drafts', 'Junk', 'foo', ...]
PS: If folderfilter is not specified at all, ALL remote folders will be synchronized.

SFTP file uploading and downloading at same time

A cronjob runs every 3 hours to download a file using SFTP. The scheduled program is written in Perl and the module used is Net::SFTP::Foreign.
Can the Net::SFTP::Foreign download files that are only partially uploaded using SFTP?
If so, do we need to check the SFTP file modified date to check copy process completion?
Suppose a new file is uploading by someone in SFTP and he file upload/copy is in progress. If a download is attempted at the same time, do I need to code for the possibility of fetching only part of a file?
It's not a question of the SFTP client you use, that's irrelevant. It's how the SFTP server handles the situation.
Some SFTP servers may lock the file being uploaded, preventing you from accessing it, while it is still being uploaded. But most SFTP servers, particularly the common OpenSSH SFTP server, won't lock the file.
There's no generic solution to this problem. Checking for timestamp or size changes may work for you, but it's hardly reliable.
There are some common workarounds to the problem:
Have the uploader upload "done" file once upload finishes. Make your program wait for the "done" file to appear.
You can have dedicated "upload" folder and have the uploader (atomically) move the uploaded file to "done" folder. Make your program look to the "done" folder only.
Have a file naming convention for files being uploaded (".filepart") and have the uploader (atomically) rename the file after upload to its final name. Make your program ignore the ".filepart" files.
See (my) article Locking files while uploading / Upload to temporary file name for example of implementing this approach.
Also, some FTP servers have this functionality built-in. For example ProFTPD with its HiddenStores directive.
A gross hack is to periodically check for file attributes (size and time) and consider the upload finished, if the attributes have not changed for some time interval.
You can also make use of the fact that some file formats have clear end-of-the-file marker (like XML or ZIP). So you know, when you download an incomplete file.
For details, see my answer to SFTP file lock mechanism.
The easiest way to do that when the upload process is also under your control, is to upload files using temporal names (for instance, foo-20170809.tgz.temp) and once the upload finishes, rename then (Net::SFTP::Foreign::put method supports the atomic option which does just that). Then on the download side, filter out the files with names corresponding to temporal files.
Anyway, Net::SFTP::Foreign get and rget methods can be instructed to resume a transfer passing the option resume => 1.
Also, if you have full SSH access to the SFTP server, you could check if some other process is still writing to the file to be downloaded using fuser or some similar tool (though, note that even then, the file may be incomplete if for instance there is some network issue and the uploader needs to reconnect before resuming the transfer).
You can check the size of the file.
Connect to SFTP.
Check file size.
Sleep for 5/10 seconds.
Check file size again.
If size did not change, download the file, if the size changed do step 3.

Is it possible to send a email through Batch file

Is it possible to send an email through a batch command line? I have a password batch file for a folder and when you fail three attempts i want it to send me an email. I know its possible to download ans install a program off the internet but when I would open the program it would close. So is there a command or program that sends and email through batch?
TakeCommand will enable all kinds of commandline-magic, including sending of mail. Alkternatively, if you have a local install of PHP (and properly set it up), you could write a PHP-Script to send mail and launch the PHP-Interpreter (in your batch) to execute that file.

File Listener in Ensemble/CachObjectscript

I am new to ensemble. I would like to know, whether there is any thing like filesystemwatcher in Cache/Ensemble. (Note : filesystemwatcher is in .Net)
My requirement is as follows, My Ensemble production (Business Process) will drop a file in a folder, in that folder a windows service will process the file and replace this file with a new file.
My Business process should wait till the new file is available in the folder and start resuming the process.
Please let me know if this is possible in Ensemble.
Yes - the File Inbound Adapter is most likely what you are looking for. See http://docs.intersystems.com/ens20141/csp/docbook/DocBook.UI.Page.cls?KEY=EFIL_inbound for details.