1

Topic: Feature implementation requests for future release

A few feature implementation requests for a future release of iRedMail.

-Ability to auto delete messages.

Adding this to crontab:
# Cleanup Drafts, Sent, Junk, Trash
0 3 * * * /usr/local/bin/dovecot-expunge.sh

and creating this script /usr/local/bin/dovecot-expunge.sh with the following contents:

#!/bin/bash
#
DOVEADM="/usr/bin/doveadm";

$DOVEADM expunge -A mailbox Drafts savedbefore 365d
$DOVEADM expunge -A mailbox Sent savedbefore 365d
$DOVEADM expunge -A mailbox Junk savedbefore 30d
$DOVEADM expunge -A mailbox Trash savedbefore 30d

will remove messages in Draft and Sent folders older than 365 days, and remove messages older then 30 days in the Junk and Trash folders.


-Remove Postfix headers on outgoing messages by default. Postfix gives away lots of information that most probably wouldn't include given a choice, especially when sending with a client such as Thunderbird or any iPhone or Android SMTP mail app. With the below solution the log files still have this information for outgoing messages if needed.

Adding a file called: /etc/postfix/smtp_header_checks

with the below:

/^\s*(Received: from)[^\n]*(.*)/ REPLACE $1 [127.0.0.1] (localhost [127.0.0.1])$
/^\s*User-Agent/        IGNORE
/^\s*X-Enigmail/        IGNORE
/^\s*X-Mailer/          IGNORE
/^\s*X-Originating-IP/  IGNORE

and editing /etc/postfix/master.cf by finding:
submission inet n       -       n       -       -       smtpd
 
and adding:
   -o cleanup_service_name=subcleanup

and by adding
subcleanup unix n       -       -       -       0       cleanup
    -o header_checks=pcre:/etc/postfix/smtp_header_checks

to /etc/postfix/master.cf

----

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

2

Re: Feature implementation requests for future release

schnappi wrote:

-Ability to auto delete messages.
...
DOVEADM="/usr/bin/doveadm";
$DOVEADM expunge -A mailbox Drafts savedbefore 365d

This won't be added in iRedMail. It might be your choice, but not all users want to delete old emails.

schnappi wrote:

-Remove Postfix headers on outgoing messages by default.

I don't think these mail headers are harmful. Why remove them?

3 (edited by schnappi 2016-07-12 00:24:32)

Re: Feature implementation requests for future release

ZhangHuangbin wrote:

This won't be added in iRedMail. It might be your choice, but not all users want to delete old emails.

Agreed. What about including this scrip to only delete mail in the trash older than 365 days?

ZhangHuangbin wrote:

I don't think these mail headers are harmful. Why remove them?

Wouldn't classify these headers as harmful persay...but they do give the LAN hostname and LAN IP of the sending client. Wouldn't it be better to not advertise this information by default?

4

Re: Feature implementation requests for future release

schnappi wrote:

Agreed. What about including this scrip to only delete mail in the trash older than 365 days?

I'm afraid that you have to add it by yourself.

Deleting message or mailbox is serious operation, so we must leave it to sysadmin.

schnappi wrote:

Wouldn't classify these headers as harmful persay...but they do give the LAN hostname and LAN IP of the sending client. Wouldn't it be better to not advertise this information by default?

If no any info of sender, will it be considered as spam too?
Anyway, no plan to do this in iRedMail, but you're free to do it yourself.

5

Re: Feature implementation requests for future release

ZhangHuangbin wrote:

If no any info of sender, will it be considered as spam too?

No.

6

Re: Feature implementation requests for future release

Hi Zhang,

In script to prune messages in trash am using

DOVEADM="/usr/bin/doveadm";

Where is the doveadm file located on a Nginx server? It is not located in "/usr/bin/doveadm"

Thanks.

7

Re: Feature implementation requests for future release

schnappi wrote:

Where is the doveadm file located on a Nginx server? It is not located in "/usr/bin/doveadm"

It's installed by Dovecot package, please check files installed by dovecot.

8

Re: Feature implementation requests for future release

Problem solved.

Forgot to chmod +x the script.