Windows: Receive tickets instantly/No polling

Dont create your support topics here! No new topics with questions allowed!

Moderator: crythias

Forum rules
Dont create your support topics here! No new topics with questions allowed!
Post Reply
Posts: 10168
Joined: 04 May 2010, 18:38
Znuny / OTRS Version: 5.0.x
Location: SouthWest Florida, USA

Windows: Receive tickets instantly/No polling

Post by crythias »

#### Disclaimer: This should, in theory, and in testing, work. If OTRS is critical to your infrastructure and you don't want to do this, don't.
#### This HowTo is not endorsed by OTRS. It is not official documentation.
#### Things that won't work for you depend on your configuration.
#### Assumptions made: 1) you don't have an SMTP server service on your OTRS box. 2) You want tickets created instantly 3) the OTRS box is some sort of Windows Box on your LAN 4) you control it 5) you're allowed to set up an smtp server on your OTRS box.
#### I don't have any connection to hmailserver except to say that it works for what I tried.
#### Bug fixes here. Questions on the forums, please.

1) Install the free hMailServer (do not install this on a box that's running Exchange or other mailserver. people will get mad.)
2) configure it as follows:
Domains: add domain (otrs.local is probably a good choice. You don't necessarily want to conflict with something live)
Accounts: add otrs (nothing else needed, though you may want this to have a rule that deletes all incoming mail for otrs@otrs.local -- really.)
(AFTER you verify this works, Delete all incoming mail: Rule: delete, Criteria: To: Wildcard *, OK, Actions: Delete e-mail, OK, Save)
Protocols clear the checkboxes for POP3 and IMAP, Save
SMTP -> Delivery of e-mail -> local host name otrs.local, Save
Scripts: [x]enabled, VBScript, SAVE, Show Scripts
edit "EventHandlers.vbs"

Code: Select all

Sub OnDeliveryStart(oMessage)
   Set oShell = CreateObject("WScript.Shell")
   sProgPerl = "C:\Program Files (x86)\OTRS\StrawberryPerl\perl\bin\perl.exe"
   sPostpl = "C:\Program Files (x86)\OTRS\OTRS\bin\"
   sMessage = oMessage.Filename
   sQ = """"
   sCommandLine = "cmd /c type " & sQ & sMessage & sQ & " | " & sQ & sProgPerl & sQ & " " & sQ & sPostpl & sQ
   Call oShell.Run(sCommandLine, 0, TRUE)
End Sub
Make sure to Check Syntax and verify the paths in the code are correct for your system.
Click Reload Scripts

You may have to make sure hMailserver.exe is an exception/allowed through your firewall.

Next, you need to find a way to send an email to OTRS@otrs.local
Let's test to see if this works:
putty/telnet yourotrsserver 25

Code: Select all

rcpt to:otrs@otrs.local
Subject: Test Message
This is a sample to check if it will make a ticket
If this makes a ticket, great! We now need to forward otrs email to this email address.
If this does nothing, you likely have some path problems or misspellings. Make sure that the paths match actual locations of perl.exe (If you're using ActiveState perl instead of Strawberry, take that into account, as well as not needing " (x86)" if your box is 32-bit

Troubleshooting is a pain, but it really boils down to path to perl and the

To get your otrs email to forward to this email address:
In Exchange, create:
a Contact for otrs@otrs.local
a Send Connector for otrs.local that points the smarthost to be the otrs server

And forward the support mail account to otrs@otrs.local

If you have another account (like GMAIL) that stores the email, you can set up a subdomain mx record for a real domain, change otrs.local for that subdomain ... as long as the otrs box has a presence on the web.
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
Post Reply