- github
- John Simpson's simscan page (patch and a lot of info)
- README
- Old combined patch used (Sep 13, 2023)
- Version: simscan-1.4.4
- Old 1.4.0 repo: http://sourceforge.net/projects/simscan/files/
Simscan is a simple program that enables the qmail smtpd service to reject viruses, spam, and block attachments during the SMTP conversation so the processing load on the email system is kept to a minimum.
Version 1.4.4 details
As you can see, for convenience I moved the simscan
sources to my github
space. Nonetheless, all information about simscan
will continue to be posted here, and this page remains the place to seek support if needed.
Version 1.4.4 is a fork of the 1.4.1 version, which updates the original simscan
by Inter7.
In 1.4.1 version the sources have been polished and modernized a bit and contain a number of bug fixes and patches, including almost all the patches by jms (the only missing one is the "debug" patch which we will apply below) and the bug fix by Gustavo Castro that I had in my previous bundle of patches. Therefore the new 1.4.2 version simply adds the following:
- the jms "debug" patch, to improve the debugging of simscan on
qmail-smtpd
log; - a bug fix by Bob Greco where a received message with multiple 'local' recipients executes
spamc
as null user and not as the user extracted from the first local recipient. - my attachments-size-limit feature which allows you to overcome a limitation where
simscan
doesn't pass messages over 250k tospamassassin
. This feature let the administrator set the attachments' size limit in bytes by setting thesize_limit
variable in the /var/qmail/control/simcontrol file. Furthermore, events wheresimscan
is not activated are now logged atsmtpd
level (it was logged only when debug is active).
ripMIME
- Info: https://pldaniels.com/ripmime/
- Download latest version from github: https://github.com/inflex/ripMIME
ripMIME
's primary purpose is to extract attachments out of a MIME encoded email packages. It is used by simscan
. It is a recommended package.
RIPMIME_VER=1.4.1.0 cd /usr/local/src wget https://github.com/inflex/ripMIME/archive/refs/tags/${RIPMIME_VER}.tar.gz tar xzf ${RIPMIME_VER}.tar.gz cd ripMIME-${RIPMIME_VER} chown -R root:root . make make install
Testing
- man
ripmime
for more info
Pick up an email file "message.eml" with an attachment.
mkdir tmp ripmime --debug --disable-qmail-bounce -i message.eml -d tmp > ripmime.log
The extracted attachments should be inside the tmp
folder.
# ls -l tmp/ total 2352 -rw------- 1 root root 2396801 Aug 2 16:10 attached_file.jpeg -rw-r--r-- 1 root root 0 Aug 2 16:10 textfile0 -rw-r--r-- 1 root root 4 Aug 2 16:10 textfile1 -rw-r--r-- 1 root root 25 Aug 2 16:10 textfile2
As you can see, ripMIME
extracted a file attached_file.jpeg
which is not group readable. This is not a problem for us, because we are going to run simscan
as the clamav
user, but if you are planning to run it as simscan
and then including clamav
in the simscan
group, you should patch ripMIME
with this patch, otherwise clamav
will not be allowed to read the attachments.
Installing simscan
Note that we have to explicitly tell the compiler where the clamav
db is (--enable-clamavdb-path
).
SIMSCAN_VER=1.4.4 cd /usr/local/src wget https://github.com/sagredo-dev/simscan/archive/refs/tags/v${SIMSCAN_VER}.tar.gz tar xzf simscan-${SIMSCAN_VER}.tar.gz cd simscan-${SIMSCAN_VER} chown -R root:root . ./configure \ --enable-user=clamav \ --enable-clamav=y \ --enable-spam=y \ --enable-spam-passthru=y \ --enable-spam-hits=9.5 \ --enable-per-domain=y \ --enable-ripmime \ --enable-attach=y \ --enable-custom-smtp-reject=y \ --enable-spamc-user=y \ --enable-received=y \ --enable-clamavdb-path=/usr/local/share/clamav make make install-strip
Take a look to the README file for an explanation of all the configuration options. Concerning spam, I want to reject via smtp the spam with a score greater than 9.5 and pass to the user the spam below this score.
--enable-per-domain=y|n
Turn on per domain based checking.--enable-spam=y|n
Turn on spam scanning. default no.--enable-spam-passthru=y|n
Pass spam email thru or reject. Default: disable (reject)--enable-spam-hits=number
Reject spam above this hit level. Default 10.0--enable-custom-smtp-reject=y
Turns custom smtp reject messages on and off. When enabled simscan will place the virus name in the reject message if a virus is detected. Requires the qmail-queue-custom-error.patch. Enabling dropmsg disables this option (more info here).--enable-spamc-user=y
Mandatory option if you want to allow the spamassassin user preferences via SQL.--enable-received=y
Add a Received: line to the message, showing the scanners that were used and some stats (you have to patch simscan)
Now create the temporary dir and assign it proper permissions:
mkdir /var/qmail/simscan chown clamav:clamav /var/qmail/simscan
qmail-queue-custom-error
patch
As you know the qmail-queue-custom-error
patch (more info here) that we applyed before enables simscan
to return the appropriate message for each e-mail it refuses to deliver.
Please refer to this page to understand how the smtp
rejection works with simscan
. This guide shortly remainds that:
For virus rejection, the message contains the name of the virus such as :
Your email was rejected because it contains the Worm.Bagle.AU virus
For spam rejection, the message is more generic, merely stating that the message was rejected because it was considered spam:
Your email is considered spam (53.5 spam-hits)
For attachment rejection, the message contains the name of the attachment :
Your email was rejected because it contains a bad attachment: trojan.exe
How to setup simscan
to manage the spamming as better as possible
Let's assume that spamassassin
is configured with a spam level of 5.0, so that hits above this score are labeled as spam.
Of course, soon or later, spamassassin
will label as junk an important email for a customer of yours, and we will never want to reject such a message. On the other hand there will be a score level, say 9.5, above which we can absolutely trust in spamassassin
response and let simscan
reject those emails without storing them in the user's mailbox.
Therefore we will configure simscan/spamassassin in order to:
- Reject the emails with a score > 9.5
- Pass through the emails with a score between 5.0 and 9.5
- Consider ham all the other emails with a score < 5.0
To accomplish this create a simcontrol
like the following:
cat > /var/qmail/control/simcontrol << __EOF__ :clam=yes,spam=yes,spam_hits=9.5,attach=.vbs:.lnk:.scr:.wsh:.hta:.pif,size_limit=10000000 __EOF__
In addition, due to the size_limit=10000000
setting, attachments with size greater than 10000000 bytes (around 10MB) won't be passed to spamassassin
(default is 250KB).
Remember to update simcontrol.cdb every time you modify simcontrol
# update simcontrol.cdb /var/qmail/bin/simscanmk
Turning on scanning
echo ':allow,CHKUSER_WRONGRCPTLIMIT="3",QMAILQUEUE="/var/qmail/bin/simscan"' >> ~vpopmail/etc/tcp.smtp qmailctl cdb
Now simscan/chkuser
will close the smtp communication after 3 wrong recipient. You may want to add an instruction like CHKUSER_RCPTLIMIT="50"
to limit to the number of recipient per SMTP
connection. To be honest, these are settings for chkuser
(not simscan
).
Understanding the simcontrol file
You can setup rules for a specific user, a specific domain and a default rule as follows:
cat > /var/qmail/control/simcontrol << __EOF__ postmaster@example.com:clam=yes,spam=no,attach=.txt:.com example.com:clam=no,spam=yes,attach=.mp3 :clam=yes,spam=yes,spam_hits=9.5,attach=.vbs:.lnk:.scr:.wsh:.hta:.pif,size_limit=10000000 __EOF__
- The first line sets clam on and spam off for postmaster@example.com and checks for viruses inside attached file .txt and .com names.
- The second line sets clam off and spam on for the example.com domain and disallows .mp3 files for the attachment scanner.
- The third line sets the default for the whole machine to enable clam, spam scanning, and sets the reject level for spam hits to 9.5. It also sets the attachments size limit to be passed to
spamassassin
to around 10MB.
Configuring simscan
with the DKIM
patch
If you want to enable DKIM
you have to modify the simscan
configuration accordingly as explained in the DKIM page.
Updating simscan
The patch applied will add a line like this to the header:
Received: by simscan 1.4.0 ppid: 5613, pid: 5684, t: 0.7355s scanners: attach: 1.4.0 clamav: 0.98.4/m:55/d:19599 spam: 3.4.0
You have to update the simscan
's database if you want to get the current versions of clamav
and spamassassin
:
# /var/qmail/bin/simscanmk -g simscan versions cdb file built. /var/qmail/control/simversions.cdb
Since the update has to be done each time you refresh the virus database, you have to adjust you freshclam
configutation as follows.
First of all let's download and install the program that will do the update:
wget --no-check-certificate https://qmail.jms1.net/simscan/update-simscan.c gcc -s -o /usr/local/sbin/update-simscan update-simscan.c chown root:clamav /usr/local/sbin/update-simscan chmod 4110 /usr/local/sbin/update-simscan
Now modify the freshclam configuration file in order to run the update-simscan
executable each time the database is changed. You have to edit the file /usr/local/etc/freshclam.conf and modify it in this way:
OnUpdateExecuteOnUpdateExecute /usr/local/sbin/update-simscan
/var/qmail/simscan on a ramdisk
On his simscan
's information page, John Simpson suggests to mount the work directory of simscan
on a ramdisk, in order to speed up the process of file load from the disk.
It is sufficient to mount that directory in this way in your /etc/fstab:
CLAMAV_UID=`id -u clamav` CLAMAV_GID=`id -g clamav` echo "none /var/qmail/simscan tmpfs nodev,noexec,noatime,uid=$CLAMAV_UID,gid=$CLAMAV_GID,mode=2750 0 0" >> /etc/fstab
Be aware that you have to adjust the uid
and gid
to the actual clamav
user and group numbers respectively.
Comments
skipped message, greater than max message size (512000 bytes)
Shah Imran July 13, 2024 08:47 CET
Hi,
Thanks for keeping qmail alive. simscan-1.4.3 still does not scan file greather than 512000 bytes. I've followed whole procedure that you've described. /var/qmail/control/simsizelimit set to 10000000 as per your suggestion ( echo 10000000 > /var/qmail/control/simsizelimit ).
journalctl -b -f command shows "skipped message, greater than max message size (512000 bytes)"
Is there anything I'm missing.
OS: Debian bookworm
Thanks
BR.
Reply | Permalink
skipped message, greater than max message size (512000 bytes)
Roberto Puzzanghera Shah Imran July 13, 2024 09:25 CET
Hi,
I'm not sure that this log message is from simscan. Can you show the entire qmail-smtpd log line? In addition, what qmail are you using? Do you have any other patch that is filtering the msg size?
Reply | Permalink
skipped message, greater than max message size (512000 bytes)
Shah Imran Roberto Puzzanghera July 13, 2024 10:16 CET
Hi,
Thanks for reply. The message generated by spamc. Below is the whole message:
My qmail is running as per your instruction from A to Z no otehr patch are applied. there is no such log on /var/log/qmail/smtpd/current or /var/log/spamassassin/spamd.log
I'm getting this log while I run following command:
Thanks
BR
Reply | Permalink
skipped message, greater than max message size (512000 bytes)
Roberto Puzzanghera Shah Imran July 13, 2024 12:21 CET
I'll check it out tomorrow. Anyway, if you are following my instructions, simscan will log in qmail-smtpd log when the size limit is exceeded
Reply | Permalink
skipped message, greater than max message size (512000 bytes)
Shah Imran Roberto Puzzanghera July 14, 2024 06:28 CET
Hi,
Thanks for reply. My server is running according to your instructions. All spam messages are sent to querentine insted of bounce back. I'm getting below type of logs on smtpd of simscan:
BR.
Reply | Permalink
skipped message, greater than max message size (512000 bytes)
Roberto Puzzanghera Shah Imran July 14, 2024 09:44 CET
None of the above log lines by simscan show a size limit skip. This is the exact log line that you'll have in case of a size limit exceeded by simscan, with no need to enable simscan's debug:
After a quick google search, I found out that the error message "skipped message, greater than max message size" is triggered by spamassassin itself (not simscan) when the variable
SA_MAX_MAIL_SIZE
is set. Can you doReply | Permalink
skipped message, greater than max message size (512000 bytes)
Roberto Puzzanghera Roberto Puzzanghera July 14, 2024 09:59 CET
man spamc says
Reply | Permalink
typo [
ondrej svoboda February 11, 2024 19:57 CET
Reply | Permalink
typo [
Roberto Puzzanghera ondrej svoboda February 11, 2024 20:05 CET
Thank you. Corrected
Reply | Permalink
missing $ sign in the last command
ondrej svoboda February 11, 2024 19:56 CET
Reply | Permalink
Qmail-scanner
William Silverstein January 22, 2024 15:59 CET
I'd like to use simscan, but I like qmail-scanner's built in perlscan to quickly dump emails. I also like the reports. Any suggestions?
Reply | Permalink
Qmail-scanner
Roberto Puzzanghera William Silverstein January 22, 2024 16:04 CET
Hi, I dropped qmail-scanner ages ago and I'm not familiar with it anymore, sorry
Reply | Permalink
simscan scanning order
miki October 6, 2022 09:46 CET
Hi,
i would like to ask you for help if you see it sensible, scanning order is first spamc then clamd, but i manage it to reorder, so clamd scan message first /lighter on resources, than its pass to spamc . I manage to just move block od code above spam definition in simscan.c .
however, i would like to use this logic - if clamd detect virus, stop processing, return code, close it. because its not nececesary go for spamc check, its already detected by clamd as virus /with 3rd party db , even spams are detected by clamd/ , but its above my coding skills.
this i done/manage somehow years ago, but its lost in server migration somewhere ;)
main reason is to have it lighter on resources
thnx a lot
Reply | Permalink
simscan scanning order
Roberto Puzzanghera miki October 6, 2022 16:26 CET
Hi, I had a quick look. It's not a task to be accomplished with a few touches to the code. So it would be very time expensive...
Reply | Permalink
simscan scanning order
miki Roberto Puzzanghera October 11, 2022 22:48 CET
thank you Roberto for effort, I understand ,no problem.
thnx a lot
miki
Reply | Permalink
simscan scanning order
Roberto Puzzanghera miki October 6, 2022 10:17 CET
I'll have a look. Thanks for the comment
Reply | Permalink
Error: 451_mail_server_temporarily_rejected_mess
Pablo Murillo October 16, 2020 17:14 CET
Hi
I started noticing the increase of this error
Making a little research that the error appear when clamav can access some file attached to emails
Not a permission problem, is a "name" problem
For example:
Obviously the file name have special chars, but this can't be a problem
Could be something related with ripmime that's involved in the process ?
Reply | Permalink
Error: 451_mail_server_temporarily_rejected_mess
Roberto Puzzanghera Pablo Murillo October 16, 2020 17:19 CET
did you try to debug ripmime in this way?
Reply | Permalink
SimScan Vs Qmail Scanner
Kenny Lee September 28, 2020 07:29 CET
Hi Mr Robert,
i tried to install qmail scanner to replace Sim Scan, but i got 451 qq temporary problem (#4.3.0) while try to send a mail... is it the system designed flow here not compatible to work with qmail scanner?
thank you
Reply | Permalink
SimScan Vs Qmail Scanner
Roberto Puzzanghera Kenny Lee September 28, 2020 07:54 CET
Hi, yes it is compatible with qmail scanner, I used it before switchimg to simscan
Reply | Permalink
SimScan Vs Qmail Scanner
Kenny Lee Roberto Puzzanghera September 29, 2020 05:49 CET
Hi Mr Roberto,
after qmail scanner installation, i tried to run the "test_installation.sh" to test qmail scanner and the testing was successful... but when i tried to put it to tcp.smtp .. it pop out "451 qq temporary problem (#4.3.0)", i tried to find out what is the issue in qmail-queue.log file, but no error messages inside there. i also checked send and smtp log files, also no error messages.
below is the telnet result:
thank you
Reply | Permalink
SimScan Vs Qmail Scanner
Roberto Puzzanghera Kenny Lee September 29, 2020 12:07 CET
Unfortunately I'm not familiar with qmailscanner, as I switched to simscan about 10 years ago
PS be sure that your softlimit is high enough
Reply | Permalink
ripmime
Gabriel Torres May 25, 2020 00:35 CET
I tried to compile ripmime, but it kept giving an error. Since I use Debian, it has this package available:
Reply | Permalink
Link to qmailwiki in your page.
Pierluigi May 11, 2020 14:57 CET
Hi,
I would like to inform you that qmailwiki.org seems to be not working anymore.
Being that lot of links ( in simscan at least ) point to that site, it becomes hard to follow instruction.
FYI.
Pierluigi
Reply | Permalink
Link to qmailwiki in your page.
Roberto Puzzanghera Pierluigi May 11, 2020 15:48 CET
Thank you. I linked the README file in place of the old qmailwiki
Reply | Permalink
Disabling simscan for outgoing emails
Gabriel Torres June 24, 2019 17:21 CET
Hello,
Is there a way to disable simscan for outgoing emails? Because we send weekly newsletters with thousands of subscribers, and since simscan scans outgoing emails as well, the server load goes through the roof when we are sending these newsletters.
Any thoughts?
Cheers,
Gabriel.
Reply | Permalink
Disabling simscan for outgoing emails
Roberto Puzzanghera Gabriel Torres June 24, 2019 19:40 CET
I don't have simscan enabled for outgoing emails. It is sufficient that you don't export QMAILQUEUE="/var/qmail/bin/simscan" for outgoing emails, nor DKIMQUEUE=/var/qmail/bin/simscan if you are signing by means of qmail-smtpd
Reply | Permalink
Permissions for simscan
Gabriel Torres June 19, 2019 18:14 CET
Make sure to create the simscan temp folder with the correct permissions, otherwise it won't work, giving the infamous "mail server temporarily rejected message (#4.3.0)"
mkdir /var/qmail/simscan
chown clamav:clamav /var/qmail/simscan
Also, make sure to follow all clamav installation steps before installing simscan.
Reply | Permalink
Permissions for simscan
Roberto Puzzanghera Gabriel Torres June 19, 2019 20:03 CET
thank you for all your corrections. Anyway following the order of this guide, simscan is supposed to be installed after clamav
Reply | Permalink
simscan+spamc not working when running under qmail, but works when testing,
Pierluigi April 22, 2019 18:10 CET
Hi,
I'm trying to get the whole simscan/clamav/spamassassin stuff but I have this problem:
when I receive a mail from the net, the spamc report always clean ( from log )
If I test it with the command ( I've saved the mail with the SIMSCAN_DEBUG_FILES=2):
it works perfectly.
Do you have any idea where to search for the problem ?
Thanks
Reply | Permalink
simscan+spamc not working when running under qmail, but works when testing,
Roberto Puzzanghera Pierluigi April 22, 2019 18:40 CET
Do you have your spamassassin behind a firewall? A thing like this happened to me once, when I forgot to add the public IP to the spamd options...
what the spamd/spamc log say?
Reply | Permalink
simscan+spamc not working when running under qmail, but works when testing,
Pierluigi Roberto Puzzanghera April 23, 2019 09:20 CET
Roberto,
no, the spamd/spamc are on the same machine.
It seems I have fixed the problem by increasing softlimit memory in the "run" script for qmail-smtpd.
It's rather strange as at first, with a lower limit I could see errors in logs, and increased a bit.
The error ( spamc: error while loading shared libraries: libcrypto.so.1.1: failed to map segment from shared object ) went away but stil it behaves as described.
I've then, just for test, increased the softlimit again ( although no errors were shown in logs ) and everything started to work as expected.
Thanks, and thank for your website/blog. Very informative !!!!
Reply | Permalink
simscan+spamc not working when running under qmail, but works when testing,
Joao Pierluigi July 25, 2023 19:49 CET
Hi Roberto,
I have the same error in smtp log.
Do you know how to fix it?
Thanks!
Joao
Reply | Permalink
simscan+spamc not working when running under qmail, but works when testing,
Roberto Puzzanghera Joao July 25, 2023 19:54 CET
Do you have spamassassin and clamav working and running?
Reply | Permalink
simscan+spamc not working when running under qmail, but works when testing,
Joao Roberto Puzzanghera July 25, 2023 22:12 CET
Hi Roberto,
I found an error in my /service/qmail-smtpd/run.
The problem was fixed.
Thanks
Joao
Reply | Permalink
simscan+spamc not working when running under qmail, but works when testing,
Roberto Puzzanghera Joao July 25, 2023 22:20 CET
It would be interesting for those facing the same issue to know what you have found exactly...
Reply | Permalink
simscan+spamc not working when running under qmail, but works when testing,
Joao Roberto Puzzanghera July 25, 2023 23:41 CET
Hi Roberto,
I don't now exacly what fixed this problem, because I've tried a lot of things like recompile simscam, clamav and netqmail (with your patch) and try to copy /usr/lib64/libcrypto.so* to /usr/local/lib64/.
I'll reinstall step by step in a fresh machine. If I had the same error, I'll back here with the solution.
Thank you very much
Joao
Reply | Permalink
simscan+spamc not working when running under qmail, but works when testing,
Joao Joao July 26, 2023 16:50 CET
Hi Roberto,
I've found what I did to fix the problem.
My file /service/qmail-smtpd/run had this line:
I've changed to:
Thanks
Joao
Reply | Permalink
SMTP reject
nic February 20, 2019 01:44 CET
Hi,
I had an email with a .mpp attachment got rejected with the bounce error
No matter what file name i change to the mpp file, i keep getting the same error (Your email was rejected because it contains a bad attachment: r). But the file name is not "r" at all.
This is my simcontrol
Any idea?
Thanks
Reply | Permalink
SMTP reject
Roberto Puzzanghera nic February 26, 2019 17:28 CET
This bug was fixed in the latest patch (tx Pablo Murillo)
Reply | Permalink
SMTP reject
Pablo Murillo nic February 21, 2019 22:03 CET
I get the previous patch from: http://gcastrop.blogspot.com/2011/02/problemas-con-adjuntos-en-simscan-con.html
I'm using it and works !!!
Reply | Permalink
SMTP reject
Roberto Puzzanghera Pablo Murillo February 22, 2019 14:00 CET
Thank you. I'll check it out
Reply | Permalink
SMTP reject
Pablo Murillo nic February 21, 2019 21:56 CET
I found a patch about that error some time ago
Is a problem on simscan and the way it check extension
Reply | Permalink
SMTP reject
Roberto Puzzanghera nic February 20, 2019 20:11 CET
unfortunately no ideas
Reply | Permalink
Updated qmail-queue-custom-error.patch to work with netqmail-1.06
Pablo Murillo December 7, 2018 20:20 CET
Hi
I updated the patch qmail-queue-custom-error.patch to work with netqmail-1.06
Reply | Permalink
Access denied on textfile2
Pablo Murillo December 4, 2018 02:23 CET
Hi
I´m using FreeBSD 11.2
I installed simscan from ports, don't worked, so, I installed then simscan "manually" with the patch and with this options:
I have:
Every time I test the smtp sending and email with or without attachment I get the next error on clamd.log
Access denied: /var/qmail/simscan/???????/textfile2
The directory's content is:
The problem is obvius, there is a missing permission on textfile2
I created a new jail, I installed all by hand, the same problem
I changed permission on /var/qmail/bin/simscan to:
The same problem
I added on qmail-smtpd/run for debug purpose :
Any idea ?
Thanks in advance
Pablo Murillo
Reply | Permalink
Access denied on textfile2
Roberto Puzzanghera Pablo Murillo August 3, 2020 14:00 CET
everyone who decided to run simscan as the "simscan" user should add "clamav" user to the "simscan" group and then patch ripmime in order to make the extracted attachment group-readable, as now is also explained at the top of this page
Reply | Permalink
Access denied on textfile2
Roberto Puzzanghera Pablo Murillo December 4, 2018 18:27 CET
I would try to recompile it with --enable-user=clamav so that clamd has write permissions in the simscan directory...
Reply | Permalink
Access denied on textfile2
Pablo Murillo Roberto Puzzanghera December 4, 2018 21:35 CET
Changing the user solved the problem, but I think there is something wrong with ripmime, because, only the attached files to email are with the wrong permission
Thanks
Reply | Permalink
SPAM DROPPED (7.00/7.00):1.1858s:*****SPAM*****
Al March 27, 2017 02:23 CET
Hello,
I have a problem with simscan with rejecting SPAM with less than 9.5 hits:
In /var/qmail/control/simcontrol I have:
In /etc/mail/spamassassin/local.cf I put:
Do you know what could be wrong.
Thank you a lot.
Regards
Reply | Permalink
did you update simcontrol.cdb
roberto puzzanghera Al March 27, 2017 14:03 CET
did you update simcontrol.cdb?
Reply | Permalink
Roberto,
Al roberto puzzanghera March 28, 2017 15:05 CET
Roberto,
I forgot to do that. Problem is solved now.
Thank you,
Regards,
Al
Reply | Permalink
On simscan 1.4.1
Bob Greco December 9, 2016 11:02 CET
Hi Roberto,
Yes you are right simscan 1.4.1 is essentially the same as 1.4.0 from functionality POfView
However it has some minor improvements:
Additionally to further suppress all comp warnings one should:
As far as the abnormal behaviour of simscan with spamc is concerned I think the relevant simscan.c block of code is:
MaxRcptTo always takes value 1 except when email has many recepients @ Cc or To Fields. In such a case MaxRcptTo counts the recepients
and has a positive value. So if we change the if condition
to
we get a more normal behavior.
I think it would be wise to ask the developers/mainteners of the current simscan ver for a more formal and/or consistent amendment.
Ciao
Bob
Reply | Permalink
Some thoughts...
Bob Greco Bob Greco December 12, 2016 13:32 CET
Dear Rob
I think before anything else we should somehow unravel the logic of the simscan developer (or at least give it a shot, since he/she is unreachable).
The presence of MaxRcptTo var in simscan.c indicates the fact that at smtpd level one expects, in general, more than one recipients.
This fact has two realisations according to the way various MTAs connect to our smtpd.
Some MTAs open only one tcp conn per email msg (sendmail?), others open one tcp conn per recipient (qmail).
See: http://grokbase.com/t/perl/qpsmtpd/055bt3byjj/opinion-regarding-multiple-recipients-per-connection
So counting recipients in the 'forward smtp buffer' via MaxRcptTo shows us that the developer is aware of all these.
So why then imposes a condition with MaxRcptTo == 1 as if he/she expects only one connection per recipient?
One possible explanation is that he/she wants a somehow "pure" user pref policy ie
one recipient -- one local user (RcptTo[0]) -- reliable bayes entries in the SQL backend
many recipients -- ? -- no entries
(Actually, we might get entries for clamd user!
So eventually our SQL db gets polluted.
Is this simply a real bug?)
So if someone (like me) is willing to impose more flexible policies on his users (eg global blacklists per domain etc) he can patch the condition to MaxRcptTo > 0.
I've tested the code and the MaxRcptTo > 0 seems a pretty harmless change that meets my needs without spoiling the simscan functionality.
Ciao
Bob
Reply | Permalink
It's a bug!
Bob Greco Bob Greco December 13, 2016 22:37 CET
Dear Roberto
After all this is a bug!
It had been pointed out previously by Sossi Andrej (you might know him...)
See: http://simscan.inter7.narkive.com/OQQ5ulG8/simscan-not-send-rcpt-address-to-spamassassin
So feel free to add it to some of your patches for our convenience...
Thanks
Bob
Reply | Permalink
Patch updated, thank you
roberto puzzanghera Bob Greco December 14, 2016 17:36 CET
Patch updated, thank you
Reply | Permalink
Your patch is working here.
roberto puzzanghera Bob Greco December 10, 2016 13:49 CET
Your patch is working here.
Unfortunately I coudn't find any contact of the author of the current 1.4.1 version
Reply | Permalink
did you test your patch
roberto puzzanghera Bob Greco December 9, 2016 14:48 CET
did you test your patch already?
Anyway, it's not clear to me why this happens only with gmail/hotmail...
Reply | Permalink
simscan 1.4.1
Bob Greco December 9, 2016 00:26 CET
Roberto hi,
FYI there is a newer simscan 'bumdle' 1.4.1 @ https://github.com/qmail/simscan
However, I've noticed a strange simscan behavior (for both vers). When I send emails from @gmail/hotmail with multiple 'local' recepients [To, Cc] to my new qmail-simscan server the spamc scan is executed as null user!!! [SIMSCAN_DEBUG=4](The normal behaviour accordind to README is to extract the first local recepient.)
Any ideas?
Bob
Reply | Permalink
simscan 1.4.1
Roberto Puzzanghera Bob Greco August 4, 2020 09:12 CET
I had a better look to the 1.4.1 fork and noticed that actually it contains many bug fixes and most of the patches I am used to apply. A lot of garbage was cleaned as well so I decided to do the switch...
Reply | Permalink
Hi Bob,
roberto puzzanghera Bob Greco December 9, 2016 09:55 CET
Hi Bob,
I have the same strange behaviour when receiving from gmail with CC. Test from other senders made simscan call spamc twice (one for the To address and another for the CC address). At the moment I have no idea... Let me know if youe manage to solve or find a patch.
According to the changelog, the new simscan seems not to add anything important, I'll wait for further development.
Reply | Permalink
Option necessary for centos distributions
Sergi October 5, 2016 15:19 CET
Hi, for centos distribution in my case i have to put this option in the configure "--enable-spamc=/usr/bin/spamc".
I hope to be useful
Thanks a lot Roberto for this great manual.
Reply | Permalink
changing of spam hit
nic March 8, 2016 20:12 CET
Hi,
I have been using --enable-spam-hits=9.5 and i would like to lower to 8.0. I had recompile simscan with --enable-spam-hits=8.0, make and make install-strip , still it did not change.
Did i missed out anything?
thanks, nic
Reply | Permalink
I think modifing and
roberto puzzanghera nic March 8, 2016 20:56 CET
I think modifing and recompiling simcontrol should work
Reply | Permalink
Thanks Roberto.
nic roberto puzzanghera March 8, 2016 21:09 CET
Thanks Roberto.
I missed out the simcontol.
Reply | Permalink
Simscan update (for gcc 4.1 and up)
Wlad January 10, 2016 20:39 CET
It will not compile unless you add the following to the function in "simscanmk.c" where ever it is referenced:
so it looks like:
so in this case on line 429, I added "0644" - add it where ever it there's a "open_missing_mode"
Hope it helps someone.
Reply | Permalink
Thanks for your contribution,
roberto puzzanghera Wlad January 10, 2016 20:50 CET
Thanks for your contribution, Wlad
Reply | Permalink
I wish there was an
Wlad January 10, 2016 20:18 CET
I wish there was an alternative to simscan 1.4.0 - compiling it requires an older version of gcc - which in this case prevents this from building without proper arguments (for security purposes).
Reply | Permalink
which gcc version?
roberto puzzanghera Wlad January 10, 2016 20:48 CET
which gcc version? I can compile up to gcc-4.8.2 here
Reply | Permalink
bounce email
Terry Antonio April 30, 2015 01:52 CET
Rather then reply to an email stating why the message was blocked can it just be dropped with no reply as spammers will send a fake repy to address and someone will be inundated with these messages.
Reply | Permalink
there are several options
roberto puzzanghera Terry Antonio May 1, 2015 08:43 CET
there are several options, depending on the delivery program you use. Look at this for details http://www.gossamer-threads.com/lists/qmail/users/133589
I use CHKUSER_WRONGRCPTLIMIT in conjunction with a fail2ban rule
Reply | Permalink
blocking attachment
abdou September 30, 2014 12:17 CET
hello everyone , I have a question related to simscan, may I block all kind of attachment in the mail ? I need just this functionnality, is that possible ?
Reply | Permalink