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
427 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
ID: 9753924
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
ID: 9753937
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
ID: 9754024
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
Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

 
LVL 24

Accepted Solution

by:
HemanthaKumar earned 500 total points
ID: 9754052
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
ID: 9756991
Workin' hard baby!

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

Expert Comment

by:HemanthaKumar
ID: 9758695
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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

For users on the Lotus Notes 8 Standard client, this article provides information on checking the Java Heap size and adjusting it to half of your system RAM in attempt to get the Lotus Notes 8.x Standard client to run faster.  I've had to exercise t…
Lack of Storage capacity is a common problem that exists in every field of life. Here we are taking the case of Lotus Notes Emails, as we all know that we are totally depend on e-communication i.e. Emails. This article is fully dedicated to resolvin…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

786 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