def METHOD_NAME(request):
    try:
        length = int(request.META.get('CONTENT_LENGTH'))
    except ValueError:
        length = 0
    max_length = settings.DATA_UPLOAD_MAX_MEMORY_SIZE
    if length > max_length:
        log.info(f'Inbound email over content length: {length}')
        raise RequestTooLargeException(
            f'Request content length exceeds {max_length}.'
        )