Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2016-02

processing incoming mail

4 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

duilio foschi

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 ?

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

What exactly I'd like to do is to check for some special tokens in the incoming emails and store or forward them accordingly.

Please instruct me re where to start.

Thank you

Peppe
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20160218/8c0673e6/attachment.html>

Reply by email

Michael Van Canneyt
to duilio foschi
duilio foschi wrote 26 lines
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.

Reply by email

duilio foschi

in this article

http://www.thecodingmachine.com/triggering-a-php-script-when-your-postfix-server-receives-a-mail/

somebody shows a way to run a PHP script when the mail server (postfix in this case) receives a mail.

Cant the same be done with a FPC console application ?

Thank you

Peppe

---
On Thu, 18 Feb 2016, duilio foschi wrote:

we have a linux server with domain (say)

Show quoted text 26 lines
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.

2016-02-18 10:23 GMT+01:00 duilio foschi :

Show quoted text 40 lines
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 ? If possible, I'd like to do that by Lazarus CGIs. What exactly I'd like to do is to check for some special tokens in the incoming emails and store or forward them accordingly. Please instruct me re where to start. Thank you Peppe

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20160220/ee66477d/attachment-0001.html>

Reply by email