?
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
Medium Priority
?
444 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 24

Accepted Solution

by:
HemanthaKumar earned 2000 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

You’ve got a lotus Domino web server, and you have been told that “leverage browser caching” is a must do. This means that we have to tell the browser everywhere in the web to use cache. In other words, we set (and send) an expiration date in the HT…
I thought it will be a good idea to make a post as it will help in case someone else faces these issues. I trust this gives an idea how each entry in Notes.ini can mean a lot for the Domino Server to be functioning properly. This article discusses t…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses
Course of the Month9 days, 20 hours left to enroll

762 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