1

Topic: Integrating custom services/backups.

==== Required information ====
- iRedMail version: 0.9.5-1
- Linux/BSD distribution: CentOS Linux release 7.2.1511 (Core)
- Store mail accounts in which backend: MySQL
- Web server: NGINX
====

I have two programs I'd like to develop (with Node.js) and integrate with iRedMail and I hope I can verify my current direction.

The first would be a Node.js program that would be called whenever any new piece of mail arrives. The header and content of the new message would be streamed or passed to this script and the script can the react how I'd like. So, would this script be needed to be hooked into postfix (maybe /etc/postfix/master.cf?..) or is there something included with iRedMail I can benefit from directly?

The second would be a scheduled Node.js program that would backup all the latest contents, across all domains and users, to AWS Glacier. I've got my Node.js program uploading large files successfully with Glacier, so now I want to make sure I am getting all of my latest data. Do the files in /var/vmail/backup/mysql/${YEAR}/${MONTH}/${DAY} include all of my domain's and user's messages and attachments? My current backups are less than a megabyte so I'm wondering if I'm missing any other data or any of my attachments. My active directory (/var/vmail/vmail1/${domain}/x/x/x/${user}/Maildir) is no greater than one megabyte and I know I have multiple messages each with megabytes of attachments, what directory could I find these attachments to also backup?

Thanks!

----

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

2

Re: Integrating custom services/backups.

4jamesallen wrote:

The first would be a Node.js program that would be called whenever any new piece of mail arrives. The header and content of the new message would be streamed or passed to this script and the script can the react how I'd like. So, would this script be needed to be hooked into postfix (maybe /etc/postfix/master.cf?..) or is there something included with iRedMail I can benefit from directly?

You have to use your program as a transport program, or a milter, so that it can get the full message. And yes it must be defined in /etc/postfix/master.cf (as a transport), or /etc/postfix/main.cf (as a milter).

References:
- http://www.postfix.org/postconf.5.html#transport_maps
- http://www.postfix.org/transport.5.html

4jamesallen wrote:

The second would be a scheduled Node.js program that would backup all the latest contents, across all domains and users

- /var/vmail/backup is just SQL/LDAP data, no mailboxes.
- /var/vmail/vmail1 has all mailboxes and sieve rules (mail filters).