1

Topic: Run a script after receipt of email

==== Required information ====
- iRedMail version: 0.8.3
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MYSQL
- Linux/BSD distribution name and version: Ubuntu 12.04 LTS
- Related log if you're reporting an issue:
====

Hello,
I wish I run a script after the receipt of mail in the mailbox.

I tried in "master.cf" but I lost the mail, it never arrives in the mailbox

An idea? thanks

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: Run a script after receipt of email

cobex4 wrote:

I wish I run a script after the receipt of mail in the mailbox.

I'm afraid iRedMail doesn't support this.

May i know what you want to do after mail arrived?

3

Re: Run a script after receipt of email

I know it is not supported, but I'm thrown another forum, because I install IredMail ...

Yes immediately after receipt of the e-mail

4

Re: Run a script after receipt of email

May i know what you want to do after mail arrived?

5

Re: Run a script after receipt of email

Run a bash script

6

Re: Run a script after receipt of email

OK, then what does your shell script do?

7

Re: Run a script after receipt of email

Just a simple WGET

/etc/postfix/newsmail.sh EmailDest@mydomain.com

#!/bin/sh
mail = $1
wget -O /dev/null http://www.mydomain.com/cron/imap_news_ … hp?m=$mail
exit

8

Re: Run a script after receipt of email

I guess you want to post sender/recipient address to this URL, right?
If so, you can try this:

*) Enable Amavisd to log basic info of in/out (sent/received) emails in SQL server. Reference: http://www.iredmail.org/wiki/index.php? … in.Amavisd
*) Write a new, separate shell/python script to monitor Amavisd database to check whether there're new mails arrived.
*) If new email arrived, do whatever you want in your script.

This way, you don't need to touch iRedMail configuration at all. Hope it helps. smile