bernhard: utils/testing test-send-invitation-issue3236.py,NONE,1.1

cvs at kolab.org cvs at kolab.org
Fri Nov 21 20:06:54 CET 2008


Author: bernhard

Update of /kolabrepository/utils/testing
In directory doto:/tmp/cvs-serv9098

Added Files:
	test-send-invitation-issue3236.py 
Log Message:
Added test script for kolab/issue3236.py.


--- NEW FILE: test-send-invitation-issue3236.py ---
#!/usr/bin/env python
"""Send email with iTIP invitation trying to trigger kolab/issue3236

Needs to be send to an account which will automatically accepts
the invitation. The answer will be broken with Kolab Server 2.2.0.

Usage $progname <recipientemailaddress> <fromemailaddress>

This script is Free Software under the GNU General Public License >=v2.
bernhard at intevation.de (initial 20081121)
"""
__version__="$Revision: 1.1 $"

import sys

import datetime
import itertools
import smtplib
import string

msg = """To: %(toaddr)s
From: %(fromaddr)s
Subject: Invitation kolab/issue3236
Date: Fri, 21 Nov 2008 19:25:35 +0100
MIME-Version: 1.0
Content-Type: text/calendar;
  method=request;
  charset="utf-8"
Content-Transfer-Encoding: 7bit

BEGIN:VCALENDAR
PRODID:-//Microsoft Corporation//Outlook 11.0 MIMEDIR//EN
VERSION:2.0
METHOD:REQUEST
BEGIN:VEVENT
ATTENDEE;ROLE=REQ-PARTICIPANT;RSVP=TRUE:MAILTO:%(toaddr)s
ORGANIZER:MAILTO:%(fromaddr)s
DTSTART:20081122T190000Z
DTEND:20081122T193000Z
SEQUENCE:0
UID:040000008200E00074C5B7101A82E0080000000020D533ED0E4CC9010000000000000000100
 00000094C5C0A65E8CC4DB1AEC47FD1255FCD
DTSTAMP:20081121T182534Z
DESCRIPTION:Zeit: Samstag\, 22. November 2008 20:00-20:30 (GMT+01:00)
  Amsterdam\, Berlin\, Bern\, Rom\, Stockholm\,
  Wien.\\n\\n*~*~*~*~*~*~*~*~*~*\\n\\n\\n
SUMMARY:invitationtest2
END:VEVENT
END:VCALENDAR
"""

toaddr = sys.argv[1]
smtpserver='localhost'
# if you set a loginname, a connection via TLS and authentification is tried
loginname = None
password  = None

fromaddr= sys.argv[2]

server=smtplib.SMTP(smtpserver)
#server.set_debuglevel(1)

if loginname != None and password != None:
    server.starttls()
    server.login(loginname,password)

server.sendmail(fromaddr, [toaddr],
      msg % { "toaddr" : toaddr, "fromaddr" : fromaddr })

server.quit()





More information about the commits mailing list