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
431 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
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

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…
For beginners of Lotus Notes user this is important to know about the types of files and their location supported by IBM Notes. Mostly users are unaware about how many file types are created and what their usages are. This Article is fully dedicated…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

828 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