Rule for empty Sender needed

Use this forum if you have installed hMailServer and want to ask a question related to a production release of hMailServer. Before posting, please read the troubleshooting guide. A large part of all reported issues are already described in detail here.
Post Reply
cyberflip
New user
New user
Posts: 3
Joined: 2016-07-14 09:23

Rule for empty Sender needed

Post by cyberflip » 2016-07-14 09:39

Hi,

I use hMailServer between an local Exchange2013 and the Smtp-Server of my provider. Normal Sending works fine,
but when i turn on "autoreplay" in an users postbox on the exchange server - mails are not delivered ... The problem
is that the exchange server sends the mail with no Sender address...

in the logging of hmailserver i see:

RECEIVED: MAIL FROM:<> SIZE=11304
SENT: 250 OK
....

my provider doesn't accept mails with empty sender field - so when hmailserver forwards the mail to the external smtp
i get an error

so how to use a global rule to replace an empty sender with an dummy noreply@xxx.xx ?
I tried:
Field: From Not contains @

Action: Set header value
Header name: From
Value: none@xxx.xx

doesn't work..
any ideas ?

thank you
greetings
Philipp

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

Re: Rule for empty Sender needed

Post by jimimaseye » 2016-07-14 10:26

my provider doesn't accept mails with empty sender field
That's unfortunate. I believe that's against RFC rules and advice. (Although they probably do it in a belief it adds some sort of security to ensure they are not abused).

Any reason why you are using the smtp relay from your provider and not sending out directly?

Maybe setup your relay as a route, and set a rule to use the route for all emails except for when the from is empty at which it could go directly? (It all comes down to, though, why using the SMTP relay in the first place).
HMS 5.6.6 B2383 on Win Server 2008 R2 Foundation, + 5.6.7-B2415 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

percepts
Senior user
Senior user
Posts: 5282
Joined: 2009-10-20 16:33
Location: Sceptred Isle

Re: Rule for empty Sender needed

Post by percepts » 2016-07-14 10:55

fix the problem at source which is exchange. It should be adding the from address correctly in the auto reply and not leaving it empty. I'm presuming its actually Return-Path: which is empty and not From:

take a look at the email and confirm this please.

cyberflip
New user
New user
Posts: 3
Joined: 2016-07-14 09:23

Re: Rule for empty Sender needed

Post by cyberflip » 2016-07-14 12:35

Hi,

thanks for your answers - I know that the problem is the provider - he thinks it's unsecure ...

I can't fix the Problem at source - Exchange2013 sends autoreply without sender field
and you can't fix it (See: http://www.techieshelp.com/exchange-201 ... l-senders/)

I want to use hMail Server for this reason -> to replace the empty sender string..

I'm testing with vba to change it...
Rule with outgoing mail works - my vba function is executed
there i check the sender field (len=0)
and i replace the sender field with a string..

i get the the error:
"ERROR" 8164 "2016-07-14 12:17:12.625" "Severity: 3 (Medium), Code: HM4404, Source: SMTPDeliverer::_ApplyForwarding, Description: Did not submit bounce message for message 58 from none@xxxxxx.or.at since rule loop count was reached or Auto-Submitted header."

Here is my code

Code: Select all

Sub OnReplaceSender(oMessage)
	EventLog.Write("SCRIPT: OnReplaceServer ")
	EventLog.Write("SCRIPT: Sender  " & oMessage.FromAddress)
	EventLog.Write("SCRIPT: Length  " & Len(oMessage.FromAddress))
	if Len(oMessage.FromAddress)="0" then
		EventLog.Write("SCRIPT: no Sender ... set Sender")
		oMessage.FromAddress = "none@xxxx.or.at"
		oMessage.Save
	end if
End Sub
Any tips or hints, what i have to do?

Thanks and greetings
Philipp

cyberflip
New user
New user
Posts: 3
Joined: 2016-07-14 09:23

Re: Rule for empty Sender needed

Post by cyberflip » 2016-07-14 12:47

Hi,

okay - there was no error..

the error is because my provider doesn't accept the none@xxx.co.at mail address
when i use a valid mail adress in my script, it's executed without erorrs..

Script is working!


Thanks and
Greetings
Philipp

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

Re: Rule for empty Sender needed

Post by jimimaseye » 2016-07-14 15:26

Good to hear.

By the way hmailserver also has empty sender address (from) when it does a rule induced reply.)

Return-Path: <>

HMS LOG:
"SMTPC" 2824 3685 "2016-07-14 11:23:10.683" "98.138.112.38" "SENT: MAIL FROM:<>"
"SMTPC" 2300 3685 "2016-07-14 11:23:11.058" "98.138.112.38" "RECEIVED: 250 null sender <> ok"
(but its not empty with a message via the Auto-reply feature)
HMS 5.6.6 B2383 on Win Server 2008 R2 Foundation, + 5.6.7-B2415 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

Post Reply