appending the recipient email address to message body in a image element src as its sent

Use this forum if you have problems with a hMailServer script, such as hMailServer WebAdmin or code in an event handler.
Post Reply
TonyRusso
New user
New user
Posts: 10
Joined: 2018-07-09 15:52

appending the recipient email address to message body in a image element src as its sent

Post by TonyRusso » 2020-11-22 04:02

1.) Does HMS individually send to each recipient even when they have the same (local or remote) domain.

2.) Is there an event when each recipient is being sent?

For example:
Local message with 2 TO address, 1 CC address and 1 BCC address (they can be a combination of local and remote domains).

TO:
Sam@xyz_domain.com;
Joe@domain_abc.com;

CC:
Ralph@xyz_domain.com;

BCC:
archive@qrt_domain.com;


We have a test script using oMessage in Sub OnDeliverMessage, conditionally for 1 specific recipient will add a unique html img element. However it seems OnDeliverMessage is well before sending individually to each receipient at a time because the the link is the same for everyone.

Is it possible using oMessage in something like OnDeliverMessage, or OnDeliveryStart or some other event to detect when each recipient is sent the message so we can append a unique html image src url containing the receipients email address as a path?

For example, when sending to:
Sam@xyz_domain.com append <img src="http://ourserver.com/Sam@xyz_domain.com/logo.png
Joe@domain_abc.com append <img src="http://ourserver.com/Joe@domain_abc.com/logo.png
Ralph@xyz_domain.com append <img src="http://ourserver.com/Ralph@xyz_domain.com/logo.png
Nothing to BCC address.

Notes:
For production will encode the email address to be sure it does not break URL rules.
Our web server will rewrite the URL from a URL/path to URL/query string example:

Code: Select all

http://ourserver.com/Sam@xyz_domain.com/logo.png
TO
http://ourserver.com/ourscript.php?v1=logo.png&v2=Sam@xyz_domain.com 
ourscript.php sends the logo to email client.

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

Re: appending the recipient email address to message body in a image element src as its sent

Post by mattg » 2020-11-22 05:12

The way that email works

TonyRusso wrote:
2020-11-22 04:02
For example:
Local message with 2 TO address, 1 CC address and 1 BCC address (they can be a combination of local and remote domains).

TO:
Sam@xyz_domain.com;
Joe@domain_abc.com;

CC:
Ralph@xyz_domain.com;

BCC:
archive@qrt_domain.com;



Sam and Ralph are likely to have the same email connection from your mailserver to the mailserver for 'xyz_domain.com', and the email will be sent once with both recipients receiving a copy. This can be overridden n hmailserver by setting 'SMTP >> Advanced >> Maximum number of recipients in batch' to ONE.

HOWEVER- An identical copy will be sent to Joe, and the message must be EXACTLY the same, or technically it would be a different email.

All BCC recipients will be sent a copy in an individual connection.


What you are wanting requires FOUR SEPARATE distinct emails to be sent.
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation

TonyRusso
New user
New user
Posts: 10
Joined: 2018-07-09 15:52

Re: appending the recipient email address to message body in a image element src as its sent

Post by TonyRusso » 2020-11-22 07:40

The ability to provide analytics such as when an email is opened (read) by each recipient email address and datetime by tracking each time the image is requested by the email client. With a unique identifier such as an email address or a hash of the email address we can identify when each recipient has opened the email.

Currently we can only track when any recipient opens the email and datetime. For example if an email has 4 recipients (one is a BCC). and only 2 recipients opened the email we don't which recipient opened the email, and no way to exclude the BCC address.

Other than adding a script, the only other way is to send the email 4 times so we know who opened the email. However that presents a problem where there would be no indication it was sent to others.

This technique of tracking image downloads has it's own set of issues, but considered way more reliable than SMTP Delivery and Read Receipts which are extremely unreliable.

User avatar
SorenR
Senior user
Senior user
Posts: 3818
Joined: 2006-08-21 15:38
Location: Denmark

Re: appending the recipient email address to message body in a image element src as its sent

Post by SorenR » 2020-11-22 13:43

TonyRusso wrote:
2020-11-22 07:40
The ability to provide analytics such as when an email is opened (read) by each recipient email address and datetime by tracking each time the image is requested by the email client. With a unique identifier such as an email address or a hash of the email address we can identify when each recipient has opened the email.
Analytics ??? You mean spying ???

Why, do you think, do most email applications require confirmation to show pictures in emails today?

I hope you don't do that on European customers. “delivery receipt” or “read receipt” are accepted, Email tracking, on the other hand, utilizes hidden tracking pixels (also referred to as “web bugs,” “web beacons,” “pixel tags,” “clear GIFs” and other monikers) to collect significantly more personal data from email recipients is by default regarded a violation of GDPR unless client specifically gave permission.

Just a good advice ... Bring your BIG wallet when they fine you.
SørenR.

“Those who don't know history are doomed to repeat it.”
― Edmund Burke

TonyRusso
New user
New user
Posts: 10
Joined: 2018-07-09 15:52

Re: appending the recipient email address to message body in a image element src as its sent

Post by TonyRusso » 2020-11-22 18:01

Are you able to help us accomplish want we need to do using with HMS?


I was hoping when you asked why, you wanted to better understand technically what we were doing.

Instead of sending a private message, it seems to me you took the opportunity publicly admonished and cast doubt about our motives without knowing our business.
  • We are not a marketing company.
  • We do not spy on anyone!
  • We are an ethical business operating well within the legal and moral laws.
Our business is to provide Compliance Management Services to our customers and their board of directors for their business rules.

This is about reliable data and fairness.

Our customer's members are contractually required to abide the agreed upon rules if they wish to use their service.

There are too many members and not enough hours in a day for our customers to manually detect violations then personally call each members or office.

We send warning email notifications to their members and offices to inform them of a potential violation with time to correct before it become a finable offense.

So we would like to further enhance our ability to know which recipient has opened the email.

The blind copy (Bcc) sent to our customers for their records. We would also like the ability filter out reads for our reports.

As we all know some times emails are not received for several reasons.

In the event no open is detected our customers manually call that smaller list of members/offices so they have an opportunity to correct the violation or provide details on why its not a violation before it becomes a fine.

Its all about good data not fines!

User avatar
SorenR
Senior user
Senior user
Posts: 3818
Joined: 2006-08-21 15:38
Location: Denmark

Re: appending the recipient email address to message body in a image element src as its sent

Post by SorenR » 2020-11-22 18:34

TonyRusso wrote:
2020-11-22 18:01
Are you able to help us accomplish want we need to do using with HMS?


I was hoping when you asked why, you wanted to better understand technically what we were doing.

Instead of sending a private message, it seems to me you took the opportunity publicly admonished and cast doubt about our motives without knowing our business.
  • We are not a marketing company.
  • We do not spy on anyone!
  • We are an ethical business operating well within the legal and moral laws.
Our business is to provide Compliance Management Services to our customers and their board of directors for their business rules.

This is about reliable data and fairness.

Our customer's members are contractually required to abide the agreed upon rules if they wish to use their service.

There are too many members and not enough hours in a day for our customers to manually detect violations then personally call each members or office.

We send warning email notifications to their members and offices to inform them of a potential violation with time to correct before it become a finable offense.

So we would like to further enhance our ability to know which recipient has opened the email.

The blind copy (Bcc) sent to our customers for their records. We would also like the ability filter out reads for our reports.

As we all know some times emails are not received for several reasons.

In the event no open is detected our customers manually call that smaller list of members/offices so they have an opportunity to correct the violation or provide details on why its not a violation before it becomes a fine.

Its all about good data not fines!
We are an ethical business operating well within the legal and moral laws.

Well, not in my neck of the woods.

I bet Cambridge Analytica said the same about their business.

Anyways, hMailServer follow the rules (RFC's) and if recipient server has multiple recipents then a simgle message is delivered to multiple recipients.
If you want it done the way you wish then you need to address one email per recipient.
SørenR.

“Those who don't know history are doomed to repeat it.”
― Edmund Burke

TonyRusso
New user
New user
Posts: 10
Joined: 2018-07-09 15:52

Re: appending the recipient email address to message body in a image element src as its sent

Post by TonyRusso » 2020-11-22 19:38

I'm not looking to get into philosophical banter with you or anyone else.

Let just stay on topic without digressing away from scripting into personal opinions.

I am only asking the community for technical advised. No more, no less.

If you feel the need to comment, please do so by private message.

--------------------------------------------

In rebuttal to your post:

Our customers are the board of directors who are also members who make the rules and are well in their legal authority to do so.

What we do, how we do it is fully disclosed in a legal contracts with our customers and they disclosed that in their contracts with members.

Tt is legal, ethical and moral as it fully disclosed to all parties of the contract and within the laws of our country.

What's not legal, ethical or moral is when an individual member does not abide by the mutually agreed upon rules voted in by all members.

User avatar
jimimaseye
Moderator
Moderator
Posts: 8777
Joined: 2011-09-08 17:48

Re: appending the recipient email address to message body in a image element src as its sent

Post by jimimaseye » 2020-11-22 20:37

I think that as soon as you use the word "tracking" to determine the actions of a recipient, whether legal (in your part of the country) or not then you are going to hit resistance nnn especially if such tracking happens without the recipient choosing to be tracked (by voluntarily clicking after they have been advised of its tracking abilities). I for one spend a lot of effort trying to stop your, and even more transparent methods, from tracking me - even those that think they have a right to.

So even if I could help, I won't.

[Entered by mobile. Excuse my spelling.]
5.7 on test.
SpamassassinForWindows 3.4.0 spamd service
AV: Clamwin + Clamd service + sanesecurity defs : https://www.hmailserver.com/forum/viewtopic.php?f=21&t=26829

TonyRusso
New user
New user
Posts: 10
Joined: 2018-07-09 15:52

Re: appending the recipient email address to message body in a image element src as its sent

Post by TonyRusso » 2020-11-22 22:56

UPS, FedEx, USPS and other business send millions of mail and document fully embracing tracking in a very robust way.

They use email and or web sites to provide tracking analytics to the both the sender and recipient.

When the document is
  • delivered is tracked.
  • accepted it tracked.
  • refused it tracked.
  • destroyed in transit it tracked.
We do the same... just on a private web site only open to our customers and their members.

All our customers and their members know compliance notices are tracked and have accepted this in writing.

Makes no sense to me to have a tirade about the word Tracking and not understand it's not the word but how is used.

I get the sensitively about the word "Tracking" for some, we all need have an open informed mind.

Tracking is not inherently right, wrong or bad by it's self, its all about how it's used.

Everyone knows unscrupulous and nefarious people will always endeavor to do dirty deeds.

Our purpose is righteous, approved, legal, moral and helps both our customer and their members from issuing or receiving unnecessary fines which in some cases can be thousands.

Please, lets just stick to scripting.

if you don't wish for everyone to see or know what you are sending, just send a private email.

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

Re: appending the recipient email address to message body in a image element src as its sent

Post by mattg » 2020-11-22 23:31

TonyRusso wrote:
2020-11-22 19:38
I am only asking the community for technical advised. No more, no less.
mattg wrote:
2020-11-22 05:12
What you are wanting requires FOUR SEPARATE distinct emails to be sent.
SorenR wrote:
2020-11-22 18:34
If you want it done the way you wish then you need to address one email per recipient.
Not sure how many times you need to be told, but just repeating the important bits so you get the message.
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation

TonyRusso
New user
New user
Posts: 10
Joined: 2018-07-09 15:52

Re: appending the recipient email address to message body in a image element src as its sent

Post by TonyRusso » 2020-11-22 23:54

Ok, so you are saying it's possible to do this if by setting batch to one.

When sending to multiple, lets say 3 recipients HMS will send them each one at a time.

The oMessage recipients seems only show all recipients, not the one sending at that time.

Is there an object or method to get the one email address it's being sent to at that time?

User avatar
SorenR
Senior user
Senior user
Posts: 3818
Joined: 2006-08-21 15:38
Location: Denmark

Re: appending the recipient email address to message body in a image element src as its sent

Post by SorenR » 2020-11-23 00:33

TonyRusso wrote:
2020-11-22 22:56
UPS, FedEx, USPS and other business send millions of mail and document fully embracing tracking in a very robust way.

They use email and or web sites to provide tracking analytics to the both the sender and recipient.

When the document is
  • delivered is tracked.
  • accepted it tracked.
  • refused it tracked.
  • destroyed in transit it tracked.
We do the same... just on a private web site only open to our customers and their members.

All our customers and their members know compliance notices are tracked and have accepted this in writing.

Makes no sense to me to have a tirade about the word Tracking and not understand it's not the word but how is used.

I get the sensitively about the word "Tracking" for some, we all need have an open informed mind.

Tracking is not inherently right, wrong or bad by it's self, its all about how it's used.

Everyone knows unscrupulous and nefarious people will always endeavor to do dirty deeds.

Our purpose is righteous, approved, legal, moral and helps both our customer and their members from issuing or receiving unnecessary fines which in some cases can be thousands.

Please, lets just stick to scripting.

if you don't wish for everyone to see or know what you are sending, just send a private email.
I have over time contributed with extensive scripting to avoid SPAM, BOT's and Probes. I believe most if not all readers here know my view on privacy.

Let me recap from my previous post... You need to send 1 email to 1 recipient if you want to do what you want to do, scripting or not - OR - download the source from GitHub and modify the SMTP "engine" and disable batching.

Alternatives: Sendmail is using SMTP batching, Exim is per default using SMTP batching however it >>may<< be configured for SMTP pipeing normally used for external SMTP scanners and Postfix I don't know well enough but my guess is it is doing SMTP batching like the majority of the MTA's on the market.
SørenR.

“Those who don't know history are doomed to repeat it.”
― Edmund Burke

TonyRusso
New user
New user
Posts: 10
Joined: 2018-07-09 15:52

Re: appending the recipient email address to message body in a image element src as its sent

Post by TonyRusso » 2020-11-23 01:58

Thank you for that info. I admire your position and agree. You have no way to know me or my company. We do not engage in SPAM. And like you we take it very seriously.

We always have our DNS set and SENDER Header contains our company email address. From/Reply address are our customers. We also provide other special HEADERS with info.

We shifted from MailEnable to HMS somewhere around 2006, no desire to switch to another email server software.

Would prefer is not to branch HMS and only use scripting if at all possible. We don't wish to add another dependency for each HMS version unless HMS depreciates the com objects we're using.

Sounds like setting batch to 1 may fixe the first issue by changing Settings -> Protocols -> SMTP -> Advanced -> Maximum number of recipients in batch from 100 to 1 would set HMS to send to 1 recipient at a time.

Having said that, next question would be possible to get the recipient HMS is actually sending? It's my understanding (which i could be wrong) oMessage.recipients will always return the full lists all recipients not just the one it's sending to at the time.

Is there an Object, Method or something to identify the recipient HMS is sending to at at that time in OnDeliveryStart or OnDeliverMessage or somewhere else?

That bring to mind is there any possibility the message will be sent while OnDeliverMessage or OnDeliverStart is running?

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

Re: appending the recipient email address to message body in a image element src as its sent

Post by mattg » 2020-11-23 07:12

The ONLY WAY to do what you want is to send ONE EMAIL to ONE recipient at a time

There is no switch
This is no option
There is no other way that this will work
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation

Post Reply