| View previous topic :: View next topic |
| Author |
Message |
harry Contributor


Joined: 01 May 2003 Posts: 61
|
Posted: Thu Mar 25, 2004 4:10 pm Post subject: parse a mail header to remove the subject line |
|
|
Hi folks,
I have been trying to parse a mail header to remove the subject line and
just give the" from name"
however i can't find out what the the seperator is
example of header------
meathome<meatwork@mail.com>just a test
here it shows as a " " on a simple text editor (notepad its a vertical bar)
when I copy the seperator in a @asc() it tells me its a period ( .) or 46
and thats not quite right...
thanks for the input...
harry |
|
| Back to top |
|
 |
vdsalchemist Admin Team

Joined: 23 Oct 2001 Posts: 1448 Location: Florida, USA
|
Posted: Thu Mar 25, 2004 7:21 pm Post subject: |
|
|
Hi Harry,
The character you posted is the ASCII character "7". As in @chr(7)... Strange that an email header would have such a character?
| Code: |
%%Myheader = "meathome<meatwork@mail.com>""just a test"
%%Myheaderlen = @len(%%Myheader)
%%cnt = 1
repeat
%%Char = @SubStr(%%Myheader,%%cnt)
Info %%Char@CR()@asc(%%Char)@CR()
%%cnt = @Succ(%%cnt)
until @Greater(%%cnt,%%Myheaderlen)
|
I hope the above code helps you. _________________ Home of
Give VDS a new purpose!
 |
|
| Back to top |
|
 |
vdsalchemist Admin Team

Joined: 23 Oct 2001 Posts: 1448 Location: Florida, USA
|
Posted: Thu Mar 25, 2004 7:46 pm Post subject: |
|
|
Hi all,
Something is wrong with the VDS code option on the forum... When you download the script above it does not include the script just the header...
Below is a resubmit with the regular PHPBB Code button...
| Code: |
%%Myheader = "meathome<meatwork@mail.com>""just a test"
%%Myheaderlen = @len(%%Myheader)
%%cnt = 1
repeat
%%Char = @SubStr(%%Myheader,%%cnt)
Info %%Char@CR()@asc(%%Char)@CR()
%%cnt = @Succ(%%cnt)
until @Greater(%%cnt,%%Myheaderlen)
|
_________________ Home of
Give VDS a new purpose!
 |
|
| Back to top |
|
 |
harry Contributor


Joined: 01 May 2003 Posts: 61
|
Posted: Thu Mar 25, 2004 10:08 pm Post subject: |
|
|
as i said the seperator is different (each time) if its copied and pasted
on this site or into notepad or even the vds script window....
i agree with you that its strange!!!!!!!!!!!!!!!!!
does anybody know what the seperator really is??
thanks again,
harry |
|
| Back to top |
|
 |
vdsalchemist Admin Team

Joined: 23 Oct 2001 Posts: 1448 Location: Florida, USA
|
Posted: Sat Mar 27, 2004 5:18 pm Post subject: |
|
|
Harry,
Open the header of the email with a Hex editor to see what the value of the character really is. I take it is in a file if your downloading the email with a custom application right? If so there is a Hex editor demo that comes with VDS 5 that you can use to view the header. If you using VDS to capture the header then just iterate through the characters of the header with the code that I posted and it will actually show you the character that is being sent.
I am thinking that it is something specific to either the POP3 or SMTP servers that are in the chain when the email is sent and recieved from point A to B...
If all else fails you can try reading the RFC (ie.. Request for comments)for email. The RFC you want to read is rfc822 and can be found here ftp://ftp.isi.edu/in-notes/rfc822.txt
or
here http://www.worldtalk.com/Standards%20and%20Tech/emailref.shtm _________________ Home of
Give VDS a new purpose!
 |
|
| Back to top |
|
 |
harry Contributor


Joined: 01 May 2003 Posts: 61
|
Posted: Tue Mar 30, 2004 9:43 pm Post subject: |
|
|
Thanks MP
i'll check it out
your code works good!!
harry |
|
| Back to top |
|
 |
|