spamassassin temp folders

13 replies [Last post]
apurdam
apurdam's picture
Offline
Joined: Thu Apr 19th, 2007
Posts:
spamassassin temp folders

I use Command antivirus as my built-in a/v program.
It had mysteriously stopped updating itself for two weeks and so let in two phishbank e-mails last night.
(Why I continue with this a/v software, I do not know).
These were picked up by my regular a/v (eTrust), which found (and deleted!) them in my temp folder whilst spamassassin was analysing the message. This concerns me, as it may skewer mailtraq.

Now, I am not going to exclude my temp file from regular a/v monitoring, so is there a way to configure spamassassin so that it can do its analysis in a quiet place somewhere (say, in its own folder)?

apurdam
apurdam's picture
Offline
Joined: Thu Apr 19th, 2007
Posts:
Re: spamassassin temp folders

Everything above still happens, btw.

Is there a configuration of spamassassin to use a temp folder in the mailtraq folder (which has monitoring turned off) ?
This raises an important question. Is mailtraq testing for spam before testing for virulence?
Are we able to do things the other way round? Or does that negate some of the efficacy of the spam filtering?

Also, I'd strongly urge mailtraq to withdraw its recommendation of Command antivirus, as each signature update is like installing a new version of the program (complete with obligatory reboot). How server-non-friendly can you get?

Clipboard01.gif Clipboard02.gif newsgroup.png m3rules_graph.png trm.png
AttachmentSize
LOG_10.TXT 3.99 MB
LOG_09.TXT 5.6 MB
imap movistar.txt 2.26 KB
imap movistar.txt 2.26 KB
imap.txt 48.03 KB
mark_olszewski.txt 1.39 MB
configuration_Server01.zip 67.21 KB
configuration_Server02.zip 58.59 KB
apurdam
apurdam's picture
Offline
Joined: Thu Apr 19th, 2007
Posts:
Re: spamassassin temp folders

apurdam wrote:
These were picked up by my regular a/v (eTrust), which found (and deleted!) them in my temp folder whilst spamassassin was analysing the message. This concerns me, as it may skewer mailtraq.

Can someone confirm whether mailtraq does the antivirus test before or after the antispam test?
It may also be that Command Antivirus is not picking up phishbank e-mails. (sigh)

apurdam
apurdam's picture
Offline
Joined: Thu Apr 19th, 2007
Posts:
Re: spamassassin temp folders

Just wanting to bump this question up, since I'm still in need of this info.

I just need to know the flow of mail messages if I'm using POP3 to retrieve from an ISP (POP3 A/V is turned OFF),
and have Bayesian turned on,
and have SAWin32 set up with spamd server address of C:\Program Files\Mailtraq\SpamAssassinForMailtraq\spamd.exe
and have Command Antivirus ticked and Operational.

Is it RETRIEVE -> SA -> Bayesian -> A/V?

The thing is, I'm still occasionally getting virus files (normally phishing emails) picked up by my normal interactive a/v (Computer Associates) whilst SA is doing its thing.
I'm not sure what this does to the flow of mail through MTQ. Nothing has hung yet.

Just want to get the order right before asking the sourceforge forum about how to set SA's temp folder to something other than \windows\temp (which I really want to keep monitoring for viruses, as it is the most likely place to get a virus turning up).
I assume they're using TEMP or TMP environment variables. Which might mean there's a way MTQ could tell it to use somewhere else?
That's assuming MTQ is piping the message to it - or is MTQ creating an MBOX file and asking spamd to scan it?

Elric Pedder
Offline
Joined: Tue Nov 23rd, 2004
Posts:
Re: spamassassin temp folders

apurdam wrote:
Just wanting to bump this question up, since I'm still in need of this info.
I'm sorry about that as I simply didn't see your earlier post until now.

The sequence is Retrieve -> DBL -> EAP -> Bayesian -> SpamAssassin -> A/V

I hope this helps. I wouldn't be surprised if the SpamAssassin temp directory is being monitored. I would guess, since Mailtraq launches SA, that it is using the system temporary directory which is specified in the System properties of the control panel.

apurdam
apurdam's picture
Offline
Joined: Thu Apr 19th, 2007
Posts:
Re: spamassassin temp folders

Interesting, Bayesian before spamassassin, but that explains some curious spam/ham decisions I had seen.
Indeed, sa uses either the TMP or TEMP variable.
Only I can't really change that. I just want SA to have a different TMP (or TEMP), which would be somewhere in the mailtraq folder heirarchy so that it wouldn't be monitored.
There is no way I'm turning off monitoring of C:\WINDOWS\TEMP !!

I'll ask the SAWin32 crowd if there is a setting.
I guess I could always make my own version (sigh).
Otherwise I'd need MTQ to launch SA with a new environment variable.

On the small chance that there is an undocumented command line switch for launching spamd, is there a way for MTQ to pass that? (Say, if it's in the spamd path line?)

Elric Pedder
Offline
Joined: Tue Nov 23rd, 2004
Posts:
Re: spamassassin temp folders

apurdam wrote:
IOn the small chance that there is an undocumented command line switch for launching spamd, is there a way for MTQ to pass that? (Say, if it's in the spamd path line?)
If you find one and would like to see Mailtraq adjusted to support it, just ask. While we can't guarantee it, we do try to support user requests where practical.

apurdam
apurdam's picture
Offline
Joined: Thu Apr 19th, 2007
Posts:
Re: spamassassin temp folders

Elric, I've been giving this further thought, and wonder whether it wouldn't be better for MTQ to check the file for viruses first.
Thus change the pre-processing order from Retrieve -> DBL -> EAP -> Bayesian -> SpamAssassin -> A/V to
Retrieve -> A/V -> DBL -> EAP -> Bayesian -> SpamAssassin

(what's EAP, btw?)

Alternately, if I can get SpamAssassin to unload to a different TMP folder (one that I'm happy to turn off real-time A/V for) the I can avoid the potential of files getting deleted beneath SA's feet. There is no run-time setting like -T or such.

From what I could read of SAWin's source, it uses File::Spec->tmpdir for creating/using temporary folders and files.
tmpdir uses $ENV{TMPDIR}, $ENV{TEMP} or $ENV{TMP} in that order.
It seems that TMPDIR is not set on my system (it may be on others, I s'pose). So could MTQ set the TMPDIR environment variable to MTQ's temporary folder (I'm sure you must have one, and hopefully it is in the c:\program files\mailtraq tree somewhere, and I have a/v turned off for that area) before spawning the SA job?
I'm not sure what would happen if I set this variable system-wide, as other software may use it, it would be best if MTQ did it only for SA.

Do either of those solutions sound sensible/feasible/worthwhile? I figure it would fix a potential problem for all systems that have a/v monitoring on windows\temp.

Elric Pedder
Offline
Joined: Tue Nov 23rd, 2004
Posts:
Re: spamassassin temp folders

apurdam wrote:
Elric, I've been giving this further thought, and wonder whether it wouldn't be better for MTQ to check the file for viruses first.
Thus change the pre-processing order from Retrieve -> DBL -> EAP -> Bayesian -> SpamAssassin -> A/V to
Retrieve -> A/V -> DBL -> EAP -> Bayesian -> SpamAssassin
I don't think I understand why re-ordering the process would help.

apurdam wrote:
(what's EAP, btw?)
Executable Attachment Policy. It is configured in the Incoming Mail... | Options

apurdam wrote:
Alternately, if I can get SpamAssassin to unload to a different TMP folder (one that I'm happy to turn off real-time A/V for) the I can avoid the potential of files getting deleted beneath SA's feet. There is no run-time setting like -T or such.

From what I could read of SAWin's source, it uses File::Spec->tmpdir for creating/using temporary folders and files.
tmpdir uses $ENV{TMPDIR}, $ENV{TEMP} or $ENV{TMP} in that order.
It seems that TMPDIR is not set on my system (it may be on others, I s'pose). So could MTQ set the TMPDIR environment variable to MTQ's temporary folder (I'm sure you must have one, and hopefully it is in the c:\program files\mailtraq tree somewhere, and I have a/v turned off for that area) before spawning the SA job?
I'm not sure what would happen if I set this variable system-wide, as other software may use it, it would be best if MTQ did it only for SA.

Do either of those solutions sound sensible/feasible/worthwhile? I figure it would fix a potential problem for all systems that have a/v monitoring on windows\temp.


You should be able to set TMPDIR in the Environment Variables by going to System in your Control Panel. Is that possible?

apurdam
apurdam's picture
Offline
Joined: Thu Apr 19th, 2007
Posts:
Re: spamassassin temp folders

Elric Pedder wrote:
apurdam wrote:
Elric, I've been giving this further thought, and wonder whether it wouldn't be better for MTQ to check the file for viruses first.
Thus change the pre-processing order from Retrieve -> DBL -> EAP -> Bayesian -> SpamAssassin -> A/V to
Retrieve -> A/V -> DBL -> EAP -> Bayesian -> SpamAssassin
I don't think I understand why re-ordering the process would help.

So that the A/V check would be done in a controlled space (I presume MTQ unpacks the file somewhere within the MTQ folder tree which has a/v turned off) and caught before my system-wide a/v finds it in the less controlled spamassassin setting.

Quote:

You should be able to set TMPDIR in the Environment Variables by going to System in your Control Panel. Is that possible?

Yes, possible. Just not sure of side effects. I don't know what other software which is on my system would use the TMPDIR environment variable if I set it. 'cos then they'd be using the mailtraq folder that I would set up for sa.
I guess I can suck it and see.

Elric Pedder
Offline
Joined: Tue Nov 23rd, 2004
Posts:
Re: spamassassin temp folders

apurdam wrote:
Elric Pedder wrote:
apurdam wrote:
Elric, I've been giving this further thought, and wonder whether it wouldn't be better for MTQ to check the file for viruses first.
Thus change the pre-processing order from Retrieve -> DBL -> EAP -> Bayesian -> SpamAssassin -> A/V to
Retrieve -> A/V -> DBL -> EAP -> Bayesian -> SpamAssassin
I don't think I understand why re-ordering the process would help.

So that the A/V check would be done in a controlled space (I presume MTQ unpacks the file somewhere within the MTQ folder tree which has a/v turned off) and caught before my system-wide a/v finds it in the less controlled spamassassin setting.

I see what you mean. The A/V could be moved between EAP and Bayesian, but no further up the chain than that. However, Mailtraq does unpack the files in the system temporary directory too so I'm surprised that isn't leading to problems.

apurdam wrote:
Quote:

You should be able to set TMPDIR in the Environment Variables by going to System in your Control Panel. Is that possible?

Yes, possible. Just not sure of side effects. I don't know what other software which is on my system would use the TMPDIR environment variable if I set it. 'cos then they'd be using the mailtraq folder that I would set up for sa.
I guess I can suck it and see.

I don't think TMPDIR is used very widely, so it would depend on how many systems you are using. I've been looking at controlling the environment variable as you suggested and it should be viable.

What we need is a specific temporary directory for Mailtraq, within its directory structure, that it is responsible for cleaning too. But if you do try the TMPDIR change please let me know if it helps.

apurdam
apurdam's picture
Offline
Joined: Thu Apr 19th, 2007
Posts:
Re: spamassassin temp folders

Elric Pedder wrote:
I see what you mean. The A/V could be moved between EAP and Bayesian, but no further up the chain than that. However, Mailtraq does unpack the files in the system temporary directory too so I'm surprised that isn't leading to problems.

Hmm. Interesting. I wonder if that's what I'm seeing? I'll have to wait and see if the problem occurs again.
Maybe ClamAV is quicker with new phishing scams (which are the type which were being caught) than Computer Associates (Vet A/V is the interactive system virus monitor I'm using at the moment).

Quote:
I don't think TMPDIR is used very widely, so it would depend on how many systems you are using. I've been looking at controlling the environment variable as you suggested and it should be viable.

What we need is a specific temporary directory for Mailtraq, within its directory structure, that it is responsible for cleaning too. But if you do try the TMPDIR change please let me know if it helps.


Or a temporary directory tree, if you need that sort of thing for multi-threading?

apurdam
apurdam's picture
Offline
Joined: Thu Apr 19th, 2007
Posts:
Re: spamassassin temp folders

Elric Pedder wrote:
However, Mailtraq does unpack the files in the system temporary directory too so I'm surprised that isn't leading to problems.

Well, here's what was in my log just after noon today:

28/04/08 12:13 PM SpamAssassin: "Hot pictures" from miles.davie@spamsource.dk "Derick Koch" (spam=no, score=5.90/7.00, symbols=DCC_CHECK;RDNS_NONE;SPAMMY_XMAILER)
28/04/08 12:13 PM [POP3] (1524) AntiVirus: POP3 message (Hot pictures) from (miles.davie@spamsource.dk) to (oneofmylot) contains (saver.zip: (Trojan.Downloader-33127 FOUND))
28/04/08 12:13 PM Sending template virus_notify~ to ,oneofmylot@mydomain.com.au
...

It's weird. After all these months, I'm finally seeing the built-in AntiVirus working as it should! I like it.

apurdam
apurdam's picture
Offline
Joined: Thu Apr 19th, 2007
Posts:
Re: spamassassin temp folders

Elric Pedder wrote:
I don't think TMPDIR is used very widely, so it would depend on how many systems you are using. I've been looking at controlling the environment variable as you suggested and it should be viable.
Well, I got another phishing e-mail caught by the interactive a/v over the weekend. First time in three months. It patiently waited there until I got in to work and didn't seem to bother MTQ.
sa doesn't seem to complain about the deleted file, in fact, it seemed to correctly decide that the message was spam.
00000008 0000025B 18/07/2008 23:39:40 RETR 1    --->  +OK 5365 octets
00000800 00000000 18/07/2008 23:39:56 SpamAssassin: "*****SPAM***** Capital One Bank Customer Service: Important Message. -Fri, 18 Jul 2008 16:38:51 +0200" from <a href="mailto:support@capitalone.com">support@capitalone.com</a> "Capital One bank" <support@capitalone.com> (spam=yes, score=19.20/6.30, symbols=HTML_FONT_LOW_CONTRAST;HTML_MESSAGE;MIME_HTML_ONLY;MIME_HTML_ONLY_MULTI;MPART_ALT_DIFF;RCVD_IN_PSBL;RDNS_NONE;SPF_SOFTFAIL;SPOOF_COM2COM;SPOOF_COM2OTH;URIBL_BLACK;URIBL_JP_SURBL;URIBL_PH_SURBL;URIBL_SC_SURBL;URIBL_WS_SURBL)
00000800 00000000 18/07/2008 23:39:56 Anti-Spam Receipt: SpamAssassin From (<a href="mailto:support@capitalone.com">support@capitalone.com</a> "Capital One bank" <support@capitalone.com>) To (hallvs) Subject (*****SPAM***** Capital One Bank Customer Service: Important Message. -Fri, 18 Jul 2008 16:38:51 +0200) Score (19.2/6.3) Symbols (HTML_FONT_LOW_CONTRAST,HTML_MESSAGE,MIME_HTML_ONLY,MIME_HTML_ONLY_MULTI,MPART_ALT_DIFF,RCVD_IN_PSBL,RDNS_NONE,SPF_SOFTFAIL,SPOOF_COM2COM,SPOOF_COM2OTH,URIBL_BLACK,URIBL_JP_SURBL,URIBL_PH_SURBL,URIBL_SC_SURBL,URIBL_WS_SURBL)
00000008 0000025B 18/07/2008 23:39:56 DELE 1    --->  +OK
00000008 0000025B 18/07/2008 23:39:56 QUIT    --->  +OK <a href="mailto:hallvs@ourbigspammedemailaddress.com">hallvs@ourbigspammedemailaddress.com</a> POP3 server signing off.
- 0000025B
00000080 00000000 18/07/2008 23:40:02 Routing (Inbound) HLLV84FFBDAA (0 locked, 0 queued)
00000080 00000000 18/07/2008 23:40:02 Router: (Depth 0) HLLV84FFBDAC from <a href="mailto:support@capitalone.com">support@capitalone.com</a> for andrew
00000800 00000000 18/07/2008 23:40:02 Anti-Spam: Mailslot andrew, Score 0.99, Message HLLV84FFBDAC ("*****SPAM***** Capital One Bank Customer Service: Important Message. -Fri, 18 Jul 2008 16:38:51 +0200" from <a href="mailto:support@capitalone.com">support@capitalone.com</a>)

So SA seems pretty robust w.r.t. having its own files deleted, but I still don't like it, so I've created a
TMPDIR system wide environment variable pointing to C:\Program Files\Mailtraq\TMP.
We'll see what happens, but if this is only going to occur every three months, I'm not going to spend much more time on it.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Syndicate content