Search found 438 matches

by mikedibella
2021-04-20 00:30
Forum: Scripting
Topic: Plus Addressing in Scripts
Replies: 6
Views: 59

Re: Plus Addressing in Scripts

I did read that post when you submitted it but it didn't click because the use case was virtual mailbox with static SMS recipient. Now I see that it directly applies to this evolved use case. So my current implementation will only work for single-address messages. That's an acceptable limitation for...
by mikedibella
2021-04-19 23:29
Forum: Scripting
Topic: Plus Addressing in Scripts
Replies: 6
Views: 59

Re: Plus Addressing in Scripts

OriginalAddress does preserve the Plus portion of the address, but @SorenR fears proved true: multiple addressing to the same Userid portion, but with unique Plus portion are consolidated. Perhaps a solution would be to use a unique subdomain for the gateway, i.e. sms.domain.com, and a catch-all, wi...
by mikedibella
2021-04-19 20:12
Forum: Scripting
Topic: Plus Addressing in Scripts
Replies: 6
Views: 59

Plus Addressing in Scripts

See code below. I'm coming back to have another look at a script the community was helping with to forward emails to an SMS gateway. The original solution created a "virtual mailbox" that forwarded all email for a particular user to a specific designated SMS address. I was playing with that code to ...
by mikedibella
2021-04-17 06:13
Forum: General discussions
Topic: Relay all outbound email at domain level
Replies: 30
Views: 243

Re: Relay all outbound email at domain level

You can use a Route to deliver outbound mail, but, by default, a Route is selected when: 1. A local Domain matching the recipient does not exist, or the Domain does exist but there is no Account for the recipient AND 2. the recipient domain matches the Route name . If you want to direct mail to a Ro...
by mikedibella
2021-04-16 01:23
Forum: General discussions
Topic: How to configure hMailServer to delete a message after it is retrived?
Replies: 8
Views: 199

Re: How to configure hMailServer to delete a message after it is retrived?

I'd suggest you need to enforce Quotas. IMO, your customers will expect to be able to use all the storage they are entitled to. You, as the authority, are within your right police them if they exceed that. That might be to enforce deletion of older messages or some other consequence.
by mikedibella
2021-04-15 03:21
Forum: Scripting
Topic: Email to HTTP
Replies: 98
Views: 569

Re: Email to HTTP

Someone keep me honest...are those constants (vbCR, vbLf, VBCrLf) supported in HMS script? Otherwise: sub SendAsSMS(oMessage) ' set URL to match your PROJECT const HTTP_HANDLER = "https://api.telerivet.com/v1/projects/PROJECT_CODE/messages/send" ' set api-key to your developer account const API_KEY ...
by mikedibella
2021-04-15 03:16
Forum: Scripting
Topic: Email to HTTP
Replies: 98
Views: 569

Re: Email to HTTP

sMessage = oMessage.Body ' encode line breaks sMessage = Replace(sMessage, vbCR, "") sMessage = Replace(sMessage, vbLf, "\n") sub SendAsSMS(oMessage) ' set URL to match your PROJECT const HTTP_HANDLER = "https://api.telerivet.com/v1/projects/PROJECT_CODE/messages/send" ' set api-key to your develop...
by mikedibella
2021-04-14 06:55
Forum: Scripting
Topic: Email to HTTP
Replies: 98
Views: 569

Re: Email to HTTP

Longshot:

Under project's settings (https://telerivet.com/p/PROJECT/messaging_settings), do you have Automatically create contact for each message checked?
by mikedibella
2021-04-14 04:24
Forum: Scripting
Topic: Email to HTTP
Replies: 98
Views: 569

Re: Email to HTTP

+1 for North American Dialing Plan.

{"to_number": "+1614xxxxxxxx"

or are you in AU, CX or CC?
by mikedibella
2021-04-14 03:54
Forum: Scripting
Topic: Email to HTTP
Replies: 98
Views: 569

Re: Email to HTTP

Try putting a plus "+" in front of the number. I was able to get a successful simulated message to submit using this north american dial plan format: +12223334444
by mikedibella
2021-04-14 03:38
Forum: Scripting
Topic: Email to HTTP
Replies: 98
Views: 569

Re: Email to HTTP

Code: Select all

EventLog.Write sPostData
might help too.
by mikedibella
2021-04-14 03:34
Forum: Scripting
Topic: Email to HTTP
Replies: 98
Views: 569

Re: Email to HTTP

Sure that you are adding the recipient number to the message as the X-SMS-Recipient header if you want to use the code as I have crafted. You can do it with the Rule Set header Action.
by mikedibella
2021-04-14 03:24
Forum: Scripting
Topic: Email to HTTP
Replies: 98
Views: 569

Re: Email to HTTP

Add:

Code: Select all

EventLog.Write oHTTP.ResponseText
Between:

Code: Select all

oHttp.send sPostData
set oHttp = nothing
Then test and send the logging in the eventlog file.
by mikedibella
2021-04-14 02:56
Forum: Scripting
Topic: Email to HTTP
Replies: 98
Views: 569

Re: Email to HTTP

Make sure you update the api url to include your project id.

The code you are using also expect the to address in the X-SMS-Recipient header.
by mikedibella
2021-04-14 01:47
Forum: Scripting
Topic: Email to HTTP
Replies: 98
Views: 569

Re: Email to HTTP

In an original post I had left a debugging statement in place. It would have started with "wscript.echo". Remove that entire line.
by mikedibella
2021-04-14 01:26
Forum: Scripting
Topic: Email to HTTP
Replies: 98
Views: 569

Re: Email to HTTP

In this particular use case I'm thinking the OP wants to create a "virtual mailbox" that receives mail via SMTP and dispatches via SMS. So, I'm not sure all this header-parsing complexity matters. I'm thinking the best way to handle this is with a mailbox rule that fires a script Sub that sends the ...
by mikedibella
2021-04-13 21:14
Forum: Scripting
Topic: Email to HTTP
Replies: 98
Views: 569

Re: Email to HTTP

I setup a developer account on Telerivet to test the code. Here are my observations: 1. The sample code only generates "simulated"messages. To deliver messages to mobile endpoints, you need a from_address in the JSON and a defined Route in Telerivet. Routes monetize message transfer, so I stopped te...
by mikedibella
2021-04-13 03:16
Forum: Scripting
Topic: Email to HTTP
Replies: 98
Views: 569

Re: Email to HTTP

Using this example (https://telerivet.com/api/rest): curl -s -u YOUR_API_KEY: \ "https://api.telerivet.com/v1/projects/PROJECT_ID/messages/send" \ -H "Content-Type: application/json" \ -d '{ "content": "hello world", "to_number": "+16505550123" }' Forwarding a message to a STATIC destination would l...
by mikedibella
2021-04-13 02:24
Forum: Scripting
Topic: Email to HTTP
Replies: 98
Views: 569

Re: Email to HTTP

hMailServer doesn't support the SMS API interface natively, but you can create a simple interface using VBScript and hMailServer's rules engine will fire it for you. This might help you get started, but you'll need to read and understand the API documentation to correctly format the API method invoc...
by mikedibella
2021-04-09 22:51
Forum: General discussions
Topic: Message Encryption
Replies: 3
Views: 119

Re: Message Encryption

1) Are the messages stored in SQL Server or in files on the server? Stored in files under the Data directory. The Queue is in the root, inboxes are store in subfolders by domain, then username. 2) if they are stored in files, can the files be encrypted so they content cannot be viewed with e text e...
by mikedibella
2021-04-08 18:21
Forum: General discussions
Topic: ERROR: unable to bind to address using cloudflare
Replies: 30
Views: 389

Re: ERROR: unable to bind to address using cloudflare

Is the A record for your mail host (the record for the hostname the MX record returns) set to DNS Only? If it set to Proxied, it needs to be changed.
by mikedibella
2021-04-08 02:30
Forum: General discussions
Topic: How to configure hMailServer to delete a message after it is retrived?
Replies: 8
Views: 199

Re: How to configure hMailServer to delete a message after it is retrived?

I don't think the event handlers give you visibility into that level of detail. OnClientConnect will tell you that a client connected on a particular port; you don't get any detail into what the client is doing beyond that. Why don't you have the mail client handle mailbox cleanup? Most clients have...
by mikedibella
2021-04-07 01:25
Forum: General discussions
Topic: Rule Action to trigger an URL
Replies: 3
Views: 137

Re: Rule Action to trigger an URL

Code: Select all

Sub TriggerFetch(oMessage)
	const HTTP_HANDLER = "http://mywebsite.com:8080/scripts/rcron.php"
	Set oHttp = CreateObject("Msxml2.ServerXMLHTTP.6.0")
	oHttp.open "GET", HTTP_HANDLER, false
	oHttp.send 
	set oHttp = nothing
End Sub
by mikedibella
2021-04-01 22:39
Forum: General discussions
Topic: Installation error: "The set-up failed to set the service dependency"
Replies: 8
Views: 259

Re: Installation error: "The set-up failed to set the service dependency"

Make sure you are installing from a user in the local Administrators group, running the installer from an elevated (run as administrator) cmd.exe window.
by mikedibella
2021-03-29 23:46
Forum: General discussions
Topic: Cannot resolve MX
Replies: 77
Views: 1780

Re: Cannot resolve MX

I queried the wrong record. Your MX record looks good: > server 1.1.1.1 Default Server: one.one.one.one Address: 1.1.1.1 > set type=mx > pentaservis.cz Server: one.one.one.one Address: 1.1.1.1 Non-authoritative answer: pentaservis.cz MX preference = 10, mail exchanger = mail.pentaservis.cz > Your A ...
by mikedibella
2021-03-29 23:01
Forum: General discussions
Topic: Cannot resolve MX
Replies: 77
Views: 1780

Re: Cannot resolve MX

From what I see you do not have your MX record configured correctly. This is the query result: > server 1.1.1.1 Default Server: one.one.one.one Address: 1.1.1.1 > set type=mx > mail.pentaservis.cz Server: one.one.one.one Address: 1.1.1.1 Non-authoritative answer: mail.pentaservis.cz canonical name =...
by mikedibella
2021-03-29 21:09
Forum: General discussions
Topic: How to log headers sent during SMTP client session?
Replies: 10
Views: 363

Re: How to log headers sent during SMTP client session?

Just a thought...if you want to preserve which recipient failed and why: sub OnDeliveryFailed(oMessage, sRecipient, sErrorMessage) oMessage.HeaderValue("X-hMailServer-Failure-Recipient") = sRecipient oMessage.HeaderValue("X-hMailServer-Failure-Reason") = sErrorMessage oMessage.Save set oFS = CreateO...
by mikedibella
2021-03-29 02:07
Forum: General discussions
Topic: How to log headers sent during SMTP client session?
Replies: 10
Views: 363

Re: How to log headers sent during SMTP client session?

Maybe trap the delivery failures in a quarantine and use a scheduled task to delete them after a few days. Then you can review the entire header in the message file. sub OnDeliveryFailed(oMessage, sRecipient, sErrorMessage) set oFS = CreateObject("Scripting.FileSystemObject") on error resume next oF...
by mikedibella
2021-03-23 03:27
Forum: General discussions
Topic: Email format validation
Replies: 7
Views: 375

Re: Email format validation

You could use a global rule to catch these exceptions and delete them. This post suggests a regular expression to perform address validation: https://stackoverflow.com/questions/201323/how-to-validate-an-email-address-using-a-regular-expression Just deleting the non-compliant messages is trivial usi...
by mikedibella
2021-03-23 01:45
Forum: General discussions
Topic: Rules create copy and send, sending slow
Replies: 5
Views: 279

Re: Rules create copy and send, sending slow

This has been covered extensively on other threads. The delay is there by design. One poster did have success scripting a function to create a new "clone" message and submit it, which does get sent immediately: https://www.hmailserver.com/forum/viewtopic.php?f=7&t=36017&p=226758&hilit=forwarding+del...
by mikedibella
2021-03-22 20:54
Forum: General discussions
Topic: Email format validation
Replies: 7
Views: 375

Re: Email format validation

My read is that you think that this address should have been rejected because it should have been formatted as 曾建花 <zengjianhua@aigatech.com> It does appear that hMailServer is accepting an address that is in a format that is likely undeliverable. It probably should have rejected the address during ...
by mikedibella
2021-03-20 21:50
Forum: Scripting
Topic: Running curl command seems impossible
Replies: 12
Views: 432

Re: Running curl command seems impossible

WshShell.Exec("curl https://192.168.10.127/cgi-bin/wlogin.cgi --data-raw ""usr=cm9vdA==&pwd=RG8geW91IGZlZWwgbHVja3ksIHB1bms/IQ=="" --insecure --cookie-jar ""%temp%\tmp_cookie""") Three issues with this code: 1. You have to replace inline double-quotes with Chr(34) in VBS. 2. Use the following code ...
by mikedibella
2021-03-20 03:59
Forum: Scripting
Topic: Running curl command seems impossible
Replies: 12
Views: 432

Re: Running curl command seems impossible

Sub OnDeliverMessage(oMessage) const HTTP_HANDLER = "http://some.domain/notifydelivery/" sPostData = oMessage.HeaderValue("Message-ID") & vbCRLF sPostData = sPostData & oMessage.HeaderValue("From") & vbCRLF sPostData = sPostData & oMessage.HeaderValue("Date") & vbCRLF sPostData = sPostData & oMessa...
by mikedibella
2021-03-19 02:36
Forum: General discussions
Topic: Cannot resolve MX
Replies: 77
Views: 1780

Re: Cannot resolve MX

SorenR wrote:
2021-03-19 02:13
That is so wrong!
Remember HMS resolver code is only going to be impacted by the DnsCache service if Win APIs are used for DNS resolution. If the code builds it's own message structures and just uses socket calls, those queries won't be cached by DnsCache.
by mikedibella
2021-03-19 01:51
Forum: General discussions
Topic: Cannot resolve MX
Replies: 77
Views: 1780

Re: Cannot resolve MX

SorenR wrote:
2021-03-19 01:42
I think I am having some weird cache issue here.
Remember to clear the client cache (ipconfig /flushdns) as well as the server cache.
by mikedibella
2021-03-19 01:22
Forum: General discussions
Topic: Cannot resolve MX
Replies: 77
Views: 1780

Re: Cannot resolve MX

SorenR wrote:
2021-03-19 01:10
From the GUI I simply cannot make it identify a priority 0 MX record.
I have Preference 0 records in some of my domains going back decades. Utilities | MX-query resolves these domains just fine.
by mikedibella
2021-03-19 01:19
Forum: General discussions
Topic: Cannot resolve MX
Replies: 77
Views: 1780

Re: Cannot resolve MX

but an A RR is found, the A RR is treated as if it was associated with an implicit MX RR, with a preference of 0, pointing to that host. My read of this section is to say your code for DNS handling "fall back" if no MX records exists, should look up an A record for the domain and if one if found, s...
by mikedibella
2021-03-19 01:07
Forum: General discussions
Topic: Cannot resolve MX
Replies: 77
Views: 1780

Re: Cannot resolve MX

My guess is that either you are experiencing timeouts on some DNS queries. If you are using forwarders in your local DNS server configuration, increase the forward query time out. If you are using root hints, set the server timeout highter or consider configuring conditional forwarders for the probl...
by mikedibella
2021-03-19 00:55
Forum: General discussions
Topic: Cannot resolve MX
Replies: 77
Views: 1780

Re: Cannot resolve MX

The RFC says a "Null MX" is designated by an RDATA section consisting of preference number 0 and a zero-length label, written in master files as ".", as the exchange domain, to denote that there exists no mail exchanger for a domain. So you need both Preference=0 and Host="." to "turn off" the defau...
by mikedibella
2021-03-16 18:25
Forum: General discussions
Topic: GMail or other providers cannot receive mails.
Replies: 26
Views: 883

Re: GMail or other providers cannot receive mails.

Read the guidance at the linked URL. Your sending IP is present on a Real-time Block List and the receiving server is rejecting mail based on that.
by mikedibella
2021-03-16 18:14
Forum: General discussions
Topic: Stop bounce messages from exchange
Replies: 14
Views: 639

Re: Stop bounce messages from exchange

tunis wrote:
2021-03-16 15:04
This is not working on hMailsever generated bounces.
I'm thinking since hMailServer is generating the NDR it is never "accepted" to trigger adding the X-Envelope-Sender header. Without the header, the Rule doesn't fire.
by mikedibella
2021-03-15 19:55
Forum: General discussions
Topic: Dealing with Messages in User Mailboxes with Virus-Infected Attachments
Replies: 3
Views: 253

Re: Dealing with Messages in User Mailboxes with Virus-Infected Attachments

More thinking out loud. Using the API: For each DOMAIN For each ACCOUNT For each MESSAGE For each ATTACHMENT Write the attachment to a temporary file Shell out to a command-line scanner If positive Delete the attachment Add notice to body Add header for future processing
by mikedibella
2021-03-15 19:20
Forum: General discussions
Topic: Dealing with Messages in User Mailboxes with Virus-Infected Attachments
Replies: 3
Views: 253

Re: Dealing with Messages in User Mailboxes with Virus-Infected Attachments

Thinking out loud. 1. Run an on-demand scan of the hMailServer Data directory and quarantine positives. 2. Run the Data Synchronizer to fix-up the mailboxes that lost message files due to quarantining. 3. Run a script to re-import the message bodies of the quarantined messages without the attachment...
by mikedibella
2021-03-15 00:21
Forum: General discussions
Topic: Need help please with SSL Intermediate Chain
Replies: 2
Views: 220

Re: Need help please with SSL Intermediate Chain

Usually the bundle file includes the leaf (server) certificate. If it does, all you need to do is use the bundle file for the certificate with the key file created from openssl and you should be good to go.
by mikedibella
2021-03-13 21:04
Forum: General discussions
Topic: Stop bounce messages from exchange
Replies: 14
Views: 639

Re: Stop bounce messages from exchange

There aren't too many legitimate message originators that use an empty envelope sender (MAIL FROM:<>). So this probably will handle external bounce suppression: First, you need to write a Header to save the enveloper sender. Put this code in the EventHandlers.vbs: Sub OnAcceptMessage(oClient, oMessa...
by mikedibella
2021-03-13 01:27
Forum: General discussions
Topic: hMailServer send an unsecured mail
Replies: 2
Views: 238

Re: hMailServer send an unsecured mail

You don't need a certificate to send using TLS, but not all receiving servers will support it. To send secure to those that do, make sure Settings > Protocols > SMTP > Advanced > Use STARTTLS if available is checked. If you are using a relay, make use that Settings > Protocols > SMTP > Delivery of e...
by mikedibella
2021-03-09 18:16
Forum: General discussions
Topic: Latest microsoft exchange server hack
Replies: 4
Views: 305

Re: Latest microsoft exchange server hack

Exchange Online does not allow relay from IPs on an Acceptable Use Policy Block List. I'm not sure which one they use, but Spamhaus is a big one. If you are one that one you'll probably be blocked.

See https://www.spamhaus.org/pbl/
by mikedibella
2021-03-09 02:50
Forum: General discussions
Topic: Forum Private Messages "stuck" in the Outbox
Replies: 1
Views: 135

Forum Private Messages "stuck" in the Outbox

Do these messages stay in the Outbox until they are read by the recipient?
by mikedibella
2021-03-02 22:03
Forum: General discussions
Topic: Error 530 when using distribution list
Replies: 20
Views: 895

Re: Error 530 when using distribution list

Require SMTP Authentication If this checkbox is selected, hMailServer will require SMTP authentication for deliveries made to the list. If you select this option, only users with accounts on the server will be able to send email to the distribution list. I'm guessing this setting has to be off or t...
by mikedibella
2021-03-02 21:38
Forum: General discussions
Topic: Error 530 when using distribution list
Replies: 20
Views: 895

Re: Error 530 when using distribution list

Thinking out loud. The problem appears when the list post originator and the post recipient are on the same domain, but these connections are going to appear to be coming from either the loopback address or a adapter-assigned LAN address. So try creating an IP range for those nets and disable requir...
by mikedibella
2021-03-01 21:27
Forum: General discussions
Topic: Feed Errors
Replies: 13
Views: 544

Re: Feed Errors

Looks like an incompatibility with SCHANNEL emerged on 2/27, the same date that the latest cert for hmailserver.com was dated.

So it is seems:

Outlook, IE11 via SCHANNEL: No
CURL.exe via NSS: Yes
Chome, Edge via Chromium WebCrypto: Yes
OpenSSL: Yes

I'll just work around with a proxy.
by mikedibella
2021-03-01 20:37
Forum: General discussions
Topic: Feed Errors
Replies: 13
Views: 544

Re: Feed Errors

Looks like that's that date of the last cert renewal...still digging....
by mikedibella
2021-03-01 20:29
Forum: General discussions
Topic: Feed Errors
Replies: 13
Views: 544

Re: Feed Errors

That is a head-scratcher...10 minutes ago the validator threw an error on a post with the Cyrillic char set. I should have saved the raw XML...I'll have to do more debugging on my side. OL stopped updating the feed on 2/27.
by mikedibella
2021-03-01 19:37
Forum: General discussions
Topic: Feed Errors
Replies: 13
Views: 544

Feed Errors

Can one of thre mods clean up the spam posts on the board. See https://validator.w3.org/feed/check.cgi ... php%2Ffeed.

The content starting on line 53 of the analysis is choking my reader and I don't get any posts after it.
by mikedibella
2021-02-26 20:59
Forum: Scripting
Topic: oMessage.Body / oMessage.HTMLBody
Replies: 5
Views: 425

Re: oMessage.Body / oMessage.HTMLBody

Try .Write instead of .WriteLine with these properties.
by mikedibella
2021-02-26 20:46
Forum: Scripting
Topic: oMessage.Body / oMessage.HTMLBody
Replies: 5
Views: 425

Re: oMessage.Body / oMessage.HTMLBody

you need to define the ForAppending constant. Add:

Code: Select all

Const ForReading = 1, ForWriting = 2, ForAppending = 3
to the beginning of your subs that reference it.
by mikedibella
2021-02-26 05:31
Forum: General discussions
Topic: Email sending error 550
Replies: 8
Views: 497

Re: Email sending error 550

karishma wrote:
2021-02-25 15:18
We have an external app, that uses mail.abc.com domain to send out email notifications to users.
Can you explain why it is necessary for these notifications to appear to be sent by users on other mail domains instead of appear to be sent by an address on your domain?
by mikedibella
2021-02-25 23:35
Forum: General discussions
Topic: Email sending error 550
Replies: 8
Views: 497

Re: Email sending error 550

Looks like your are referencing the AWStats logging. AWStats only captures the response code without the text. You need to enable SMTP logging and reproduce the error, then send the complete 550 response from the SMTP log for analysis.
by mikedibella
2021-02-22 23:20
Forum: General discussions
Topic: eml files are not created
Replies: 13
Views: 658

Re: eml files are not created

Here's the way I save EMLs. I have these subs in EventHandlers.vbs: sub SaveMessage(oMessage, sDirectory) set oFS = CreateObject("Scripting.FileSystemObject") on error resume next oFS.CopyFile oMessage.Filename, sDirectory, True on error goto 0 End Sub sub QuarantineMessage(oMessage) SaveMessage oMe...
by mikedibella
2021-02-19 23:10
Forum: General discussions
Topic: Parse Received Headers
Replies: 12
Views: 716

Re: Parse Received Headers

Obviously, I'm looking for older ones. Is that because by the time you are evaluating the headers HMS has already added it's own? Maybe you can add a custom header in OnAcceptMessage to parse the last Received: header before HMS appends one: Sub OnAcceptMessage(oClient, oMessage) sReceived = oMessa...