Bobcares

Using MailScanner with Exim | How To?

by | Jan 11, 2023

The article explains the steps for using MailScanner with Exim. At Bobcares, with our Server Management Services, we offer solutions to your MailScanner and Exim queries.

Using MailScanner with Exim – How To?

The receiving and sending of messages are divided into two queues by MailScanner. However, on the other hand, Exim doesn’t support separate queues. Exim requires two separate Exim processes for the receiving and sending of messages. Now, we’ll look into the steps to use MailScanner with Exim.

  • Set-up Exim
  • Modify Spool Directory
  • Postpone Incoming Messages
  • Exim Version
  • Executing Exim
  • Set-up MailScanner
Set-up Exim

In this case, we are using the default src/EDITME build time setup for Exim. First, we must copy the active Exim configuration from /etc/exim/exim.conf to /etc/exim/exim_out.conf in order to use the outgoing Exim. This file shouldn’t be edited in any way. We’ll make changes to the default setup by using another spool directory and stopping Exim from delivering messages right away.

Modify Spool Directory

To the beginning of /etc/exim/exim.conf, we need to include the below code to change the spool directory.

Using MailScanner with Exim

With this MailScanner setup, the log lines relating to a message’s receipt and delivery will be in two distinct locations because Exim by default stores its logs in $spool_directory/log/%slog. If the operating system has packaged Exim to put its logs somewhere else, we won’t run into this issue. Put the following in the first section of both /etc/exim/exim.conf and /etc/exim/exim_out.conf to fix the issue:

Using MailScanner with Exim

The exiwhat utility also depends on a process status log that Exim puts in its spool directory. We can change it from Exim-4.21 and greater.

Postpone Incoming Messages

We can easily prevent Exim from delivering the message right away by including the below code in the beginning portion of the configuration file:

However, if we set prod_requires_admin = false, then any user can bypass MailScanner by using Exim parameters like -q and -M.

Exim Version

In order to make all messages deferred when Exim tries to deliver them, add this router immediately after the begin routers line in Exim 4, so that it is the first router:

Using MailScanner with Exim
Executing Exim

We need two separate Exim processes for incoming and outgoing messages. So, we’ve to change the Exim startup script. Find the line /usr/bin/exim -bd -q15m, then replace it with the below codes:

Using MailScanner with Exim

The queue-running Exim will not create a pid file; however, the SMTP listener will by default create its pid file in /var/spool/exim.in/exim-daemon.pid. To get it to do that, modify its command line to:

It is not necessary to clean all the DBs of both the Exim processes. However, a crontab for Exim that cycles the logs and cleans up the hints databases is really helpful.

Also,

Using MailScanner with Exim

Some users run Exim from inetd for incoming SMTP and cron for queue runs. We also don’t need to change inetd.conf, but we do need to modify the queue running the command in the crontab to the below code:

Set-up MailScanner

We can use two MailScanner settings to tell MailScanner to invoke exim. To send freshly prepared mail using MailScanner, utilize the “Sendmail” setting (i.e. warnings). Use a straightforward setup like this one:

We can bypass the warnings using the code:

We might additionally want to instruct Exim to mark messages produced by MailScanner in the log as follows:

The “Sendmail2” setting attempts to deliver a message that is already scanned. It defaults to being the same as the “Sendmail” setting, but we need to tell Exim to use the outgoing configuration:

The locations of the Exim incoming and outgoing spool directories must also be specified for MailScanner. These settings will function in the simplest scenario; however, MailScanner must be explicitly informed of the input subdirectory, which is implied in the Exim setup.

The setup varies lightly if the Exim setup includes a split spool directory:

Using MailScanner with Exim

We’ll be having this option at the end of default MailScanner.conf. Also, before initiating MailScanner for the first time, make sure to create spool directories and subdirectories. We also need to specify the Exim user as:

Using MailScanner with Exim

[Searching solution for a different query? We are just a click away.]

Conclusion

To conclude, we’ve included the steps from our Support team for using MailScanner with Exim in this article.

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

GET STARTED

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

Never again lose customers to poor
server speed! Let us help you.

Privacy Preference Center

Necessary

Necessary cookies help make a website usable by enabling basic functions like page navigation and access to secure areas of the website. The website cannot function properly without these cookies.

PHPSESSID - Preserves user session state across page requests.

gdpr[consent_types] - Used to store user consents.

gdpr[allowed_cookies] - Used to store user allowed cookies.

PHPSESSID, gdpr[consent_types], gdpr[allowed_cookies]
PHPSESSID
WHMCSpKDlPzh2chML

Statistics

Statistic cookies help website owners to understand how visitors interact with websites by collecting and reporting information anonymously.

_ga - Preserves user session state across page requests.

_gat - Used by Google Analytics to throttle request rate

_gid - Registers a unique ID that is used to generate statistical data on how you use the website.

smartlookCookie - Used to collect user device and location information of the site visitors to improve the websites User Experience.

_ga, _gat, _gid
_ga, _gat, _gid
smartlookCookie
_clck, _clsk, CLID, ANONCHK, MR, MUID, SM

Marketing

Marketing cookies are used to track visitors across websites. The intention is to display ads that are relevant and engaging for the individual user and thereby more valuable for publishers and third party advertisers.

IDE - Used by Google DoubleClick to register and report the website user's actions after viewing or clicking one of the advertiser's ads with the purpose of measuring the efficacy of an ad and to present targeted ads to the user.

test_cookie - Used to check if the user's browser supports cookies.

1P_JAR - Google cookie. These cookies are used to collect website statistics and track conversion rates.

NID - Registers a unique ID that identifies a returning user's device. The ID is used for serving ads that are most relevant to the user.

DV - Google ad personalisation

_reb2bgeo - The visitor's geographical location

_reb2bloaded - Whether or not the script loaded for the visitor

_reb2bref - The referring URL for the visit

_reb2bsessionID - The visitor's RB2B session ID

_reb2buid - The visitor's RB2B user ID

IDE, test_cookie, 1P_JAR, NID, DV, NID
IDE, test_cookie
1P_JAR, NID, DV
NID
hblid
_reb2bgeo, _reb2bloaded, _reb2bref, _reb2bsessionID, _reb2buid

Security

These are essential site cookies, used by the google reCAPTCHA. These cookies use an unique identifier to verify if a visitor is human or a bot.

SID, APISID, HSID, NID, PREF
SID, APISID, HSID, NID, PREF