Rule "Reply" with included original message

Use this forum if you have problems with a hMailServer script, such as hMailServer WebAdmin or code in an event handler.
Post Reply
gruenie
Senior user
Senior user
Posts: 299
Joined: 2004-01-23 03:25
Location: Germany, Halle

Rule "Reply" with included original message

Post by gruenie » 2016-08-25 08:13

Hi dear professionals,
after a long time I have again a special problem and would ask for help.
I want to give users of an external mail-server the possibility to check their own "server-signature".
A server-signature is added by the mailserver when the mail is leaving the server, so the users cannot see their own signature while writing the message.
A normal "autoresponder" of an account in my mailserver does not work, because it only answer to the message but does not include the text of the original message. Same is when I use the rule "Reply".
I found one topic about this question here but I did not get exactly what I have to do. The task is only to send an "autoreply" to the user including his own message to show him his own signature.

Could someone please tell me step by step how I can realize it?

Thank you in advance!

Gruenie
Errare humanum est, sed in errare perseverare diabolicum!

gruenie
Senior user
Senior user
Posts: 299
Joined: 2004-01-23 03:25
Location: Germany, Halle

Re: Rule "Reply" with included original message

Post by gruenie » 2016-09-06 21:56

No one here, who could help me about this?
Errare humanum est, sed in errare perseverare diabolicum!

User avatar
mattg
Moderator
Moderator
Posts: 21115
Joined: 2007-06-14 05:12
Location: 'The Outback' Australia

Re: Rule "Reply" with included original message

Post by mattg » 2016-09-07 14:49

so you want someone here to code a script for you for free??
gruenie wrote:I want to give users of an external mail-server the possibility to check their own "server-signature".
This is built into the included PHPWebAdmin
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation

gruenie
Senior user
Senior user
Posts: 299
Joined: 2004-01-23 03:25
Location: Germany, Halle

Re: Rule "Reply" with included original message

Post by gruenie » 2016-09-07 23:38

Hi Mattg,
thank you for the answer.
But I don't understand. What is built into the included PHPWebAdmin?
I don't speak about the server-signature of the hmailserver itself.

I mean: The sense of the server-signature is, that it is added at the end of the mail by the server and the users can't see the signature.
I'm looking for a possibility that users of an external webserver can see their own server-signature.
I want to offer an mail-account in my server where they can send a short mail and will get an answer including their own mail.
An autpresponder does not send the original email back and with using the rule "Reply" it is the same. People get an answer but never their own mail is included.
I'm looking for a possibility to automatically reply to the mails with the original mail included.

Regards from Germany
Gruenie
Errare humanum est, sed in errare perseverare diabolicum!

User avatar
mattg
Moderator
Moderator
Posts: 21115
Joined: 2007-06-14 05:12
Location: 'The Outback' Australia

Re: Rule "Reply" with included original message

Post by mattg » 2016-09-08 00:09

gruenie wrote:I'm looking for a possibility that users of an external webserver can see their own server-signature.
PHPWebAdmin deos this (although not from an external webserver)
If a user logs into PHPWebAdmin using their user level account credentials, they can see and change their OWN account signature.

I think roundcube also does this
gruenie wrote:I'm looking for a possibility to automatically reply to the mails with the original mail included.
Yes, this needs to be written with a script, and then the function that does this called by a rule.

It's really not that hard (But I was hoping that you would have a crack it first yourself)

Something like this - add this function to your eventhandlers.vbs
(I use something similar to notify senders of mail not delivered after x hours)

Code: Select all

Function ReplyWithMessageAttached(oMessage)
	dim oApp, newMessage
	dim MessageSubject
	dim MessageRecipientAddress

	Set oApp = CreateObject("hMailServer.Application")

'	Give this script permission to access all
'	hMailServer settings.
	Call oApp.Authenticate("Administrator", g_sAdminPassword)

	MessageRecipientAddress = oMessage.FromAddress
	MessageSubject = "Automatic Reply"

	Set newMessage = CreateObject("hMailServer.Message")
	newMessage.From = "YourServer.com"
	newMessage.FromAddress = ""                                                  'can leave blank
	newMessage.Subject = "RE:- " & MessageSubject
	newMessage.AddRecipient oMessage.From, oMessage.FromAddress
	newMessage.Body = "Your Message with subject " & oMessage.subject & " is returned"
	newMessage.Body = NewMessage.body & vbCrLf & vbCrLf
	newMessage.Body = NewMessage.body & "The original message is attached"
	newMessage.Body = NewMessage.body & vbCrLf & vbCrLf

        ' add more 'standard' message content here
	
	newMessage.Attachments.Add(oMessage.Filename)
	newMessage.Save
End Function
And then in your rule you set an action of 'run function' with a value of 'ReplyWithMessageAttached'
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation

gruenie
Senior user
Senior user
Posts: 299
Joined: 2004-01-23 03:25
Location: Germany, Halle

Re: Rule "Reply" with included original message

Post by gruenie » 2016-09-08 01:48

Hello MattG,
thank you for your answer and the script.
That was exactly, what I was looking for and it works fine for me.
Thank you again for your help!
Kind regards
Gruenie
Errare humanum est, sed in errare perseverare diabolicum!

Post Reply