-1

I have a requirement where I intend to build a tool to scan the email contents including the attachments. The email servers is either going to be SendMail or z/OS Communication Server, both support SMTP. The sever is not Miscrosoft implementation so MAPI or Outlook API is not there into picture. The tool would be Java based code and basically need to look for contents that are not-permitted based on some rules. What are my options here? There is the possibility of using a proxy server but we are looking for a more direct approach.

User2709
  • 573
  • 5
  • 17
  • On which side do you want to intercept the mail, between client and the server? Can you install the software on the server? – stjepano Mar 01 '16 at 11:42
  • On the server. The idea is to prevent the mail from going out if the tool detects a rule violation. – User2709 Mar 01 '16 at 11:43
  • if you can install the software on the server then your best option is to implement (or extend) SMTP proxy which will scan the email and based on your rule set forward the mail to real SMTP server or reject it. Are you sure you can't configure existing SMTP server to do that. – stjepano Mar 01 '16 at 11:45
  • @stjepano We can do that. That is one of the option as I listed in my question but I am looking for something more direct avoiding the need of a proxy server. – User2709 Mar 01 '16 at 11:47
  • Best approach is to implement your rule set to existing SMTP server (no proxy). Many servers allow for that kind of extensions. You can also implement rules on clients if this is possible. – stjepano Mar 01 '16 at 11:49
  • Why did you tagged the question with java? I am commenting on this from a standpoint of Java developer. – stjepano Mar 01 '16 at 11:50
  • @stjepano Because the rules would be implemented in java and they will be part of the scanning tool. – User2709 Mar 01 '16 at 11:52

1 Answers1

1

The z/OS Communication Server SMTP implementation has a built-in "exit" capability - see http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/F1A1B4B0/30.3?DT=20110609204120#HDRWQ1299.

The exit is called for just about any SMTP activity and it can examine, change or reject just about anything based on the rules you establish. It is generally written in IBM Assembler Language, but there's no reason you couldn't have a thin assembler layer that passes data to a Java app using whatever protocol you like (say, a pipe or a socket).

There are many little details to handle, such as character encoding (EBCDIC vs. ASCII or UTF-8, for example) plus weeding out attachments from email content. But using the exit preserves all the z/OS specific features of IBM's SMPT server without trying to recreate any of that yourself.

Good luck!

Valerie R
  • 1,769
  • 9
  • 29
  • I think that is what exactly I need, I will give that a try. Thanks. – User2709 Mar 07 '16 at 07:00
  • Glad to help...the hardest part will be the assembler language exit itself. Although IBM doesn't document it that way, I believe their SMTP server is actually a C/C++ program...this means there would be an LE runtime associated with this process, and so if you're careful, you might be able to do the exit in C, and this would probably make getting to your Java code much less cumbersome to develop if you're not a hardcore assembler developer. – Valerie R Mar 10 '16 at 15:13