procmail
[Top] [All Lists]

Re: message size into subject?

2008-03-03 01:43:42
Hi Richard,

Am 2008-02-28 13:50:41, schrieb Richard KLINDA:
So my question: is it possible to put a size indicator into the subject
of the message?  I would like to put a "." for every 10 KiB, like:

"Subject: Foo bar baz"

Becomes

"Subject: ....Foo bar baz" if it is more than 40 KiB (and under 50).

Any hints would be appreciated, thanks. :)

You can do something like

----8<------------------------------------------------------
SIZE=`wc --bytes`

:0
* ? test ${SIZE} -gt 40960
* ? test ${SIZE} -lt 51200
{
  SUBJECT=`formail -czx Subject`
  
  :0fw
  |formail -f -I "Subject: [${SIZE}Bytes] ${SUBJECT}"
}
----8<------------------------------------------------------

Thanks, Greetings and nice Day
    Michelle Konzack
    Systemadministrator
    Tamay Dogan Network
    Debian GNU/Linux Consultant


-- 
Linux-User #280138 with the Linux Counter, http://counter.li.org/
##################### Debian GNU/Linux Consultant #####################
Michelle Konzack   Apt. 917                  ICQ #328449886
+49/177/9351947    50, rue de Soultz         MSN LinuxMichi
+33/6/61925193     67100 Strasbourg/France   IRC #Debian (irc.icq.com)

____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>