Re: [Mimedefang] move SPOOLDIR to tmpfs - how to keep bayes and qdir files at reboot?

2014-02-21 Thread Kees Theunissen
On Fri, 21 Feb 2014, Steffen Kaiser wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On Thu, 20 Feb 2014, Marcus Schopen wrote:

 I'm planning to move SPOOLDIR (/var/spool/MIMEDefang) to tmps.

 My /etc/fstab
 tmpfs   /var/spool/MIMEDefang  tmpfs
 defaults,size=128m,mode=750,uid=ofdefanguser,gid=ofdefanggroup   0 0

 This works fine, but mimedefang stores quarantinedir and spamassassin
 bayes files in /var/spool/MIMEDefang too. How to handle this.
 Copy /var/spool/MIMEDefang/.spamassassin at stop/start of mimedefang to
 another directory outside tmpfs. And what about quarantinedir files.
 Those fill up the ramdisk. Move them by cronjob?

if you compile MIMEDefang yourself, you can specify another quarantinedir.
IMHO, you can change the location by setting:
$Features{'Path:QUARANTINEDIR'}
anytime. E.g. at the top of your filter or in mimedefang.pl.

I'm running MIMEDefang on a few debian systems. Debian ships a somewhat
modified /usr/bin/mimedefang.pl that 'require's a configuration file
/etc/mail/mimedefang.pl.conf. So I've defined the quarantine dir in that
file with: $Features{'Path:QUARANTINEDIR'} = '/var/spool/MD-Quarantine';

My .spamassassin is not located in MIMEDefang's spool dir. But I use the
demon. You can most likly use a symlink, I mean:
On startup you setup the tmpfs and before starting MIMEDefang, e.g. in its
init.d script, you create the symlink to the permanent spamassassin
location.

SpamAssassin uses the home directory of the user it is running as for
the bookkeeping. So I've made the quarantine dir the home directory of
the defang user:

$ getent passwd defang
defang:x:108:110::/var/spool/MD-Quarantine:/bin/false

Unfortunately the $HOME environment varialble is screwed by the init
script (as shipped by debian, but also by the init sript in the redhat
directory of the original MIMEDefang source). The init script has:
  ...
  SPOOLDIR='/var/spool/MIMEDefang'
  ...
  # These lines keep SpamAssassin happy.  Not needed if you
  # aren't using SpamAssassin.
  HOME=$SPOOLDIR
  export HOME
  ...

The init script sources a configuration file /etc/default/mimedefang
later on. That's the place where I correct the $HOME assignment with:
  ...
  # Redefine the HOME dir.
  # $HOME was set to the spool dir in /etc/init.d/mimedefang, but that
  # dir is a volatile ram disk and we need permanent storage for the
  # spamassassin bayesian scores.
  HOME=/var/spool/MD-Quarantine
  ...

The init script in the redhat directory of the original MIMEDefang
source uses the configuration file /etc/sysconfig/mimedefang but that
file is sourced _before_ the $HOME environment variable is screwed up.
With that init script you need to modify the init script in order to
correct the $HOME assignment.


Regards,

Kees Theunissen.

-- 
Kees Theunissen,  System and network manager,   Tel: +31 (0)30 6096724
Dutch Institute For Fundamental Energy Research (DIFFER)
e-mail address:   c.j.theunis...@differ.nl
postal address:   PO Box 1207, 3430 BE Nieuwegein, NL
visitors address: Edisonbaan 14, 3439 MN Nieuwegein, NL

___
NOTE: If there is a disclaimer or other legal boilerplate in the above
message, it is NULL AND VOID.  You may ignore it.

Visit http://www.mimedefang.org and http://www.roaringpenguin.com
MIMEDefang mailing list MIMEDefang@lists.roaringpenguin.com
http://lists.roaringpenguin.com/mailman/listinfo/mimedefang


Re: [Mimedefang] move SPOOLDIR to tmpfs - how to keep bayes and qdir files at reboot?

2014-02-21 Thread Marcus Schopen
Hi Kees,

I put $Features{'Path:QUARANTINEDIR'} to mimedefang.pl.conf and in my
case (Ubuntu 12.04 LTS) .spamassassin is automatically located
under /var/spool/MD-Quarantine without changing home in passwd or
changing HOME=/var/spool/MD-Quarantine in /etc/init.d/mimedefang. Kind
of strange, but it seems to work. Socket and pid files are still in
the tmpfs under /var/spool/MIMEDefang so I think clamav uses the tmpfs
to write and check Mails because I see this in clamav.log

/var/spool/MIMEDefang/mdefang-s1LIHX6s005741/Work/msg-5718-2.txt:
Eicar-Test-Signature(02e592f7b2929ea31bdd2564a2f19810:75) FOUND

Ciao!

-- 
   I think we dream so we don't have to be apart so long. If we're in each
other's dreams, we can play together all night.   -- Calvin

___
NOTE: If there is a disclaimer or other legal boilerplate in the above
message, it is NULL AND VOID.  You may ignore it.

Visit http://www.mimedefang.org and http://www.roaringpenguin.com
MIMEDefang mailing list MIMEDefang@lists.roaringpenguin.com
http://lists.roaringpenguin.com/mailman/listinfo/mimedefang


[Mimedefang] move SPOOLDIR to tmpfs - how to keep bayes and qdir files at reboot?

2014-02-20 Thread Marcus Schopen
Hi,

I'm planning to move SPOOLDIR (/var/spool/MIMEDefang) to tmps.

My /etc/fstab
tmpfs   /var/spool/MIMEDefang  tmpfs
defaults,size=128m,mode=750,uid=ofdefanguser,gid=ofdefanggroup   0 0

This works fine, but mimedefang stores quarantinedir and spamassassin
bayes files in /var/spool/MIMEDefang too. How to handle this.
Copy /var/spool/MIMEDefang/.spamassassin at stop/start of mimedefang to
another directory outside tmpfs. And what about quarantinedir files.
Those fill up the ramdisk. Move them by cronjob?

Ciao
Marcus


___
NOTE: If there is a disclaimer or other legal boilerplate in the above
message, it is NULL AND VOID.  You may ignore it.

Visit http://www.mimedefang.org and http://www.roaringpenguin.com
MIMEDefang mailing list MIMEDefang@lists.roaringpenguin.com
http://lists.roaringpenguin.com/mailman/listinfo/mimedefang


Re: [Mimedefang] move SPOOLDIR to tmpfs - how to keep bayes and qdir files at reboot?

2014-02-20 Thread Steffen Kaiser

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On Thu, 20 Feb 2014, Marcus Schopen wrote:


I'm planning to move SPOOLDIR (/var/spool/MIMEDefang) to tmps.

My /etc/fstab
tmpfs   /var/spool/MIMEDefang  tmpfs
defaults,size=128m,mode=750,uid=ofdefanguser,gid=ofdefanggroup   0 0

This works fine, but mimedefang stores quarantinedir and spamassassin
bayes files in /var/spool/MIMEDefang too. How to handle this.
Copy /var/spool/MIMEDefang/.spamassassin at stop/start of mimedefang to
another directory outside tmpfs. And what about quarantinedir files.
Those fill up the ramdisk. Move them by cronjob?


if you compile MIMEDefang yourself, you can specify another quarantinedir. 
IMHO, you can change the location by setting: 
$Features{'Path:QUARANTINEDIR'}

anytime. E.g. at the top of your filter or in mimedefang.pl.

My .spamassassin is not located in MIMEDefang's spool dir. But I use the 
demon. You can most likly use a symlink, I mean:
On startup you setup the tmpfs and before starting MIMEDefang, e.g. in its 
init.d script, you create the symlink to the permanent spamassassin 
location.


- -- 
Steffen Kaiser

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (GNU/Linux)

iQEVAwUBUwcDAZSHNCne69JnAQKevwf9HVu44ExXxgcS2yG+x3DJk8xrXDjMjrz+
Q3Zz+L5do7M68T5wCVl8JCQ3HScQJx/hmXtv4O9rZIhUqRJF71nt7iC2n62FYEhn
je6+zjL2ytNS7cjLjxTy3bkFpWDs5espXY2pVvEkPF3w6dX48A+kZ1fS2o5VPkts
vx3uaIBmiJB0IAS4Eia36zPi+xwJLZhktBX7zcQ2JfDEBlUmttqHEC4jOk6PGI/2
8ntld3+5/l2mmglT5lPcMnUJFpkucs9YF+SOqJGbsBFrOXGXRv22zi4PgKp+9i0B
MDFa0hVG7Kvkf+bkzuV0KJE1gNctNNE4opziXpWn3oQ6fjEJgnpBBA==
=Yt9Q
-END PGP SIGNATURE-
___
NOTE: If there is a disclaimer or other legal boilerplate in the above
message, it is NULL AND VOID.  You may ignore it.

Visit http://www.mimedefang.org and http://www.roaringpenguin.com
MIMEDefang mailing list MIMEDefang@lists.roaringpenguin.com
http://lists.roaringpenguin.com/mailman/listinfo/mimedefang