[exim] Required... A snippit of code...

Top Page
Delete this message
Reply to this message
Author: . kibble .
Date:  
To: exim-users
Subject: [exim] Required... A snippit of code...

Has anyone got a snippet of C code I can whack into my local_scan function
that will split a variable containing an email ( char emailaddress[] ) into
the local_part and domain section and put them into their own variables
please? (char local_part[] & char domain[] ).

I made one using strtok like this:

typedef struct email_struct {
    char            localpart[256];
    char            domain[256];
} _email_struct;


_email_struct * getlocalp_domain(char * emailaddr, _email_struct *
lpart_domain) {

    memset(lpart_domain->localpart, 0x0, 256);
    memset(lpart_domain->domain, 0x0, 256);
    sprintf(lpart_domain->localpart, "%s", strtok(emailaddr, "@"));
    sprintf(lpart_domain->domain, "%s", strtok(NULL, "@"));


    return(lpart_domain);
} /** getlocalp_domain */


And it returns the error in the [exim_mainlog]:
Format error in spool file 1CfPxP-0003SJ-4l-H: size=513

When ever I try to send an email…If someone has a fresh piece of code I can
look at [not try and fix mine for now] I’ll be most grateful....

Many thanks in advance…

_________________________________________________________________
Want to block unwanted pop-ups? Download the free MSN Toolbar now!
http://toolbar.msn.co.uk/