procmail
[Top] [All Lists]

RE: Space at start of name

2001-03-13 09:10:24

Hi,
Thanks to Michael and Timothy for solving my last problem about
detecting the senders actual name but I still have a small problem with
it. I get the name alright but when I store it in my database, there is
an extra space at the start of the name. Can anyone explain this and
maybe give a way of stopping it. Thanks for your help. This is what I
have in my .rc file:

REALNAME=`formail -xFrom: |\
      tr -s ' ' '\012' |fgrep -v '@' | tr -s '\012' ' '`


And the same happens for my subject:

SUBJECT=`formail -xSubject:`


does this work for the Subject?

:0
* ^Subject:[    ]\/.*
{ SUBJECT=$MATCH }

(the [ ] has a space and then a tab)

That's a more efficient way (*if* it works) I think....




Not sure how to solve the REALNAME problem.... the first solution that came to
me would be to throw

| sed 's/^ //'

at the end of that

REALNAME=`formail -xFrom: |\
        tr -s ' ' '\012' |fgrep -v '@' | tr -s '\012' ' ' | sed 's/^ //'`


but that's *ANOTHER* process, and I tend to be weary of so many pipes when
running something that will be executed for *every* message.

(An inefficient recipe that only runs once a week is one thing... one that runs
every few seconds is another).

I am sure there is a better way to skin that cat...

TjL


_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

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