Rules processing (forward vs copy)

Use this forum if you have installed hMailServer and want to ask a question related to a production release of hMailServer. Before posting, please read the troubleshooting guide. A large part of all reported issues are already described in detail here.
Post Reply
mmpfred
New user
New user
Posts: 5
Joined: 2019-06-15 00:48

Rules processing (forward vs copy)

Post by mmpfred » 2019-06-15 01:18

Hello,
This is the first time I am posting to this forum. Firstly, thank you for creating and maintaining hMailServer. It is a fantastic mail server.
I have the following scenarios:
I use Thunderbird as the mail client.
Two accounts are setup on Thunderbird:
1. Smtp account connected to an external mail provider
2. IMAP account connected to hMailserver (local server running Windows 10)

When Smtp account receives an email:
Scenario 1 - Message filter is setup to blindly "Copy" all message to hMailserver.

Scenario 2 - Message filter is setup to blindly "Forward" all message to hMailserver.

On the hMailserver, I created account rules to move the messages to different IMAP folder based on certain subject and who sent the email.

In scenario 1, the account rules did not work(I did not see any log in the log file) and messages were not moved.
Whereas in scenario 2, the rules were applied (it was indicated in the log).

Can any one confirm if account rules are NOT supposed to run in scenario 1?

Please let me know if I am not making sense or this is not the right platform for this question.

thank you.

User avatar
jimimaseye
Moderator
Moderator
Posts: 8118
Joined: 2011-09-08 17:48

Re: Rules processing (forward vs copy)

Post by jimimaseye » 2019-06-15 06:57

run this and post the results: https://www.hmailserver.com/forum/viewt ... 0&t=30914- include RULES when prompted.
HMS 5.6.6 B2383 on Win Server 2008 R2 Foundation, + 5.6.7-B2415 on test.
SpamassassinForWindows 3.4.0 spamd service
AV: Clamwin + Clamd service + sanesecurity defs : https://www.hmailserver.com/forum/viewtopic.php?f=21&t=26829

mmpfred
New user
New user
Posts: 5
Joined: 2019-06-15 00:48

Re: Rules processing (forward vs copy)

Post by mmpfred » 2019-06-15 07:43

Code: Select all

2019-06-15   Hmailserver: 5.6.7-B2425

DOMAINS

   "Domain1.com" - mmxxxxxxxxxxx.com              Enabled: True

SIGNATURE         LIMITS                       DKIM               ADVANCED
  Enabled: False   Max size:                0   Enabled: False   
                   Max message size:        0                      Plus addressing: False
                   Max size of accounts:    0                    
                                                                   Greylisting:     False
-----------------------------------------------------------------------------------------------

GLOBAL RULES
-----------------------------------------------------------------------------------------------

ACCOUNT RULES for sales@Domain1.com:

  1, BestDealForwardToAccounting  Criteria:  Use AND
             From                      Contains        bdprint.ca
             Subject                   Contains        invoice
                                  -----Actions-----
             Forward                                   accounting@Domain1.com
 ---------------------------------------------------------------------
  2, Quote Request                Criteria:  Use AND
             Subject                   Contains        Re: quote request
             Subject                   Not Contains    ORDER
                                  -----Actions-----
             Move To Folder                            INBOX.Vendors.Quotes
 ---------------------------------------------------------------------
  3, FactorFormQuote              Criteria:  Use AND
             From                      Contains        factorforms.com
             Subject                   Contains        Quote
                                  -----Actions-----
             Move To Folder                            INBOX.Vendors.Quotes
-----------------------------------------------------------------------------------------------

IP RANGES

IP: 127.0.0.1 - 127.0.0.1     Priority: 15     Name: My computer

  Allow connections                         Other
     SMTP:   True                              Antispam :   True
     POP3:   True !! Protocol DISABLED !!      Antivirus:   True !! ANTIVIRUS NOT CONFIGURED !!
     IMAP:   True                              SSL/TLS:    False

  Allow Deliveries from                     Require Authentication from
     Local To Local       -  True              Local To Local       - False
     Local To External    -  True              Local To External    - False
     External To Local    -  True              External To Local    - False
     External To External -  True              External To External -  True


IP: 0.0.0.0 - 255.255.255.255     Priority: 10     Name: Internet

  Allow connections                         Other
     SMTP:   True                              Antispam :   True
     POP3:   True !! Protocol DISABLED !!      Antivirus:   True !! ANTIVIRUS NOT CONFIGURED !!
     IMAP:   True                              SSL/TLS:    False

  Allow Deliveries from                     Require Authentication from
     Local To Local       -  True              Local To Local       -  True
     Local To External    -  True              Local To External    -  True
     External To Local    -  True              External To Local    - False
     External To External -  True              External To External -  True


------------------------------------------------------
AUTOBANNED Local Addresses:
    No entries

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

AUTOBAN
  Autoban Enabled: True       Max invalid logon attempts:      3
                              Minutes Before Reset:           30  (0.50 hours, 0.02 days)
                              Minutes to Autoban:             60  (1.00 hours, 0.04 days)

There is a total of 6 auto-ban IP ranges.
-----------------------------------------------------------------------------------------------

INCOMING RELAYS
   No entries
-----------------------------------------------------------------------------------------------

MIRRORING         Disabled
-----------------------------------------------------------------------------------------------

PROTOCOLS

SMTP
GENERAL             DELIVERY                  RFC COMPLIANCE            ADVANCED
No. Connections:  0  No Retries:  4 Mins: 60   Plain Text:        False  Bind: 
                     Host: EXTERNAL.TLD        Empty sender:       True  Batch recipients:   100
Max Msg Size: 40960  Relay:-                   Incorrect endings:  True  Use STARTTLS:      True
                      EXTERNAL.TLD  (ok)       Disc. on invalid:  False  Delivered-To hdr: False
                     Port: 465                                           Loop limit:           5
                     Req Auth: True *User Entered*                       Recipient hosts:     15
                     Con. Sec.: SSL/TLS
  Routes:
     No routes defined.

POP3
 !! Service Not Enabled !!

IMAP
 GENERAL                   PUBLIC FOLDERS                    ADVANCED
  No. Connections:   0      Public folder name: #Public       IMAP sort:  True
                                                              IMAP Quota: True
                                                              IMAP Idle:  True
                                                              IMAP ACL:   True
                                                              Delim: "."
-----------------------------------------------------------------------------------------------

ANTISPAM

GENERAL                              SPAM TESTS              Score   SPAMASSASSIN
  Spam Mark:                  5       Use SPF:            True - 3    Use Spamassassin:   False
  Add X-HmailServer-Spam:     True    Check HELO host:    True - 2
  Add X-HmailServer-Reason:   True    Check MX records:   True - 2
  Add X-HmailServer-Subject:  True    Verify DKIM:        True - 5
              Subject Text: "[SPAM]"
  Spam delete threshold: 20         Maximum message size: 1024

DNSBL ENTRIES:
                  zen.spamhaus.org      Score: 3     Result: 127.0.0.2-8|127.0.0.10-11

SURBL ENTRIES:
                   multi.surbl.org      Score: 3

GREYLISTING:
  Greylisting:   True       Defer mins: 30       Days Unused: 1      Days Used: 36
                            Bypass SPF: True     Bypass A/MX: False

Greylist WHITELIST ENTRIES:
   No entries

Greylist DOMAINS enabled:
  !! No active domains enabled - GREYLISTING INEFFECTIVE !!

WHITELISTING
   No entries
-----------------------------------------------------------------------------------------------

ANTIVIRUS:  No application configured.

  Block Attachments: False
-----------------------------------------------------------------------------------------------

SSL CERTIFICATES
   mmpw
       Certificate: C:\\Program Files (x86)\\hMailServer\\Certs\\certificate.crt
       Private key: C:\\Program Files (x86)\\hMailServer\\Certs\\privateKey.key
-----------------------------------------------------------------------------------------------

SSL/TLS
             SSL 3.0 :   True
             TLS 1.0 :   True
             TLS 1.1 :   True
             TLS 1.2 :   True                Verify Remote SSL/TLS Certs:   True
SslCipherList  :

ECDHE-RSA-AES128-GCM-SHA256     - ECDHE-ECDSA-AES128-GCM-SHA256   - ECDHE-RSA-AES256-GCM-SHA384     
ECDHE-ECDSA-AES256-GCM-SHA384   - DHE-RSA-AES128-GCM-SHA256       - DHE-DSS-AES128-GCM-SHA256       
kEDH+AESGCM                     - ECDHE-RSA-AES128-SHA256         - ECDHE-ECDSA-AES128-SHA256       
ECDHE-RSA-AES128-SHA            - ECDHE-ECDSA-AES128-SHA          - ECDHE-RSA-AES256-SHA384         
ECDHE-ECDSA-AES256-SHA384       - ECDHE-RSA-AES256-SHA            - ECDHE-ECDSA-AES256-SHA          
DHE-RSA-AES128-SHA256           - DHE-RSA-AES128-SHA              - DHE-DSS-AES128-SHA256           
DHE-RSA-AES256-SHA256           - DHE-DSS-AES256-SHA              - DHE-RSA-AES256-SHA              
AES128-GCM-SHA256               - AES256-GCM-SHA384               - ECDHE-RSA-RC4-SHA               
ECDHE-ECDSA-RC4-SHA             - AES128                          - AES256                          
RC4-SHA                         - HIGH                            - !aNULL                          
!eNULL                          - !EXPORT                         - !DES                            
!3DES                           - !MD5                            - !PSK;                           
-----------------------------------------------------------------------------------------------

TCPIP PORTS                                         Connection Sec
               0.0.0.0         / 25    / SMTP   -   None                
               0.0.0.0         / 110   / POP3   -   None                
               0.0.0.0         / 143   / IMAP   -   None                
               0.0.0.0         / 465   / SMTP   -   SSL/TLS             Cert: mmpw
               0.0.0.0         / 587   / IMAP   -   SSL/TLS             Cert: mmpw
               0.0.0.0         / 993   / IMAP   -   SSL/TLS             Cert: mmpw
-----------------------------------------------------------------------------------------------

LOGGING      Logging Enabled: True

  Paths:-
    Current:  C:\Program Files (x86)\hMailServer\Logs\hmailserver_2019-06-15.log
    Error:    C:\Program Files (x86)\hMailServer\Logs\ERROR_hmailserver_2019-06-15.log
    Event:    C:\Program Files (x86)\hMailServer\Logs\hmailserver_events.log - Not present
    Awstats:  C:\Program Files (x86)\hMailServer\Logs\hmailserver_awstats.log
                        APPLICATION -    True
                        SMTP        -    True
                        POP3        -    True
                        IMAP        -    True
                        TCPIP       -    True
                        DEBUG       -    True
                        AWSTATS     -      .
-----------------------------------------------------------------------------------------------

SYSTEM TESTS

Database type: PostgreSQL

IPv6 support is available in operating system.

ERROR: Backup directory has not been specified.

Relative message paths are stored in the database for all messages.

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

HMAILSERVER.INI

[Directories]
Program folder:  C:\Program Files (x86)\hMailServer\
Database folder: 
Data folder:     C:\Program Files (x86)\hMailServer\Data
Log folder:      C:\Program Files (x86)\hMailServer\Logs
Temp folder:     C:\Program Files (x86)\hMailServer\Temp
Event folder:    C:\Program Files (x86)\hMailServer\Events

[Database]
Type=              PostgreSQL
Username=          postgres
PasswordEncryption=1
Port=              5432
Server=            localhost
Internal=          0
-----------------------------------------------------------------------------------------------

Generated by HMSSettingsDiagnostics v1.95, Hmailserver Forum.

User avatar
mattg
Moderator
Moderator
Posts: 20108
Joined: 2007-06-14 05:12
Location: 'The Outback' Australia

Re: Rules processing (forward vs copy)

Post by mattg » 2019-06-16 01:09

mmpfred wrote:
2019-06-15 01:18
I use Thunderbird as the mail client.
Two accounts are setup on Thunderbird:
1. Smtp account connected to an external mail provider
2. IMAP account connected to hMailserver (local server running Windows 10)

When Smtp account receives an email:
Scenario 1 - Message filter is setup to blindly "Copy" all message to hMailserver.

Scenario 2 - Message filter is setup to blindly "Forward" all message to hMailserver.
So how is the SMTP account connected to hMailserver? How is hMailserver getting this mail? Via a thunderbiord rule?
mmpfred wrote:
2019-06-15 01:18
On the hMailserver, I created account rules to move the messages to different IMAP folder based on certain subject and who sent the email.
Why are you setting account rules on hmailserver?
But, Aren't you copying the message using thunderbird rules?

I'm really lost.

Why don't you ALSO use hmailserver's external account to download mail from the SMTP server, and then run your rules in hMailserver
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation

mmpfred
New user
New user
Posts: 5
Joined: 2019-06-15 00:48

Re: Rules processing (forward vs copy)

Post by mmpfred » 2019-06-17 04:39

mattg wrote:
2019-06-16 01:09
So how is the SMTP account connected to hMailserver? How is hMailserver getting this mail? Via a thunderbiord rule?
Correct. All emails are Forwarded (Scenario 1) or Copied (Scenario 2) to hMailServer via Thunderbird message filters.
mattg wrote:
2019-06-16 01:09
Why are you setting account rules on hmailserver?
But, Aren't you copying the message using thunderbird rules?

I'm really lost.
Sorry...that is because I haven't given you any explanation.
I inherited this setup from my predecessor. My PC (so as other people in the organization) is currently receiving email from the service provider via POP3. There is no server, just a bunch of PCs in a workgroup.
I setup hMailServer in hope to move the emails to the server. Once hMailServer goes live, the POP3 access will be terminated (for all PCs) and hMailServer will receive all eMails and everyone will connect to hMailServer via IMAP.
As part of the test phase (and pre-populate hMailServer), emails are copied to hMailServer via Thunderbird message filters. Rules are setup on the hMailServer to move email around so that they are a bit more organized.
I was not able to get the rules to move the emails around until I changed the Thrunderbird filter to 'Forward' email to hMailServer.
mattg wrote:
2019-06-16 01:09
Why don't you ALSO use hmailserver's external account to download mail from the SMTP server, and then run your rules in hMailserver
I didn't think of that option and I don't know how to do that. Can I do that via POP3? Would you provide some instructions please?
I can access the email from my service provider via either POP3 or IMAP. My predecessor had huge problem with IMAP previously so I am not willing to risk anything at the moment.

Thank you for your help.

User avatar
mattg
Moderator
Moderator
Posts: 20108
Joined: 2007-06-14 05:12
Location: 'The Outback' Australia

Re: Rules processing (forward vs copy)

Post by mattg » 2019-06-17 05:03

Each account on hMailserver has an External accounts tab
https://www.hmailserver.com/documentati ... al_account
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation

mmpfred
New user
New user
Posts: 5
Joined: 2019-06-15 00:48

Re: Rules processing (forward vs copy)

Post by mmpfred » 2019-06-17 17:21

Thank you! mattg.
I will work on that this week.

mmpfred
New user
New user
Posts: 5
Joined: 2019-06-15 00:48

Re: Rules processing (forward vs copy)

Post by mmpfred » 2019-06-24 03:37

Everything is good. Thank you for your suggestion.

User avatar
mattg
Moderator
Moderator
Posts: 20108
Joined: 2007-06-14 05:12
Location: 'The Outback' Australia

Re: Rules processing (forward vs copy)

Post by mattg » 2019-06-24 04:34

Thanks for the post back
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation

Post Reply