copy message and remove recipient

Use this forum if you have problems with a hMailServer script, such as hMailServer WebAdmin or code in an event handler.
Post Reply
FieryPhoenix1
New user
New user
Posts: 10
Joined: 2019-12-06 08:30

copy message and remove recipient

Post by FieryPhoenix1 » 2019-12-06 11:52

Dear All

This is what I have:

user uses webform which sends a message to secretaddress@domain.com
message is forwarded to contact@domain.com
we reply to message from contact@domain.com

However the secretaddress@domain.com is still in the e-mail

This is what I would like:

user uses webform which sends a message to secretaddress@domain.com
copy message contents and sender's address
send message to contact@domain.com
we reply to message from contact@domain.com
then Secretaddress@domain.com is not present in e-mail.

This is a method to stop people contacting us directly without using the webform

I also want to send an auto-reply to the sender from noreply@domain.com while we look at their message, but I can use a simple rule for that.

I have searched high and low for hours and can't seem to find a script that does this

Any help would be appreciated

Thanks

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

Re: copy message and remove recipient

Post by mattg » 2019-12-07 05:20

Why not do the other way around

user uses webform which sends a message to contact@domain.com
message is forwarded to secretaddress@domain.com
we reply to message from contact@domain.com
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation

FieryPhoenix1
New user
New user
Posts: 10
Joined: 2019-12-06 08:30

Re: copy message and remove recipient

Post by FieryPhoenix1 » 2019-12-07 15:06

thx for reply

what would be the point of that? The secretaddess@domain.com would still be in the e-mail and someone could still bypass the webform and e-mail us directly

anyway it would still be good to know if it's possible to do what I've requested

if it's not possible I might just send a message directly from the form to contact@domain.com, do an auto reply from noreply@domain.com and hope that no one figures out how to spam us with contact@domain.com

palinka
Senior user
Senior user
Posts: 1562
Joined: 2017-09-12 17:57

Re: copy message and remove recipient

Post by palinka » 2019-12-07 16:10

I don't understand the point of the secret address. The contact address is not revealed in the web form, so why bother with it?

In web forms I've created, you can't see the email address. Is yours different?

User avatar
katip
Senior user
Senior user
Posts: 732
Joined: 2006-12-22 07:58
Location: Istanbul

Re: copy message and remove recipient

Post by katip » 2019-12-07 18:10

FieryPhoenix1 wrote:
2019-12-06 11:52
Dear All

This is what I have:

user uses webform which sends a message to secretaddress@domain.com
message is forwarded to contact@domain.com
we reply to message from contact@domain.com

However the secretaddress@domain.com is still in the e-mail
i understand that the probem is message header TO which is secretaddress@domain.com, written by that webform, and you don't like to disclose it.
have you tried to change it to contact@domain.com with a global rule ("Set header value" action)?
Katip
--
HMS 5.7.0 x64, MariaDB 10.4.10 x64, SA 3.4.2, ClamAV 0.101.2 + SaneS

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

Re: copy message and remove recipient

Post by mattg » 2019-12-08 04:00

mattg wrote:
2019-12-07 05:20
Why not do the other way around

user uses webform which sends a message to contact@domain.com
message is forwarded to secretaddress@domain.com
we reply to message from contact@domain.com
FieryPhoenix1 wrote:
2019-12-07 15:06
The secretaddess@domain.com would still be in the e-mail
How would it be in the email sent to the unknown client address if you reply from 'contact@doamin.com'...?
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation

FieryPhoenix1
New user
New user
Posts: 10
Joined: 2019-12-06 08:30

Re: copy message and remove recipient

Post by FieryPhoenix1 » 2019-12-08 11:43

palinka wrote:
2019-12-07 16:10
I don't understand the point of the secret address. The contact address is not revealed in the web form, so why bother with it?

In web forms I've created, you can't see the email address. Is yours different?
Yes that's true, the e-mail address is not visible. However it's good to know if it's possible to change a message from code but in this case I don't think I need to. I might as well just use the contact@domain.com address.

FieryPhoenix1
New user
New user
Posts: 10
Joined: 2019-12-06 08:30

Re: copy message and remove recipient

Post by FieryPhoenix1 » 2019-12-08 11:44

mattg wrote:
2019-12-08 04:00
mattg wrote:
2019-12-07 05:20
Why not do the other way around

user uses webform which sends a message to contact@domain.com
message is forwarded to secretaddress@domain.com
we reply to message from contact@domain.com
FieryPhoenix1 wrote:
2019-12-07 15:06
The secretaddess@domain.com would still be in the e-mail
How would it be in the email sent to the unknown client address if you reply from 'contact@doamin.com'...?
Because it's visible in the message when you forward it

FieryPhoenix1
New user
New user
Posts: 10
Joined: 2019-12-06 08:30

Re: copy message and remove recipient

Post by FieryPhoenix1 » 2019-12-08 11:45

katip wrote:
2019-12-07 18:10
FieryPhoenix1 wrote:
2019-12-06 11:52
Dear All

This is what I have:

user uses webform which sends a message to secretaddress@domain.com
message is forwarded to contact@domain.com
we reply to message from contact@domain.com

However the secretaddress@domain.com is still in the e-mail
i understand that the probem is message header TO which is secretaddress@domain.com, written by that webform, and you don't like to disclose it.
have you tried to change it to contact@domain.com with a global rule ("Set header value" action)?
yes I thought about that but found the To address is Read Only

palinka
Senior user
Senior user
Posts: 1562
Joined: 2017-09-12 17:57

Re: copy message and remove recipient

Post by palinka » 2019-12-08 14:08

Maybe just use secretaddress as an alias to contact.

Or if you really want to get creative:

Enable plus addressing
Use "a" as the secret address
Make "a" an alias to contact
In your form, make the email address a+<random string>
:mrgreen:

Or the same except a+<sender address> but you'd have to replace @ and . with something that could actually be received and transformed back into an email address, like _at_ and _dot_ or whatever.

a+sender_at_hisdomain_dot_com@yourdomain.com

Then you could reply as contact without doing anything special, and you may be able to use what you garner from the alias address as something.

Those things are kind of silly, of course, but could be fun just for the sake of doing it.

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

Re: copy message and remove recipient

Post by mattg » 2019-12-08 16:41

FieryPhoenix1 wrote:
2019-12-08 11:44
mattg wrote:
2019-12-08 04:00
mattg wrote:
2019-12-07 05:20
Why not do the other way around

user uses webform which sends a message to contact@domain.com
message is forwarded to secretaddress@domain.com
we reply to message from contact@domain.com
FieryPhoenix1 wrote:
2019-12-07 15:06
The secretaddess@domain.com would still be in the e-mail
How would it be in the email sent to the unknown client address if you reply from 'contact@doamin.com'...?
Because it's visible in the message when you forward it
But only if you forward or reply to the message from the secretaddress@domain.com address. It doesn't exist at the message stored at contact@domain.com

What am I missing here?
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation

User avatar
katip
Senior user
Senior user
Posts: 732
Joined: 2006-12-22 07:58
Location: Istanbul

Re: copy message and remove recipient

Post by katip » 2019-12-08 16:51

FieryPhoenix1 wrote:
2019-12-08 11:44
Because it's visible in the message when you forward it
let's be precise. where is it visible when you forward/reply it? in the headers or body of your forward/reply?

if in the body, you can:
1. either delete it manually each time
2. or adjust settings in your mail client, see section about replying/forwarding format.

if in headers, there is something wrong or i don't understand.

//EDIT: more or less the same what mattg wrote just before i submit.
Katip
--
HMS 5.7.0 x64, MariaDB 10.4.10 x64, SA 3.4.2, ClamAV 0.101.2 + SaneS

FieryPhoenix1
New user
New user
Posts: 10
Joined: 2019-12-06 08:30

Re: copy message and remove recipient

Post by FieryPhoenix1 » 2019-12-09 03:11

mattg wrote:
2019-12-08 16:41
FieryPhoenix1 wrote:
2019-12-08 11:44
mattg wrote:
2019-12-08 04:00



How would it be in the email sent to the unknown client address if you reply from 'contact@doamin.com'...?
Because it's visible in the message when you forward it
But only if you forward or reply to the message from the secretaddress@domain.com address. It doesn't exist at the message stored at contact@domain.com

What am I missing here?
It's in the body as you would find in any forwarded email. It shows the original recipient, in this case secretaddress@domain.com

FieryPhoenix1
New user
New user
Posts: 10
Joined: 2019-12-06 08:30

Re: copy message and remove recipient

Post by FieryPhoenix1 » 2019-12-09 03:12

katip wrote:
2019-12-08 16:51
FieryPhoenix1 wrote:
2019-12-08 11:44
Because it's visible in the message when you forward it
let's be precise. where is it visible when you forward/reply it? in the headers or body of your forward/reply?

if in the body, you can:
1. either delete it manually each time
2. or adjust settings in your mail client, see section about replying/forwarding format.

if in headers, there is something wrong or i don't understand.

//EDIT: more or less the same what mattg wrote just before i submit.
Yes I am deleting it manually each time which is why I want to automate the process

FieryPhoenix1
New user
New user
Posts: 10
Joined: 2019-12-06 08:30

Re: copy message and remove recipient

Post by FieryPhoenix1 » 2019-12-09 03:15

palinka wrote:
2019-12-08 14:08
Maybe just use secretaddress as an alias to contact.

Or if you really want to get creative:

Enable plus addressing
Use "a" as the secret address
Make "a" an alias to contact
In your form, make the email address a+<random string>
:mrgreen:

Or the same except a+<sender address> but you'd have to replace @ and . with something that could actually be received and transformed back into an email address, like _at_ and _dot_ or whatever.

a+sender_at_hisdomain_dot_com@yourdomain.com

Then you could reply as contact without doing anything special, and you may be able to use what you garner from the alias address as something.

Those things are kind of silly, of course, but could be fun just for the sake of doing it.
I was hoping someone could provide a snippet of code which I could call as a function to delete any trace of secretaddress@domain.com and forward it as a new/copied message to contact@domain.com

User avatar
katip
Senior user
Senior user
Posts: 732
Joined: 2006-12-22 07:58
Location: Istanbul

Re: copy message and remove recipient

Post by katip » 2019-12-09 05:33

FieryPhoenix1 wrote:
2019-12-08 11:45
katip wrote:
2019-12-07 18:10
i understand that the probem is message header TO which is secretaddress@domain.com, written by that webform, and you don't like to disclose it.
have you tried to change it to contact@domain.com with a global rule ("Set header value" action)?
yes I thought about that but found the To address is Read Only
why, how read only? Global rule:
IF To contains secretaddress@domain.com
Set header value To contact@domain.com

when you hit reply or forward, body shows as if original mail was sent directly to contact@domain.com
no trace remains from secretaddress@domain.com
Katip
--
HMS 5.7.0 x64, MariaDB 10.4.10 x64, SA 3.4.2, ClamAV 0.101.2 + SaneS

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

Re: copy message and remove recipient

Post by mattg » 2019-12-09 06:00

FieryPhoenix1 wrote:
2019-12-09 03:11
It's in the body as you would find in any forwarded email. It shows the original recipient, in this case secretaddress@domain.com
Which is EXACTLY why I said
mattg wrote:
2019-12-07 05:20
Why not do the other way around

user uses webform which sends a message to contact@domain.com
message is forwarded to secretaddress@domain.com
we reply to message from contact@domain.com
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation

FieryPhoenix1
New user
New user
Posts: 10
Joined: 2019-12-06 08:30

Re: copy message and remove recipient

Post by FieryPhoenix1 » 2019-12-09 12:05

katip wrote:
2019-12-09 05:33
FieryPhoenix1 wrote:
2019-12-08 11:45
katip wrote:
2019-12-07 18:10
i understand that the probem is message header TO which is secretaddress@domain.com, written by that webform, and you don't like to disclose it.
have you tried to change it to contact@domain.com with a global rule ("Set header value" action)?
yes I thought about that but found the To address is Read Only
why, how read only? Global rule:
IF To contains secretaddress@domain.com
Set header value To contact@domain.com

when you hit reply or forward, body shows as if original mail was sent directly to contact@domain.com
no trace remains from secretaddress@domain.com
do you have the code for this? I couldn't get it to work....

FieryPhoenix1
New user
New user
Posts: 10
Joined: 2019-12-06 08:30

Re: copy message and remove recipient

Post by FieryPhoenix1 » 2019-12-09 12:15

mattg wrote:
2019-12-09 06:00
FieryPhoenix1 wrote:
2019-12-09 03:11
It's in the body as you would find in any forwarded email. It shows the original recipient, in this case secretaddress@domain.com
Which is EXACTLY why I said
mattg wrote:
2019-12-07 05:20
Why not do the other way around

user uses webform which sends a message to contact@domain.com
message is forwarded to secretaddress@domain.com
we reply to message from contact@domain.com
yes and I said

"if it's not possible I might just send a message directly from the form to contact@domain.com, do an auto reply from noreply@domain.com and hope that no one figures out how to spam us with contact@domain.com"

Looking at the responses on this thread I realise that there's no danger of spam via the webform unless they guess that I'm using contact@domain.com which is why I wanted secretaddress@domain.com. I think I'll go with your suggestion mattg but I would also like to see if it's possible to modify a message in case I need it for the future. The expertise on this forum is impressive

Post Reply