This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author marcus@internetnowasp.net
Recipients marcus@internetnowasp.net
Date 2008-09-08.04:59:54
SpamBayes Score 0.0039987224
Marked as misclassified No
Message-id <1220849998.55.0.777734204126.issue3802@psf.upfronthosting.co.za>
In-reply-to
Content
The __getaddr does not handle certain valid MAIL FROM well :

For eg,

<marcus@internetnow.com.my> SIZE=7777 AUTH=<>

would result in a mismatch of bracket handling.


Suggested fix is :-

def __getaddr(self, keyword, arg):
        address = None
        keylen = len(keyword)
        if arg[:keylen].upper() == keyword:
            address = arg[keylen:].strip()
            if not address:
                pass
            
            # Marcus fix :
            i  = address.count("<")
            ii = address.count(">")            
            if i != ii :
                address = None
                return address
            
            # Marcus remark : bug if : <abc@ap.com.my> SIZE=6092 AUTH=<>
            elif address[0] == '<' and address[-1] == '>' and address !
= '<>':
                # Addresses can be in the form <person@dom.com> but 
watch out
                # for null address, e.g. <>
                                
                if address.count("<") == 1 :
                    address = address[1:-1]
                    
        return address
History
Date User Action Args
2008-09-08 04:59:59marcus@internetnowasp.netsetrecipients: + marcus@internetnowasp.net
2008-09-08 04:59:58marcus@internetnowasp.netsetmessageid: <1220849998.55.0.777734204126.issue3802@psf.upfronthosting.co.za>
2008-09-08 04:59:56marcus@internetnowasp.netlinkissue3802 messages
2008-09-08 04:59:54marcus@internetnowasp.netcreate