[Lazarus] processing incoming mail

Michael Van Canneyt michael at freepascal.org
Thu Feb 18 10:33:58 CET 2016



On Thu, 18 Feb 2016, duilio foschi wrote:

> we have a linux server with domain (say)
>
> www.ourserver.com
>
> A mail server of some type is installed.
>
> The mail server uses the following mysql tables:
>
> +----------------------+
> | Tables_in_mailserver |
> +----------------------+
> | view_aliases         |
> | view_users           |
> | virtual_aliases      |
> | virtual_domains      |
> | virtual_users        |
> +----------------------+
>
> Probably some of you will quickly recognize the sort of mailserver used
> here (I dont remember its name).
>
> By accessing these tables from MySQL I know how to create a new email
> account and how to forward emails sent to each mail account.
>
> Is there a way to programmatically intercept all incoming emails, process
> them and eventually store them in a database ?

You should define a filter for your MTA. The filter is then a program you
write, and this program can do whatever it wants. It will need to report
back to the MTA. Usually some pre-defined exit codes are used for this.

>
> If possible, I'd like to do that by Lazarus CGIs.

I don't think CGI is an option for such a system.

Michael.




More information about the Lazarus mailing list