Gmail going straight to Junk for one domain.

Discussion in 'ISPConfig 3 Priority Support' started by Paul Hill, Jun 20, 2023.

  1. Paul Hill

    Paul Hill Member HowtoForge Supporter

    Odd issue here. I client informed us that mail was going directly to the Junk folder, and moving them to the inbox was not working.
    Here are my findings:
    -marked a Junk message [email protected] as Not-Spam in Thunderbird. A second later it goes back to the Junk folder.
    -other messages are working fine, but all of @gmail.com is not.
    -turned off all other users connected to that IMAP mailbox, changed the password to ensure no one else could be connected.
    -it still has the same behavior on a fresh Thunderbird install on a test workstation.
    -turned off all mail clients, sent a new gmail message and used the file system on the server to see where it landed. It is in Junk.
    -there are no headers on this message that are marking the message with a SPAM score
    -I can move the file from Junk to the Inbox from the command-line. It immediately moves back.
    -I configured the client to "Wants All SPAM" in ISPCONFIG. Also set mail filter to "Do not move SPAM emails to Junk folder"
    -None of this helped.
    -gmail addresses work fine for other domains on the system, this is limited to this one client.
     
  2. Th0m

    Th0m ISPConfig Developer Staff Member ISPConfig Developer

    Check the sieve files in /var/vmail/example.com/username and share them with us please :)
     
  3. Paul Hill

    Paul Hill Member HowtoForge Supporter

    The sieve file is empty in that folder.
    Here are the other files:
    ------------------------------------------

    .ispconfig-before.sieve

    # This sieve script is generated by ISPConfig, any changes made will be overwritten.
    # You can create and activate a per-user sieve script (manually or via managesieve),
    # which will execute after this.

    require ["fileinto", "mailbox", "regex", "date", "relational", "vacation", "imap4flags", "envelope", "subaddress", "copy", "reject"];

    ------------------------------------------

    .ispconfig-before.svbin

    ����EL}�$DEfile</var/vmail/bkcustomcoatings.com/info/.ispconfig-before.sieve}
    fileintomailboxregexdate
    relationavacation
    imap4flagenvelope
    subaddresscopyreject

    ------------------------------------------

    .ispconfig.sieve

    # This sieve script is generated by ISPConfig, any changes made will be overwritten.
    # You can create and activate a per-user sieve script (manually or via managesieve),
    # which will execute before this.

    require ["fileinto", "mailbox", "regex", "date", "relational", "vacation", "imap4flags", "envelope", "subaddress", "copy", "reject"];

    ------------------------------------------

    .ispconfig.svbin

    ����>L}�<>file5/var/vmail/bkcustomcoatings.com/info/.ispconfig.sieve}
    fileintomailboxregexdate
    relationavacation
    imap4flagenvelope
    subaddresscopyreject

    ------------------------------------------
     
    Last edited: Jun 20, 2023
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    The only way ISPConfig can move mails to the junk folder is via a .sieve file. Your .sieve file does not contain any rule to move mails to junk, so these emails must be moved to junk by an email client via imap.
     
  5. Paul Hill

    Paul Hill Member HowtoForge Supporter

    I will schedule another test with the clients. I'll change the password on the account so as to ensure no mail clients can possibly affect the outcome.
     
  6. Paul Hill

    Paul Hill Member HowtoForge Supporter

    Hi guys. I have confirmed that gmail is still going directly to junk mail even after a password change on the account. All three workstations have Thunderbird closed and even if opened would not be able to connect.
    I confirmed what folder the mail went into via command-line.

    Thoughts?
     
    Last edited: Jun 20, 2023
  7. pyte

    pyte Well-Known Member HowtoForge Supporter

    So no client involved, the server just receives the message and puts it into junk? What does the maillog/dovecot say when the mail arrives? Usually there should be a message like "Saved to INBOX". Can you check for the mail(s) in question and see what happens there?

    Might also a good idea to check the logs of any spamfilter in use and see if there is something that might hint towards the problem.
     
  8. nhybgtvfr

    nhybgtvfr Well-Known Member HowtoForge Supporter

    are you absolutely sure the other mail clients are disconnected?
    just because thunderbird / outlook etc are closed does not mean they are not still running.. they are annoyingly persistent in keeping their processes running even if the application window has been closed.
    changing the password may also not be enough to stop them.. if they were already running and connected, it may be that the client process is keeping the already active connection open.
    perhaps restarting postfix / dovecot after changing any mailbox password ( or more extremely rebooting the mailserver ) should be tried to 100% ensure that nothing is maintaining an existing connection.
     
  9. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    I have had with Thunderbird same problem about moving a message from Spam to Inbox and said message right-away going back to Spam folder. In my experience this can happen when I have Thunderbird open with the same mailbox at home and at office. If I have exited Thunderbird at home, I can then move the message from Spam to Inbox and it stays there.
    I agree with @nhybgtvfr, make sure no Thunderbird is running with the same Inbox connected, then test again.
    A mystery to me is still why this problem only appears with some messages, but it seems with a particular sender messages always go to Spam and moving to Inbox or marking as not spam is not effective. I can not find in Thunderbird any way to see why it puts the message to Spam.
     
  10. till

    till Super Moderator Staff Member ISPConfig Developer

    Restarting postfix and dovecot is a good idea as changing the password probably takes affect on next connect only. Users also sometime overlook that they also connected their mobile phone, which is an IMAP client as well. Technically, the email can be moved to junk only via sieve or by an imap capable email client, and as we ruled out that sieve is doing it by checking that the sieve files are empty (except of the includes), only the option that an imap client is moving the email is left. Or, we have another sieve file or globaö sieve file not manage dor created by ISPConfig somewhere, but I guess you would know that and this would be very untypical for an ISPConfig setup.
     
  11. Paul Hill

    Paul Hill Member HowtoForge Supporter

    Thanks for all the feedback guys.
    There are three workstations that are connecting to this mailbox. No phones, no home PC's etc. All three copies of Thunderbird were completely closed during tests but perhaps there is a service like how Outlook remains 'open' after closing.
    I think the best way to test things would be for all three computers to be offline, password to the account changed, then restart postfix/dovecot. This should in effect break any external connectivity.
    I'll schedule this test over the weekend. Thanks for the great insight!

    Where would a global sieve file be located if there was one. I don't believe this is the case since it doesn't seem to happen with any other domains.
     
  12. till

    till Super Moderator Staff Member ISPConfig Developer

    If there would be one, then its configuration and location must be somewhere in dovecot.conf file.
     

Share This Page