5 messages in net.sourceforge.lists.courier-maildropRe: [maildropl] Re: Detecting no subj...
FromSent OnAttachments
matt...@mediadriver.comMar 8, 2004 1:11 pm 
Brook HumphreyMar 8, 2004 1:59 pm 
Sam VarshavchikMar 8, 2004 3:54 pm 
Jeremy KitchenMar 8, 2004 4:07 pm 
Devin RubiaMar 9, 2004 8:31 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Re: [maildropl] Re: Detecting no subject fieldActions...
From:Devin Rubia (dev@thezone.net)
Date:Mar 9, 2004 8:31:40 am
List:net.sourceforge.lists.courier-maildrop

On Mon, Mar 08, 2004 at 05:50:41PM -0600, Jeremy Kitchen wrote:

On Mon, 2004-03-08 at 17:38, Sam Varshavchik wrote:

In the never ending struggle to combat bad client implementations, I am trying to write a script to detect a lack of a Subject: field in the header.

I've tried, without success:

SUB=`reformail -x 'Subject:'`

if($SUB == 0) { xfilter "reformail -a'Subject: (no subject)'" }

Any suggestions?

if (! /^Subject:/)

does that work only in headers though? I could fool it into ignoring that by sending an HTML mail with: <!-- Subject: blah! --!>

$ man maildropfilter # [1] [SNIP] PATTERN OPTIONS Following /pattern/, there may be an optional colon, fol- lowed by one. or more options. The following options may be specified in any order:

h Match this pattern against the message header.

b Match this pattern against the message body. [SNIP] If neither 'h' or 'b' is specified, the pattern is matched against the header only. Specifying the 'b' option causes the pattern to be matched against the message body. Specify- ing both causes the pattern to be matched against the entire message. [SNIP]

So the default is header only but you could use:

if (! /^Subject:/:h)

if you wanted to be paranoid.

[1] This is getting to be a habit.