1 (edited by Thierry 2015-09-05 14:34:13)

Topic: [SOLVED]Return receipt and Delivred status notification

==== Required information ====
- iRedMail version (check /etc/iredmail-release):  0.9.2
- Linux/BSD distribution name and version: Debian 8
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): Mysql
- Web server (Apache or Nginx): Nginx
- Manage mail accounts with iRedAdmin-Pro? No
- Related log if you're reporting an issue:
====

Hi,
When sending emails, it seems that Return receipt and Delivred status notif don't show/work ...
I don't know from where to start for debugging ?
Is there any special config files to check in ?
Thx

----

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

2

Re: [SOLVED]Return receipt and Delivred status notification

Did you change any setting? It should work with iRedMail-0.9.2 default settings.

If you upgraded from old iRedMail release, it's mentioned in this upgrade tutorial:
http://www.iredmail.org/docs/upgrade.ir … ull_sender

3 (edited by Thierry 2015-08-31 16:56:24)

Re: [SOLVED]Return receipt and Delivred status notification

ZhangHuangbin wrote:

Did you change any setting? It should work with iRedMail-0.9.2 default settings.

If you upgraded from old iRedMail release, it's mentioned in this upgrade tutorial:
http://www.iredmail.org/docs/upgrade.ir … ull_sender

Didn't change anything from original 0.9.2  ....
Seems now to work after adding modification from the wiki ...

but:  2015-08-31 10:52:43 ERROR <!> Error applying plugin amavisd_wblist: need more than 1 value to unpack

In the same time,  I have received the Status notification that the mail has been delivred

Thx

4

Re: [SOLVED]Return receipt and Delivred status notification

Thierry wrote:

but:  2015-08-31 10:52:43 ERROR <!> Error applying plugin amavisd_wblist: need more than 1 value to unpack

Open file /opt/iRedAPD-1.6.0/libs/amavisd/core.py, find below line:

        return SMTP_ACTIONS['default']

Replace it by:

        return (True, {})

Save your change and restart iRedAPD service.

5

Re: [SOLVED]Return receipt and Delivred status notification

ZhangHuangbin wrote:
Thierry wrote:

but:  2015-08-31 10:52:43 ERROR <!> Error applying plugin amavisd_wblist: need more than 1 value to unpack

Open file /opt/iRedAPD-1.6.0/libs/amavisd/core.py, find below line:

        return SMTP_ACTIONS['default']

Replace it by:

        return (True, {})

Save your change and restart iRedAPD service.

I have done it ... but still the same problem ....

addr_type = is_valid_amavisd_address(account)
    if addr_type == 'email':
        sql_valid_rcpts = """'%s', '%s', '%s', '%s'""" % (
            account,                            # full email address
            '@' + kwargs['recipient_domain'],   # entire domain
            '@.' + kwargs['recipient_domain'],  # sub-domain
            '@.')                               # catch-all
    else:
        # Postfix should use full email address as recipient.
        logging.debug('Policy account is not an email address.')
        return (True,{})

Thx for your help.

6

Re: [SOLVED]Return receipt and Delivred status notification

Did you restart iRedAPD service?

7

Re: [SOLVED]Return receipt and Delivred status notification

ZhangHuangbin wrote:

Did you restart iRedAPD service?

yes

8

Re: [SOLVED]Return receipt and Delivred status notification

2015-08-31 16:41:29 INFO [192.168.xxx.xxx] RCPT, user@domain.ltd -> user1@domain.ltd, DUNNO
2015-08-31 16:41:43 ERROR <!> Error applying plugin amavisd_wblist: need more than 1 value to unpack
2015-08-31 16:41:43 INFO [xx.xxx.xx.xx] RCPT,  -> user@domain.ltd, DUNNO

9

Re: [SOLVED]Return receipt and Delivred status notification

Please show me output of command below:

ls -dl /opt/

10

Re: [SOLVED]Return receipt and Delivred status notification

drwxr-xr-x 4 root root 4096 août  11 06:01 /opt/

11

Re: [SOLVED]Return receipt and Delivred status notification

Oops, my mistake, please remove '-d' flag and try again:

ls -l /opt/

12

Re: [SOLVED]Return receipt and Delivred status notification

ls -l /opt/
total 8
lrwxrwxrwx 1 root    root      18 août  11 06:01 iredapd -> /opt/iRedAPD-1.6.0
dr-xr-xr-x 6 iredapd iredapd 4096 août  31 10:39 iRedAPD-1.6.0
drwxr-xr-x 4 root    root    4096 août  11 06:01 www

13

Re: [SOLVED]Return receipt and Delivred status notification

Hi .... Any news ?

14

Re: [SOLVED]Return receipt and Delivred status notification

Hi Thierry,

sorry about my late reply. Could you please try this patch?
http://www.iredmail.org/forum/post40019.html#p40019

15

Re: [SOLVED]Return receipt and Delivred status notification

Is there any procedure to apply a patch in iRedMail, I don't want to break something ... ?
Is the patch to apply is this one:

diff -r 5300e50901f4 plugins/amavisd_wblist.py
--- a/plugins/amavisd_wblist.py    Mon Jun 08 14:11:53 2015 +0800
+++ b/plugins/amavisd_wblist.py    Wed Jun 10 21:25:44 2015 +0800
@@ -69,8 +69,12 @@
     valid_senders = amavisd_lib.get_valid_addresses_from_email(sender)
     valid_recipients = amavisd_lib.get_valid_addresses_from_email(recipient)
 
-    # 'user@*'
-    valid_recipients.append(recipient.split('@', 1)[0] + '@*')
+    # Sender 'username@*'
+    sender_username = sender.split('@', 1)[0]
+    if '+' in sender_username:
+        valid_senders.append(sender_username.split('+', 1)[0] + '@*')
+    else:
+        valid_senders.append(sender_username + '@*')
 
     # Append original IP address and all possible wildcast IP addresses
     valid_senders.append(client_address)

Thx

16

Re: [SOLVED]Return receipt and Delivred status notification

The patch is post #19: http://www.iredmail.org/forum/post40019.html#p40019

diff -r 063b3794ef3d libs/amavisd/core.py
--- a/libs/amavisd/core.py    Wed Jun 10 21:28:29 2015 +0800
+++ b/libs/amavisd/core.py    Thu Jun 11 07:10:52 2015 +0800
@@ -69,17 +69,16 @@
     logging.debug('Getting applicable policies')
     account = str(account).lower()
 
-    addr_type = is_valid_amavisd_address(account)
-    if addr_type == 'email':
-        sql_valid_rcpts = """'%s', '%s', '%s', '%s'""" % (
-            account,                            # full email address
-            '@' + kwargs['recipient_domain'],   # entire domain
-            '@.' + kwargs['recipient_domain'],  # sub-domain
-            '@.')                               # catch-all
-    else:
+    if is_valid_amavisd_address(account) != 'email':
         # Postfix should use full email address as recipient.
         logging.debug('Policy account is not an email address.')
-        return SMTP_ACTIONS['default']
+        return (True, {})
+
+    sql_valid_rcpts = """'%s', '%s', '%s', '%s'""" % (
+        account,                            # full email address
+        '@' + kwargs['recipient_domain'],   # entire domain
+        '@.' + kwargs['recipient_domain'],  # sub-domain
+        '@.')                               # catch-all
 
     logging.debug('Valid policy accounts for recipient %s: %s' % (account, sql_valid_rcpts))
     try:

17

Re: [SOLVED]Return receipt and Delivred status notification

Where to apply this patch ?
How to proceed ?

Thx

18

Re: [SOLVED]Return receipt and Delivred status notification

*) Save the patch in a file. e.g. /root/iredapd.patch
*) Verify the patch:

cd /opt/iRedAPD-1.6.0/
patch -p1 --dry-run < /root/iredapd.patch

If not error in output message, it's safe to apply this patch without '--dry-run' flags.

patch -p1 < /root/iredapd.patch

19

Re: [SOLVED]Return receipt and Delivred status notification

After a past/copy:

diff -r 063b3794ef3d libs/amavisd/core.py
--- a/libs/amavisd/core.py    Wed Jun 10 21:28:29 2015 +0800
+++ b/libs/amavisd/core.py    Thu Jun 11 07:10:52 2015 +0800
@@ -69,17 +69,16 @@
     logging.debug('Getting applicable policies')
     account = str(account).lower()

-    addr_type = is_valid_amavisd_address(account)
-    if addr_type == 'email':
-        sql_valid_rcpts = """'%s', '%s', '%s', '%s'""" % (
-            account,                            # full email address
-            '@' + kwargs['recipient_domain'],   # entire domain
-            '@.' + kwargs['recipient_domain'],  # sub-domain
-            '@.')                               # catch-all
-    else:
+    if is_valid_amavisd_address(account) != 'email':
         # Postfix should use full email address as recipient.
         logging.debug('Policy account is not an email address.')
-        return SMTP_ACTIONS['default']
+        return (True, {})
+
+    sql_valid_rcpts = """'%s', '%s', '%s', '%s'""" % (
+        account,                            # full email address
+        '@' + kwargs['recipient_domain'],   # entire domain
+        '@.' + kwargs['recipient_domain'],  # sub-domain
+        '@.')                               # catch-all

     logging.debug('Valid policy accounts for recipient %s: %s' % (account, sql_valid_rcpts))

I have removed the "try:" at the end .... But even with this "try" I have the same mistake ...

root@zo:/opt/iRedAPD-1.6.0# patch -p1 --dry-run < /root/iredapd.patch
checking file libs/amavisd/core.py
Hunk #1 FAILED at 69.
1 out of 1 hunk FAILED

Thx

20

Re: [SOLVED]Return receipt and Delivred status notification

Could you please try to modify libs/amavisd/core.py manually?

21

Re: [SOLVED]Return receipt and Delivred status notification

I am not familiar with patches ....
Just to be sure ....

When there is a "+" in front I have to add
When there is a "-" in front I have to remove ?

Am I right ?

22

Re: [SOLVED]Return receipt and Delivred status notification

I have done it manually ....
Please check it:

 logging.debug('Getting applicable policies')
    account = str(account).lower()

      if is_valid_amavisd_address(account) != 'email':
         # Postfix should use full email address as recipient.
         logging.debug('Policy account is not an email address.')
        return (True, {})
        # Postfix should use full email address as recipient.
        logging.debug('Policy account is not an email address.')
        return (True, {})

     sql_valid_rcpts = """'%s', '%s', '%s', '%s'""" % (
        account,                            # full email address
        '@' + kwargs['recipient_domain'],   # entire domain
        '@.' + kwargs['recipient_domain'],  # sub-domain
        '@.')                               # catch-all

Still have the same problem.

23

Re: [SOLVED]Return receipt and Delivred status notification

Weird. Is it possible to let me login to your server (via ssh) for further debug? root privilege is required.
If it's ok, please contact me: zhb _at_ iredmail dot org, i will mail you my ssh public key.

24

Re: [SOLVED]Return receipt and Delivred status notification

done