Solved

How do I preserve the "From" and "Subject" info when using an agent to foward mail to an outside address?

Posted on 2003-11-14
6
416 Views
Last Modified: 2013-12-18
I'd like to be able to forward a copy of all incoming email to an external email address AND preserve the "From" and "Subject" information. I have an agent working and it is successfully forwarding the email, but each mail item is from "me" with a blank "subject".
0
Comment
Question by:pezimadio
  • 5
6 Comments
 
LVL 24

Expert Comment

by:HemanthaKumar
Comment Utility
In order to accomplish that you have to set the "Forwarding address" field in your persons document of Domino Directory to your internet/Alt EMail address

~Hemanth
0
 
LVL 24

Expert Comment

by:HemanthaKumar
Comment Utility
If you run it using agent, the agent signer (Person who saved the agent) becomes the sender for any such forwarded mails. So there is not exactly a straight forward way to do it using agent. But for blank subject that can be avoided.. And it depends upon how you set the agent.. If it is using SImple actions, then click on More button next to subject field this will open another dialog where you can set text or formula.. For Subject field set formula to Subject.. THis is the name of the field that is being used in you mail to show subject.

0
 
LVL 24

Expert Comment

by:HemanthaKumar
Comment Utility
The above soln does have one handicap, that is when you set forwarding address in person doc.. the mail is no more stored in your lotus notes mail db, it is routed to your alt address. If you need to setup a copy in your notes db and as well forward it to alt email.. Check this soln out: http://searchdomino.techtarget.com/tip/1,289483,sid4_gci541500,00.html But this involves alteration of mail design.

Check out other alternate tips here
http://searchdomino.techtarget.com/tip/1,289483,sid4_gci814888,00.html

http://searchdomino.techtarget.com/tip/1,289483,sid4_gci756842,00.html

For some reason if you couldn't get to this web documents let me know I can paste the soln here.

0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 24

Accepted Solution

by:
HemanthaKumar earned 500 total points
Comment Utility
I think the first link gives you what you need.

Just copy the script and paste it into your forwarding agent.

Agent is set to run before email arrives

Sub Initialize
    Dim s As New NotesSession
    Dim db As NotesDatabase
    Dim doc As NotesDocument
    Dim mdoc As NotesDocument
    Dim item As NotesItem
    Dim recipient As String
    Dim deletemail As String
    Dim pdoc As NotesDocument
    Dim agentLog As New NotesLog("Agent log")
    Call agentLog.OpenAgentLog
    Call agentLog.LogAction("SendMemo routine begin")
    Set db = s.CurrentDatabase
    Dim mailbox As New NotesDatabase("","")
    Call mailbox.Open(db.server,"mail1.box") ' Get handle to mail.box on the users current mail server
    Set doc = s.DocumentContext
    Set pdoc = db.GetProfileDocument("Calendar Profile")
    If Not pdoc Is Nothing Then
       recipient = pdoc.Forward_Address(0)
       'Check to see if they want the mail deleted from the server copy
       deletemail = pdoc.Delete_Mail(0)
       Call agentLog.LogAction("Recipient = " & recipient)
    Else
       End
    End If
    If Not doc Is Nothing Then
       'Make sure the doc is not a Delivery Failure
       If doc.form(0) <> "NonDelivery Report" Then
           Call agentLog.LogAction("doc found")
           Set mdoc = mailbox.CreateDocument
           mdoc.form = "Memo"
           mdoc.subject = doc.subject(0)
           If doc.from(0) <> "" Then
                 mdoc.from = doc.from(0)
                 mdoc.principal = doc.from(0)
                 mdoc.SendFrom = doc.from(0)
                 Call agentLog.LogAction("Sender = " & doc.from(0))           Else
                 mdoc.from = doc.principal(0)
                 mdoc.principal = doc.principal(0)
                 mdoc.SendFrom = doc.principal(0)
                 Call agentLog.LogAction("Sender = " & doc.principal(0))
          End If
          mdoc.PostedDate = Now()
          mdoc.ComposedDate = Now()
          mdoc.DeliveryDate = Now()
          mdoc.EncryptOnSend=False
          mdoc.sendto = recipient
          mdoc.Recipients = recipient           Set item = doc.GetFirstItem("Body")
          Call item.CopyItemToDocument( mdoc, "" )
          Call agentLog.LogAction("creating copy in mail1.box db")
          Call mdoc.Save(True,False) ' Save the document in the mail.box ( simulates a send)
          If deletemail = "Do not save a copy of mail in SLOC account" Then
                 Call doc.Remove(True)
           End If
       End If
    End If
    End
End Sub

0
 
LVL 31

Expert Comment

by:qwaletee
Comment Utility
Workin' hard baby!

Of course, there's one serious flaw in your code.
0
 
LVL 24

Expert Comment

by:HemanthaKumar
Comment Utility
Not more than you... Staying up all night and doing EE Consultancy !!

Well that code is provided as is ! Let him check it out before jumping to conclusion.
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

For Desktop Techs: How to retain a user's Notes configuration data when swapping out the end user's computer. (Assuming that you are not upgrading to a completely different version of Notes client) All you need to do is: 1) install Notes o…
  In today’s Arena we can’t imagine our lives without Internet as we are highly used to of it. If we consider our life style just for only 2 min we found that face to face communication is swapped by e-communication.  Every Where from Works place to…
This video discusses moving either the default database or any database to a new volume.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now