Is it possible to enhance the SMTP connector...

RickH
Posts: 49
Joined: Tue Feb 08, 2005 4:23 pm

Is it possible to enhance the SMTP connector...

Postby RickH » Sat Dec 09, 2006 7:52 pm

Basically what I want to do is while the SMTP connector is receiving an email, I want to check the address of the RCPT TO and the MAIL FROM and make a decision on whether to allow the email or not. For instance if joe@yourdomain.com sends an email to rick@mydomain.com I will check to see if joe is allowed to send to rick. If so I will then allow the SMTP connector to continue (250 mail action ok). If not I will tell the SMTP connector to bounce the message. (550 mailbox unavailable, etc)

I do not want the email to be accepted and then junked later. I want to stop it from ever being accepted by the SMTP connector.

Would you recommend that I write my own SMTP server and then forward email to the ME SMTP connector for additional processing or is it possible to work with the ME SMTP server and enhance it's capabilities to implement this change.

Any input would be greatly appreciated.

RickH

RickH
Posts: 49
Joined: Tue Feb 08, 2005 4:23 pm

Postby RickH » Fri Jul 20, 2007 5:41 pm

Bump.
This issue has come up again and I would like input from others.
ME Pro 1.85 version in use.

MailEnable
Site Admin
Posts: 4441
Joined: Tue Jun 25, 2002 3:03 am
Location: Melbourne, Victoria Australia

Postby MailEnable » Fri Jul 20, 2007 10:36 pm

There is no forseeable way to do this with current editions of MailEnable. It is possible that some sort of scripting may be provided at the SMTP connector, but this is currently not the case. (I checked the product dev register and there are plans for scripting at the SMTP connector, but the feature will not be in the V3 release).

As such, the only forseeable short term solution would be to write a socket proxy that received data from the client, and then sent them through to the MailEnable server. To proxy could intercept the MAIL FORM and RCPT commands and could act accordingly.
Regards, Andrew

RickH
Posts: 49
Joined: Tue Feb 08, 2005 4:23 pm

Postby RickH » Sat Jul 21, 2007 12:56 am

My biggest concern in taking that approach is that it may break SPF because the incoming mail server would now be the proxy.

RickH

MailEnable
Site Admin
Posts: 4441
Joined: Tue Jun 25, 2002 3:03 am
Location: Melbourne, Victoria Australia

Postby MailEnable » Mon Jul 23, 2007 5:27 am

You are right, it would break SPF and all other IP validation (PTR, RDNS, and greylisting (V3)).

This patch should help:
http://www.mailenable.com/beta/SMTPSCR.zip

It is a replacement SMTP Service that allows script executions to occur based on SMTP verbs. The updated service should be included in subsequent releases of V3 (and most likely V2) of MailEnable.
Regards, Andrew

RickH
Posts: 49
Joined: Tue Feb 08, 2005 4:23 pm

Postby RickH » Mon Jul 23, 2007 5:48 pm

I will try this and see what happens.
Please see your PM for a question.

MailEnable
Site Admin
Posts: 4441
Joined: Tue Jun 25, 2002 3:03 am
Location: Melbourne, Victoria Australia

Postby MailEnable » Mon Jul 23, 2007 9:59 pm

Thanks Rick, there were indeed two errors in the sample script as you pointed out. These have been updated.
Regards, Andrew

RickH
Posts: 49
Joined: Tue Feb 08, 2005 4:23 pm

Postby RickH » Mon Jul 30, 2007 1:31 pm

This is working great.
I have a script in place that runs for each call to the RCPT TO: verb.
I am going to try it on my production server and see how it holds up.
I am using a database connection so I am concerned about processing time. I will post updates.

RickH

polarisie
Posts: 696
Joined: Mon Mar 27, 2006 2:58 pm

Postby polarisie » Wed Feb 20, 2008 4:01 pm

MailEnable wrote:You are right, it would break SPF and all other IP validation (PTR, RDNS, and greylisting (V3)).

This patch should help:
http://www.mailenable.com/beta/SMTPSCR.zip

It is a replacement SMTP Service that allows script executions to occur based on SMTP verbs. The updated service should be included in subsequent releases of V3 (and most likely V2) of MailEnable.


Andrew:

Are there any updates regarding this? Does the latest versions of ME support this?
MXSCAN :: AntiSpam & AntiVirus for MailEnable (now with Spamtrap/Honeypot!)
Built-in SpamAssassin, Clam, MessageSniffer, DNSBL, URLBL, DCC, Senderbase, SpamTrap, ShortCircuit, Content Filters, Disclamers, Archiving and more.
Visit www.mxuptime.com

RickH
Posts: 49
Joined: Tue Feb 08, 2005 4:23 pm

Postby RickH » Wed Feb 20, 2008 4:14 pm

I am sorry that I stopped updating this thread. I left everyone thinking things were working great. I did have problems. The SMTP server would shutdown after an extended length of time while using my RCTP TO: scripts. I finally set it up to restart after failure so that I knew it was always running. I finally replaced it with the regular SMTP server. I got involved in more pressing matters and never revisited this issue. I cannot tell you where the problem was coming from. I stripped the script I used down to almost nothing but still was experiencing the SMTP shutdown but now it took even longer before it happened. Sorry to not give the ME guys the opportunity to debug the problem but I had to move on. I would gladly like to help revisit this issue if anyone is interested.

RickH

AbsolutelyFreeWeb
Posts: 88
Joined: Sun Nov 21, 2004 11:44 am

Postby AbsolutelyFreeWeb » Thu Jun 26, 2008 4:44 pm

Could it be included in the next standard version as well?
Cheap domains com/net/org/info $6.99 including dns manager/forwarding
Quality Hosting from $1.99/mo
Hire IT staff When quality matters

RickH
Posts: 49
Joined: Tue Feb 08, 2005 4:23 pm

Postby RickH » Thu Jun 26, 2008 6:21 pm

I agree. Having this capability really allows a developer to control the mail server at a very low level.

AbsolutelyFreeWeb
Posts: 88
Joined: Sun Nov 21, 2004 11:44 am

Postby AbsolutelyFreeWeb » Fri Jun 27, 2008 8:40 pm

am I doing it right?

Code: Select all

[HKEY_LOCAL_MACHINE\SOFTWARE\Mail Enable\Mail Enable\Connectors\SMTP\Scripts]
"RCPT Script Status"=dword:00000001
"MAIL Script Status"=dword:00000001
"DATA Script Status"=dword:00000001


replaced mesmtpc.exe, put the script in various places, config/scripts in default path, in the plesk path where mail enable is installed etc and restarted, but the response is still standard, nothing has changed. No erros in eventlog.

standard edition though...
Cheap domains com/net/org/info $6.99 including dns manager/forwarding
Quality Hosting from $1.99/mo
Hire IT staff When quality matters

RickH
Posts: 49
Joined: Tue Feb 08, 2005 4:23 pm

Postby RickH » Fri Jun 27, 2008 9:25 pm

I think you have done everything right.
Here is what I have in my registry.
I have all the scripting disabled however.

Code: Select all

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Mail Enable\Mail Enable\Connectors\SMTP\Scripts]
"DATA Script Status"=dword:00000000
"MAIL Script Status"=dword:00000000
"RCPT Script Status"=dword:00000000
"Script Debug Status"=dword:00000000
"rem: For smtp server capable of scripting incoming events..."=""


I was using the professional edition when I was testing. Maybe the standard edition will not work in this case.

polarisie
Posts: 696
Joined: Mon Mar 27, 2006 2:58 pm

Postby polarisie » Sat Jun 28, 2008 1:51 am

RickH wrote:I think you have done everything right.
Here is what I have in my registry.
I have all the scripting disabled however.

Code: Select all

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Mail Enable\Mail Enable\Connectors\SMTP\Scripts]
"DATA Script Status"=dword:00000000
"MAIL Script Status"=dword:00000000
"RCPT Script Status"=dword:00000000
"Script Debug Status"=dword:00000000
"rem: For smtp server capable of scripting incoming events..."=""


I was using the professional edition when I was testing. Maybe the standard edition will not work in this case.


Rick

The beta files are quite dated and i would be hesistant to use this in a live server. Has anyone got an official response from ME regarding this?
MXSCAN :: AntiSpam & AntiVirus for MailEnable (now with Spamtrap/Honeypot!)

Built-in SpamAssassin, Clam, MessageSniffer, DNSBL, URLBL, DCC, Senderbase, SpamTrap, ShortCircuit, Content Filters, Disclamers, Archiving and more.

Visit www.mxuptime.com

Who is online

Users browsing this forum: Google [Bot] and 3 guests