[Mimedefang] Howto use mimidefang _only_ for replacing attachments with urls?

Steffen Kaiser skmimedefang at smail.inf.fh-bonn-rhein-sieg.de
Wed Mar 14 06:53:21 EST 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Wed, 14 Mar 2007, Tony K Lindstrom wrote:

> mimedefang-filter and add the routine to do what I want. I am not
> familiar with perl so there might be something that I don't understand.

Er, perl is a programming language, you'll need to dig into it or ask 
somebody to write the filter for you.

> sub filter {
> $size = (stat($entity->bodyhandle->path))[7];
  $entity is a unknown variable, you have also remove the part, where it 
got assigned.
Also: prefix $size with "my " to declare the variable as a local one.

> if ($size > 1000000) {
>     return action_replace_with_url($entity,
>          "/var/spool/MIMEDefang_Captured_Files",
>          "http://snailgw.tekla.com/captured_mailfiles",
> 	  ($fname? "\"$fname\"" : "Attachment").
>            " (".humanize($size).") relocated:\n\n_URL_",
>    	 $fname  # extra data to save
>  	 );

Same for $fname, you have remove the assignment.

humanize() is a function, that's missing, too. Reinsert this 
function from the filter you got the hints from.

> 	}
> }
> 1;

- -- 
Steffen Kaiser
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iQEVAwUBRffiM+gJIbZtwg6XAQKjvgf+Lc7kpVoF5mCe+pgp2TDMsvsMr2/FtG8g
TaulrKoELmgxTQNFOoAbqOV7j/9MOY1I+9IO71N2rGdNcsKWNWXB7F6TmFvAQsvv
nERnMGBn5G0ZxxPCKV2ACBfpabvlfjfQVnsKAPHtAzrGdJJCMQ0yPwnwsQBdpTI3
riYcReq1vxPkQYuzv1+PrELJHDDXLLgKd+J0TXegTwKPajYBk4QipiVZNkR1xNr0
EBFlt9JFFsw4qav/QMhockwFGMlq/lW/Id540Qbf5+lo6LXxV6HNhEH8FYC7HFnr
ubgtGm94JrDZxvyAGvPHKR76lgrwHhZ0yr7j8Wy/JHkVn09dTk0ypQ==
=5w23
-----END PGP SIGNATURE-----


More information about the MIMEDefang mailing list