Return-Path index of oMessage.Headers(index).Name Not found

Use this forum if you have problems with a hMailServer script, such as hMailServer WebAdmin or code in an event handler.
Post Reply
milis75
New user
New user
Posts: 12
Joined: 2020-09-17 10:11

Return-Path index of oMessage.Headers(index).Name Not found

Post by milis75 » 2020-09-18 07:13

Hi All,

My Question is
1. Why Header Return-path not found in index
2. and how I get Headers("Return-Path")

I just looping of index header and the result like this
:arrow:


Received index of : 0

From index of : 1

To index of : 2

References index of : 3

In-Reply-To index of : 4

Subject index of : 5

Date index of : 6

Message-ID index of : 7

MIME-Version index of : 8

Content-Type index of : 9

Content-Transfer-Encoding index of : 10

X-Mailer index of : 11

Thread-Index index of : 12

Content-Language index of : 13

Thank You

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

Re: Return-Path index of oMessage.Headers(index).Name Not found

Post by mattg » 2020-09-18 13:27

But what if there is no 'return-path'??
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
SorenR
Senior user
Senior user
Posts: 6315
Joined: 2006-08-21 15:38
Location: Denmark

Re: Return-Path index of oMessage.Headers(index).Name Not found

Post by SorenR » 2020-09-18 13:54

Unless the email is spoofed, the general rule is that "Return-Path" = "oMessage.FromAddress" (AKA X-Envelope-From).

The header "Return-Path" is the very last thing added to the email before it is dropped into the INBOX. That is why it is the first line in the .eml file when you open it with a text editor.

"oMessage.FromAddress" is available in:

Sub OnSMTPData(oClient, oMessage)
Sub OnAcceptMessage(oClient, oMessage)
Sub OnDeliveryStart(oMessage)
Sub OnDeliverMessage(oMessage)
Sub OnDeliveryFailed(oMessage, sRecipient, sErrorMessage)
and
Sub OnExternalAccountDownload(oFetchAccount, oMessage, sRemoteUID)
SørenR.

Woke is Marxism advancing through Maoist cultural revolution.

milis75
New user
New user
Posts: 12
Joined: 2020-09-17 10:11

Re: Return-Path index of oMessage.Headers(index).Name Not found

Post by milis75 » 2020-09-21 06:02

I want to alert the user whether the email is fake or not based on the return-path, not oMessage.FromAddress or oMessage.From
I use criteria of rule failed
I use VBscript failed too




vbscript for generate index header like it

Dim oHeader
For oHeader = 0 to oMessage.Headers.Count-1
oMessage.Body = oMessage.Body & _
vbCrLf & oMessage.Headers(oHeader).Name & " index of : " & oHeader
Next
oMessage.Save()


thx u :)

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

Re: Return-Path index of oMessage.Headers(index).Name Not found

Post by SorenR » 2020-09-21 11:41

Good luck!
SørenR.

Woke is Marxism advancing through Maoist cultural revolution.

Post Reply