Email attachments from Domino Server to IFS share?
120 pts.
0
Q:
Email attachments from Domino Server to IFS share?
Can an agent extract email attachments from a user's mailbox, and move them to an IFS folder on another iSeries (AS400) box without notes cline running? 

We have a generic email account that receives email attachments, but there are no Notes Clients that will be watching it, so this agent would have to react when new mail is received, and extract the attachment and drop it in an IFS share.

Can this be done?



Software/Hardware used:
Domino 8.0.2 on iSeries
ASKED: Sep 14 2009  10:31 PM GMT
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
0
1610 pts.
0
A:
 RATE THIS ANSWER
0
Click to Vote:
  •   0
  •  0
  • AddThis Social Bookmark Button
Hi Hdwest61

Sure you can !
As you said, your agent have to be in the user mail box and will be run by the Domino server, trigered on the "New mail" event.
Create a special folder in the IFS where you will detache your documents.
I have some Lotus Script code to do that if you are interesting...
Last Answered: Sep 16 2009  6:00 AM GMT by BruceWayne   1610 pts.
0
0
Discuss This Answer:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _



_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

Hdwest61   120 pts.  |   Sep 16 2009  12:22PM GMT

Yes, I’m very interested in looking at the code.

I’ve been chasing down connections to DB2 in the hope I could get to IFS that way, but no luck.

 

DanTheDane   245 pts.  |   Sep 16 2009  1:39PM GMT

You are touching one of my challenges on my to-do list.. I’ll also be very grateful to see actual code. :-)
I’ll look forward andhope youwill publish the actual code.
Thanks in advance.

 

BruceWayne   1610 pts.  |   Sep 16 2009  2:14PM GMT

OK You will have this code.
Do you know LotusScript ? If i give you my code as is, do you will know how to adapt it (delete what you don’t need, change variables, and so on) or you prefer i give you the source a bit rewrited (with comment) ?
In the second case, you have to wait a couple of days cause i’m very busy now…
And sorry for my poor english !

 

Hdwest61   120 pts.  |   Sep 16 2009  3:50PM GMT

I can get by with the raw code.

I knwo VB, and have been working the LotusScrit for a while.

I can read the uncommented code and get what i need from it.

 

Hdwest61   120 pts.  |   Sep 17 2009  10:08PM GMT

Bruce… are you still out there?

 

BruceWayne   1610 pts.  |   Sep 18 2009  10:07AM GMT

Yep, here is the code :

OPTIONS
Option public
Option Declare
INITIALIZE
Dim s As New NotesSession
Dim db As NotesDatabase
Dim doc As NotesDocument
Dim viewInbox  As NotesView

Dim tabItem As Variant, tabTemp As Variant
Dim sPathFichierExport  As String
Dim  sPlateForme As String

Set db = s.CurrentDatabase
Set viewInBox = db.GetView( “($InBox)”  ) 

sPlateForme = s.Platform
If splateForme <> “Windows/32″ Then
	sPathFichierExport = “/MY_IFS_SHAREFOLDER_NAME/”
Else
	sPathFichierExport = “\MY_ISERIES_NAMEMY_IFS_SHAREFOLDER_NAME”
End If

Set doc = viewInBox.GetFirstDocument
Do While Not doc Is Nothing
	tabItem = doc.Items
	Forall ele In tabItem
		If ele.Type = RICHTEXT  Then
			tabTemp = ele.EmbeddedObjects
			If Not Isempty(tabTemp) Then
				Forall embobj In tabTemp
					If embobj.Type = EMBED_ATTACHMENT Then
						Call embObj.ExtractFile ( sPathFichierExport + <a href="http://embobj.Name" title="http://embobj. " target="_blank">embobj.Name</a> )
						‘ If file exists on the disk, then the attachment is removed !
						If yaFichier( sPathFichierExport + <a href="http://embobj.Name" title="http://embobj. " target="_blank">embobj.Name</a> ) = 1Then
							Call embObj.Remove
							Call doc.Save( True, False)
						End If
					End If
				End Forall
			End If
		End If
	End Forall
	Set doc = viewInBox.GetNextDocument( doc )
Loop

Quit:
	Exit Sub

ErrorHandler:
	Print “Erreur ligne ” & Erl & ” type ” & Err  & ” - ” & Error
	Goto Quit

Function YaFichier( strFichier As String ) As Integer
If Dir( strFichier , 0 ) = “” Then
YaFichier = 0
Else
YaFichier = 1
End If
End Function


 

Hdwest61   120 pts.  |   Sep 23 2009  12:06PM GMT

Here’s a link to what i ended up doing…

 <a href="http://itknowledgeexchange.techtarget.com/itanswers/notes-email-attachment-to-ifs-agent/#comments" title="http://itknowledgeexchange.techtarget.com/itanswers/notes-email-attachment-to-ifs-agent/#comments" target="_blank">http://itknowledgeexchange.techtarget.co…</a>

 
0