Re: Check for attachment in maildrop recipe

Sam Varshavchik <[email protected]>
Newsgroups gmane.mail.maildrop
Message-ID <[email protected]>
Milan Obuch writes:

> Hi,
>
> I use pythonfiler framework for various tasks in email processing, and
> currently I need to transform use of attachments filter to conditional
> delivery instruction in maildrop recipe. Basically I need something like
>
> if (attachment_name =~ /<some regexp>/)
>  to '<foldername>'
>
> The reason is attachment filter is global per server setting and I need
> to apply this condition on an per mailbox basis.
>
> Has anybody any idea how to accomplish this task? Alternatively, is
> anybody using any python script in maildrop recipe? It should not be

There are several issues here. First, is that the attachment name can be  
formed in a couple of different ways, and different mail clients have  
slightly different rules of what's the name of the attachment. Most will  
look at the "filename" attribute of the Content-Disposition: header. Some  
may also look at Content-Name: first, others will look at Content- 
Description:, and override everything else with what they find in there.

Secondly, maildrop does not really have sufficient knowledge of MIME to be  
able to manipulate those headers easily.

As far as running python goes, maildrop can run an external program using  
the backticks or the "cc" operator, and make the contents of the email  
message available on standard input. There are some important caveats, see  
the maildropfilter man page for more info.

------------------------------------------------------------------------------
How ServiceNow helps IT people transform IT departments:
1. A cloud service to automate IT design, transition and operations
2. Dashboards that offer high-level views of enterprise services
3. A single system of record for all IT processes
http://p.sf.net/sfu/servicenow-d2d-j

_______________________________________________
Courier-maildrop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/courier-maildrop
signature.asc (application/pgp-signature, 198 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.13 (GNU/Linux)

iEYEABECAAYFAlGwb8sACgkQx9p3GYHlUOJ0WgCfSG3HKfHk7NDY7M8wZoKAYVyL
7XoAn1Dwy0gIbb21rlPa4XxFtMy00Mkg
=j48K
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.