WritingRules in SPAMASSASSIN

For our first rule, let’s start with the simplest type of rules, the basic “body” rule. These rules search the body of the message with a regular expression and if it matches, the corresponding score is assigned. Body rules also include the Subject as the first line of the body content. See [DumpTextPlugin]
Let’s look at a really basic fictitious rule:

body LOCAL_DEMONSTRATION_RULE	/test/
score LOCAL_DEMONSTRATION_RULE 0.1
describe LOCAL_DEMONSTRATION_RULE 	This is a simple test rule

This rule does a simple case-sensitive search of the body of the email for the string “test” and adds a 0.1 to the score of the email if it finds it. Now, this rule is pretty simple as rules go. It will match “test” but also “testing” and “attest”. The describe statement contains the text which will be placed into the verbose report, if verbose reports are used (this is the default setting for the body, in Spamassassin version 2.5x and upwards).

In regular expressions a \b can be used to indicate where a word-break (anything that isn’t an alphanumeric character or underscore) must exist for a match. Our rule above can be made to not match “testing” or “attest” like so:

body LOCAL_DEMONSTRATION_RULE	/\btest\b/

The rule can also be made case-insensitive by adding an i to the end, like this:

body LOCAL_DEMONSTRATION_RULE	/\btest\b/i
score LOCAL_DEMONSTRATION_RULE 0.1

Now the rule will match any combination of upper or lower case that spells “test” surrounded by word breaks of some form.

Source: WritingRules – SPAMASSASSIN – Apache Software Foundation

WritingRules in SPAMASSASSIN was last modified: June 30th, 2020 by Jovan Stosic

NFS – Dovecot Wiki

NFS

NFS is commonly used in one of these ways:

  1. Dovecot is run in a single computer.
  2. Dovecot is run in multiple computers, users are redirected more or less randomly to different computers.
  3. Dovecot is run in multiple computers, each user is assigned a specific computer which is used whenever possible.

The only way to reliably implement the 2nd setup is with the director service.

Dovecot configuration

Single Dovecot server setup or Dovecot director cluster setup:

mmap_disable = yes
#dotlock_use_excl = no # only needed with NFSv2, NFSv3+ supports O_EXCL and it's faster
mail_fsync = always
mail_nfs_storage = no
mail_nfs_index = no

Multi-server setup that tries to flush NFS caches (increases NFS operations, and isn’t fully reliable), try not to use this:

mmap_disable = yes
#dotlock_use_excl = no # only needed with NFSv2, NFSv3+ supports O_EXCL and it's faster
mail_fsync = always
# These settings slow things down and don't fully work, use director proxy instead:
mail_nfs_storage = yes
mail_nfs_index = yes

Common issues

Clock synchronization

Run ntpd in the NFS server and all the NFS clients to make sure their clocks are synchronized. If the clocks are more than one second apart from each others and multiple computers access the same mailbox simultaneously, you may get errors.

NFS caching problems

NFS caching is a big problem when multiple computers are accessing the same mailbox simultaneously. The best fix for this is to prevent it from happening. Configure your setup so that a user always gets redirected to the same server (unless it’s down). This also means that mail deliveries must be done by the same server, or alternatively it shouldn’t update index files.

Dovecot flushes NFS caches when needed if you set mail_nfs_storage=yes, but unfortunately this doesn’t work 100%, so you can get random errors.

Disabling NFS attribute cache helps a lot in getting rid of caching related errors, but this makes the performance MUCH worse and increases the load on NFS server. This can usually be done by giving actimeo=0 or noac mount option.

Index files

If you keep the index files stored on NFS, you’ll need to set mmap_disable=yes. If you’re not running lockd you’ll have to set lock_method=dotlock, but this degrades performance. Note that some NFS installations have problems with lockd. If you’re beginning to get all kinds of locking related errors, try if the problems go away with dotlocking.

With mbox/Maildir formats (but not dbox!) it’s also possible to store index files on local disk instead of on NFS. If the user gets redirected to different servers, the local indexes are automatically created/updated. If the user is (nearly) always redirected to the same server this should be fine and you would likely get higher performance than indexes stored on NFS, but if the server changes it can be slow to recreate the index/cache files.

Source: NFS – Dovecot Wiki

NFS – Dovecot Wiki was last modified: June 30th, 2020 by Jovan Stosic

Габер

Габер (науч. Carpinus) — род релативно мало дрво од семејството брези (Betulaceae). Опфаќа 30–40 вида, застапени во северните умерени подрачја. Најмногу видови има во источна Азија, особено Кина. Во Европа виреат само два вида, а во Северна Америка само еден.

Во Македонија

Во Македонија се присутни обичниот габер, наречен и сабука или воденика (C.betulus), белиот габер (C. orientalis) и црниот габер (Ostrya carpinifolia), кој впрочем припаѓа на родот хмељогабер (Ostrya).[1] Од нив, природно е застапен само црниот.

Опис

Листовите се листопадни, наизменични и прости, со назабени рабови и долги од 3 до 10 см. Цветовите излегуваат напролет и имаат облик на виснати реси. Машките и женските се засебни, но растат на истото дрво (еднодомност). Плодот е мало оревче, долг 3–6 мм и сместен во прицветник (плодна лушпа). Прицветникот е малку несиметричен, со триделен или просто овален облик. Несиметричноста му овозможува да се врти додека патува со ветерот и така да стигне подалеку. Обликот на крилцата е пресуден во распознавањето на видовите. Секоја реса има по 10 до 30 семчиња.

Употреба

Габерот има многу тврдо дрво. Сушените талпи од срцевината имаат речиси бела боја, погодна за внатрешно уредување. Ретко се користи за столарија, бидејќи тешко се обработува. Од друга страна, токму поради цврстината, од габрово дрво се прават даски за сечење, рачки за алат, дна за рачни стругови, тркала за кочии, механизми за пијано. Во минатото од ова дрво се правеле запци за запченици во ветерниците. Денес од него се прават и паркети и шаховски фигури.

https://mk.wikipedia.org/wiki/%D0%93%D0%B0%D0%B1%D0%B5%D1%80

Габер was last modified: June 29th, 2020 by Jovan Stosic

Configuring e-Mail Notifications in Nagios Core… 

Now that you have installed the required components to enabled Nagios to send mail notifications, you will need to download two configurations files from your Nagios Server (using FileZilla and edit them using Notepad++ – if you need to understand how to do this, please review part 2 of my installing Nagios for Exchange series).

These files are:

  1. commands.cfg
  2. contacts.cfg

Which are located in:

/usr/local/nagios/etc/objects

Open the commands.cfg file in Notepad++ and modify the following two lines:

# 'notify-host-by-email' command definition
define command{
    command_name    notify-host-by-email
    command_line    /usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n" | /bin/mailx -s "** $NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ is $HOSTSTATE$ **" $CONTACTEMAIL$
    }

# 'notify-service-by-email' command definition
define command{
    command_name    notify-service-by-email
    command_line    /usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional Info:\n\n$SERVICEOUTPUT$\n" | /bin/mailx -s "** $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$
    }

To look like the following:

# 'notify-host-by-email' command definition
define command{
    command_name    notify-host-by-email
    command_line    /usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n" | /usr/bin/mailx -s "** $NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ is $HOSTSTATE$ **" $CONTACTEMAIL$
    }

# 'notify-service-by-email' command definition
define command{
    command_name    notify-service-by-email
    command_line    /usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional Info:\n\n$SERVICEOUTPUT$\n" | /usr/bin/mailx -s "** $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$
    }

In essence you are changing the /bin/mail part of each command to /usr/bin/mailx

When you are done, save the file and then using FileZilla upload it back to your Nagios Server.

Next open the contacts.cfg file and change the “email” property to that of the account where you would like the notifications to be sent – see below

define contact{
        contact_name                    nagiosadmin        ; Short name of user
        use                                generic-contact        ; Inherit default values from generic-contact template (defined above)
        alias                           Nagios Admin        ; Full name of user
        email                           administrator@prepad.com    ; <<***** CHANGE THIS TO YOUR EMAIL ADDRESS ******
        }

When you are done, save the file, and upload it back to your Nagios server.

To finish up the configuration, from a PuTTY session type in the following command:

sudo /etc/init.d/nagios restart

Source: Configuring e-Mail Notifications in Nagios Core… – telnetport25.com

Configuring e-Mail Notifications in Nagios Core…  was last modified: June 28th, 2020 by Jovan Stosic