1 (edited by duy_dang2110 2016-09-28 15:07:30)

Topic: email always goes to junk

==== Required information ====
- iRedMail version (check /etc/iredmail-release):
- Linux/BSD distribution name and version:
- Store mail accounts in which backend (LDAP/MySQL/PGSQL):
- Web server (Apache or Nginx):
- Manage mail accounts with iRedAdmin-Pro?
- Related log if you're reporting an issue:
====
Hi all,
I run into this problem , One user on my iredmail server (loc.nguyen) always get email from dinhnam.nguyen in his junk folder , even  dinhnam.nguyen is in loc.nguyen mail contact and domain_a is in whitelist  , any body know how to fix it , here is the mail log :

Sep 28 13:21:50 mail amavis[2793]: (02793-06) Passed CLEAN {RelayedInternal}, MYUSERS LOCAL [IP]:46741 [IP] <dinhnam.nguyen@domain_a > -> <loc.nguyen@domain_b >, Queue-ID: CEB9674042B, Message-ID: <3341D231F40DD64FBB3E56B24A0279900111D1E724@HCMHOEXC01.korealife.com.vn>, mail_id: GSDsLok93lvs, Hits: -2.999, size: 20502, queued_as: 07A4E740443, 10061 ms
Sep 28 13:21:50 mail postfix/smtp[7285]: CEB9674042B: to=<loc.nguyen@domain_b >, relay=127.0.0.1[127.0.0.1]:10024, delay=11, delays=0.65/0.03/0.01/10, dsn=2.0.0, status=sent (250 2.0.0 from MTA(smtp:[127.0.0.1]:10025): 250 2.0.0 Ok: queued as 07A4E740443)
Sep 28 13:21:50 mail postfix/pipe[7297]: 07A4E740443: to=<loc.nguyen@domain_b >, relay=dovecot, delay=0.39, delays=0.05/0.02/0/0.31, dsn=2.0.0, status=sent (delivered via dovecot service)

Thank you .

----

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

2

Re: email always goes to junk

Append the content of below file to your Amavisd config file, restart Amavisd service, re-send an email to get the junked email.
https://bitbucket.org/zhb/iredmail/src/ … /log_templ

Amavisd will log SpamAssassin scores and rules in log file, we need the scores and rules for troubleshooting.

3 (edited by duy_dang2110 2016-09-28 16:45:32)

Re: email always goes to junk

Hi Zhang ,
I don't know where I suppose to put the code so I turn log level to 5 , here is the log file , thank you .

Sep 28 14:57:09 mail postfix/qmgr[1820]: 7683374043D: from=<dinhnam.nguyen@domain_a>, size=20466, nrcpt=1 (queue active)
Sep 28 14:57:09 mail amavis[24415]: (24415-14) ESMTP< MAIL FROM:<dinhnam.nguyen@domain_a> SIZE=20466\r\n
Sep 28 14:57:09 mail amavis[24415]: (24415-14) lookup [local_domains] => true,  "dinhnam.nguyen@domain_a" matches, result="1", matching_key="(constant:1)"
Sep 28 14:57:09 mail amavis[24415]: (24415-14) query_keys: dinhnam.nguyen@domain_a, dinhnam.nguyen, @domain_a, @.domain_a, @.com.vn, @.vn, @.
Sep 28 14:57:09 mail amavis[24415]: (24415-14) lookup_sql sel_policy "dinhnam.nguyen@domain_a", query args: [dinhnam.nguyen@domain_a,-3], [dinhnam.nguyen,-3], [@domain_a,-3], [@.domain_a,-3], [@.com.vn,-3], [@.vn,-3], [@.,-3]
Sep 28 14:57:09 mail amavis[24415]: (24415-14) lookup_sql, "dinhnam.nguyen@domain_a" no match
Sep 28 14:57:09 mail amavis[24415]: (24415-14) lookup_sql_field(local), "dinhnam.nguyen@domain_a" no matching records
Sep 28 14:57:09 mail amavis[24415]: (24415-14) lookup [local_domains] => true,  "dinhnam.nguyen@domain_a" matches, result="1", matching_key="(constant:1)"
Sep 28 14:57:09 mail amavis[24415]: (24415-14) lookup [debug_sender] => undef, "dinhnam.nguyen@domain_a" does not match
Sep 28 14:57:09 mail amavis[24415]: (24415-14) ESMTP> 250 2.1.0 Sender <dinhnam.nguyen@domain_a> OK
Sep 28 14:57:09 mail amavis[24415]: (24415-14) ESMTP::10024 /var/spool/amavisd/tmp/amavis-20160928T144801-24415-2i6uowZb: <dinhnam.nguyen@domain_a> -> <loc.nguyen@domain_b> SIZE=20466 Received: from mail.domain_b ([127.0.0.1]) by mail.domain_b (mail.domain_b [127.0.0.1]) (amavisd-new, port 10024) with ESMTP for <loc.nguyen@domain_b>; Wed, 28 Sep 2016 14:57:09 +0700 (ICT)
Sep 28 14:57:09 mail amavis[24415]: (24415-14) save_info_preliminary ETlLJH-Zc20Y, sender id: 3923, dinhnam.nguyen@domain_a, exists
Sep 28 14:57:09 mail amavis[24415]: (24415-14) Checking: ETlLJH-Zc20Y MYUSERS [182.237.20.122] <dinhnam.nguyen@domain_a> -> <loc.nguyen@domain_b>
Sep 28 14:57:09 mail amavis[24415]: (24415-14) 2822.From: <dinhnam.nguyen@domain_a>
Sep 28 14:57:09 mail amavis[24415]: (24415-14) wbl: checking sender <dinhnam.nguyen@domain_a>
Sep 28 14:57:09 mail amavis[24415]: (24415-14) lookup [blacklist_sender<dinhnam.nguyen@domain_a>,blacklist_sender] => undef, "dinhnam.nguyen@domain_a" does not match
Sep 28 14:57:09 mail amavis[24415]: (24415-14) lookup [whitelist_sender<dinhnam.nguyen@domain_a>,whitelist_sender] => undef, "dinhnam.nguyen@domain_a" does not match
Sep 28 14:57:09 mail amavis[24415]: (24415-14) lookup_re("dinhnam.nguyen@domain_a"), no matches
Sep 28 14:57:09 mail amavis[24415]: (24415-14) query_keys: dinhnam.nguyen@domain_a, dinhnam.nguyen@, domain_a, .domain_a, .com.vn, .vn, .
Sep 28 14:57:09 mail amavis[24415]: (24415-14) lookup_hash(dinhnam.nguyen@domain_a), no matches
Sep 28 14:57:09 mail amavis[24415]: (24415-14) lookup [score_sender<dinhnam.nguyen@domain_a>] => undef, "dinhnam.nguyen@domain_a" does not match

4

Re: email always goes to junk

Paste FULL log related to the email please.

5 (edited by duy_dang2110 2016-09-28 20:48:40)

Re: email always goes to junk

Hi Zhang , Please check attached file for the log related to user , thank you .

6

Re: email always goes to junk

Strange, i didn't see any SpamAssassin rules in log. Could you please also turn on 'sa_debug' setting in Amavisd config file, then try again?

7

Re: email always goes to junk

Hi Zhang , I turned on sa_debug and here is the logs file . Thank you .

Post's attachments

log.txt 623.13 kb, 2 downloads since 2016-09-29 

You don't have the permssions to download the attachments of this post.

8

Re: email always goes to junk

I expect to see log line like below, but i cannot find it in attached log file:

Sep 30 01:44:07 c7 amavis[2564]: (02564-01) spam_scan: score=1.176 autolearn=no autolearn_force=no tests=[ALL_TRUSTED=-1,DATE_IN_PAST_12_24=0.804,DKIM_ADSP_NXDOMAIN=0.8,INVALID_DATE=0.432,MISSING_MID=0.14] recips=0

Could you please try to append the content of below file to your Amavisd config file, restart Amavisd service, re-send an email to get the junked email. Amavisd will log SpamAssassin scores and rules in log file, we need the scores and rules for troubleshooting.
https://bitbucket.org/zhb/iredmail/src/ … /log_templ

9

Re: email always goes to junk

Hi Zhang , Please show me how do it , I can't find $log_templ in my Amavisd config file (/etc/amavisd/amavisd.conf) . I try to put the hold code into the config file , but it does not work . Thank you

10

Re: email always goes to junk

Just copy the content of that file, paste it in /etc/amavisd/amavisd.conf before the last line "1;". Save it, restart amavisd service.

11

Re: email always goes to junk

Hi Zhang , here is the log file after I put the code in, follow your instruction , please take a look . Thank you

Post's attachments

Sep 30 08.docx 41.46 kb, 2 downloads since 2016-09-30 

You don't have the permssions to download the attachments of this post.

12

Re: email always goes to junk

The log contains 6 emails, all are clean, not spam.

[RP_MATCHES_RCVD=-2.999]
[RP_MATCHES_RCVD=-2.999]
[RP_MATCHES_RCVD=-2.999]
[RP_MATCHES_RCVD=-2.999,SUBJ_ALL_CAPS=1.625]
[RP_MATCHES_RCVD=-2.999,SUBJ_ALL_CAPS=1.625]
[RP_MATCHES_RCVD=-2.999,SUBJ_ALL_CAPS=1.625]

13

Re: email always goes to junk

Hi Zhang , I wonder why email from dinhnam.nguyen always got in roundcube junk folder . is there anything else we need to check ?, have you got any idea ? . Thank you .

14

Re: email always goes to junk

Email was delivered to Junk folder because it's marked as spam, what I tried to do was figuring out why the email was marked as spam, but I didn't get that info from your log.

You can check global sieve rule (/var/vmail/sieve/*.sieve) and personal sieve scripts (in Roundcube: Settings - > Filters), make sure you don't have rule to move certain emails to Junk folder.

15

Re: email always goes to junk

So trange I disabled global sieve rule by #sieve_before  in file /etc/devecot/dovecot.conf but the emails still go to junk .

16

Re: email always goes to junk

Check personal sieve rules.

17

Re: email always goes to junk

I removed all the personal sieve rules , but still get the same result . still don't know what is going wrong .

18

Re: email always goes to junk

Turn on debug mode in Dovecot[1], send testing email again, check its log files while delivering the testing email:
http://www.iredmail.org/docs/debug.dovecot.html

Log files need to check are:

- /var/log/dovecot.log
- /var/log/dovecot-sieve.log
- /var/log/dovecot-lmtp.log

19

Re: email always goes to junk

Hi Zhang , File dovecot-lmtp.log is empty , please check attached files for dovecot.log and dovecot-sieve.log . Thank you .

Post's attachments

dovecot-sieve.log 170.27 kb, file has never been downloaded. 

dovecot.log 1.31 mb, file has never been downloaded. 

You don't have the permssions to download the attachments of this post.

20

Re: email always goes to junk

Dear duy_dang2110,

Please extract related log and paste here, i don't know which one is your testing email.