eProxy 1.0 review

Download
by rbytes.net on

eProxy software is an SMTP proxy server framework specially designed for use in conjunction with Postfix version 2.1 and higher

License: BSD License
File size: 6K
Developer: Raymond Doetjes
0 stars award from rbytes.net

eProxy software is an SMTP proxy server framework specially designed for use in conjunction with Postfix version 2.1 and higher. However, it does also work as a frontend proxy however security wise I trust on the postfix smtpd.

What can eProxy be used for?
It is very fast and utilizes multi-threading. It is especially fast when it comes to your actual content filtering where you can use the speed of C/C++ in comparison to the interpreted language. It is very easy to use.

There are a few SMTP PROXY implementations out there but all I found are developed in either Perl or Python and some of them are extremely complex to use. This implementation makes it very easy to develop your own content filter in C+ and you only have to implement it in any of the following functions from(string from), to(string to), body(string body) and return a positive number to allow delivery and a negative number to disallow delivery.

You can of course still call to your processing/content filter "script(s)" via a popen(), system() or exec() call and run them through this method.

What do you need to (re)implement
There's actually one source file that is of interest for you and that's the emailHandling.cpp file. In here the following functions are defined:

string getDomainName(string email);
int from(string from);
int rcptto(string to);
int body(string body);
void email(string email);

string getDomainName(string email); This is a convenience method to simply obtain the domainname part of an email address.

void email(string email); In this function you can do something to the email or part of it depending where you BOUNCED the email. It can be used to for instance store all emails in an archive or waiting box, waiting for manual release when an email is a suspect.

int from(string from); In this function you can do checking on the MAIL FROM part of an SMTP session. When your return a negative number the transaction is cancelled with a 550 error, when you return a positive number (larger than 0) then the MAIL FROM is accepted. The string from contains the email address

int rcptto(string to); In this function you can do checking on the RCPT TO part of an SMTP session. The string to contains the email address. Return a negative number to bounce the email return a positive number (large than 0) to continue.

int body(string body); In this function you will implement your actual body part scanning. Only when your result code is a positive number (larger than 0) then the body is send forth to the secondary (delivery) SMTP server. If it is bounced by your code it will not send the DATA command and the data stream, instead it will send a QUIT command and close the socket to the secondary server.

eProxy 1.0 search tags