Skip to content

Commit 790e80f

Browse files
author
Richard Jones
committed
*** empty log message ***
1 parent 0846f05 commit 790e80f

File tree

4 files changed

+41
-18
lines changed

4 files changed

+41
-18
lines changed

doc/index.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ Detlef Lannert,
9898
Andrey Lebedev,
9999
Henrik Levkowetz,
100100
Gordon McMillan,
101+
John F Meinel Jr,
101102
Patrick Ohly,
102103
Luke Opperman,
103104
Will Partain,

doc/installation.txt

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Installing Roundup
33
==================
44

5-
:Version: $Revision: 1.72 $
5+
:Version: $Revision: 1.73 $
66

77
.. contents::
88

@@ -418,6 +418,25 @@ submission user's POP account name, password and server.
418418

419419
On windows, you would set up the command using the windows scheduler.
420420

421+
As a regular job using an IMAP source
422+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
423+
424+
To retrieve from an IMAP mailbox, use a *cron* entry similar to the
425+
POP one::
426+
427+
0,10,20,30,40,50 * * * * /usr/local/bin/roundup-mailgw /opt/roundup/trackers/support imap <imap_spec>
428+
429+
where imap_spec is "``username:password@server``" that specifies the roundup
430+
submission user's IMAP account name, password and server. You may
431+
optionally include a mailbox to use other than the default ``INBOX`` with
432+
"``imap username:password@server mailbox``".
433+
434+
If you have a secure (ie. HTTPS) IMAP server then you may use ``imaps``
435+
in place of ``imap`` in the command to use a secure connection.
436+
437+
As with the POP job, on windows, you would set up the command using the
438+
windows scheduler.
439+
421440

422441
UNIX Environment Steps
423442
----------------------

roundup/mailgw.py

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ class node. Any parts of other types are each stored in separate files
7474
an exception, the original message is bounced back to the sender with the
7575
explanatory message given in the exception.
7676
77-
$Id: mailgw.py,v 1.147 2004-04-13 04:11:06 richard Exp $
77+
$Id: mailgw.py,v 1.148 2004-04-13 04:16:36 richard Exp $
7878
"""
7979
__docformat__ = 'restructuredtext'
8080

@@ -407,26 +407,24 @@ def do_imap(self, server, user='', password='', mailbox='', ssl=False):
407407

408408
try:
409409
if not mailbox:
410-
#print 'Using INBOX'
411410
(typ, data) = server.select()
412411
else:
413-
#print 'Using mailbox' , mailbox
414412
(typ, data) = server.select(mailbox=mailbox)
415413
if typ != 'OK':
416-
print 'Failed to get mailbox "%s": %s' % (mailbox, data)
414+
print 'Failed to get mailbox "%s": %s'%(mailbox, data)
417415
return 1
418416
try:
419417
numMessages = int(data[0])
420-
#print 'Found %s messages' % numMessages
421-
except ValueError:
422-
print 'Invalid return value from mailbox'
418+
except ValueError, value:
419+
print 'Invalid message count from mailbox %r'%data[0]
423420
return 1
424421
for i in range(1, numMessages+1):
425-
#print 'Processing message ', i
426422
(typ, data) = server.fetch(str(i), '(RFC822)')
427-
#This marks the message as deleted.
423+
424+
# mark the message as deleted.
428425
server.store(str(i), '+FLAGS', r'(\Deleted)')
429-
#This is the raw text of the message
426+
427+
# process the message
430428
s = cStringIO.StringIO(data[0][1])
431429
s.seek(0)
432430
self.handle_Message(Message(s))

roundup/scripts/roundup_mailgw.py

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
1515
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
1616
#
17-
# $Id: roundup_mailgw.py,v 1.13 2004-04-13 04:11:06 richard Exp $
17+
# $Id: roundup_mailgw.py,v 1.14 2004-04-13 04:14:03 richard Exp $
1818

1919
"""Command-line script stub that calls the roundup.mailgw.
2020
"""
@@ -39,10 +39,11 @@ def usage(args, message=None):
3939
-v: print version and exit
4040
-C / -S: see below
4141
42-
The roundup mail gateway may be called in one of three ways:
42+
The roundup mail gateway may be called in one of four ways:
4343
. with an instance home as the only argument,
4444
. with both an instance home and a mail spool file, or
45-
. with both an instance home and a pop server account.
45+
. with both an instance home and a POP/APOP server account.
46+
. with both an instance home and a IMAP/IMAPS server account.
4647
4748
It also supports optional -C and -S arguments that allows you to set a
4849
fields for a class created by the roundup-mailgw. The default class if
@@ -81,9 +82,11 @@ def usage(args, message=None):
8182
apop username:password@server
8283
8384
IMAP:
84-
Connect to an IMAP server. This supports the same notation as that of POP mail.
85+
Connect to an IMAP server. This supports the same notation as that of
86+
POP mail.
8587
imap username:password@server
86-
It also allows you to specify a specific mailbox other than INBOX using this format:
88+
It also allows you to specify a specific mailbox other than INBOX using
89+
this format:
8790
imap username:password@server mailbox
8891
8992
IMAPS:
@@ -100,7 +103,8 @@ def main(argv):
100103
# take the argv array and parse it leaving the non-option
101104
# arguments in the args array.
102105
try:
103-
optionsList, args = getopt.getopt(argv[1:], 'vC:S:', ['set=', 'class='])
106+
optionsList, args = getopt.getopt(argv[1:], 'vC:S:', ['set=',
107+
'class='])
104108
except getopt.GetoptError:
105109
# print help information and exit:
106110
usage(argv)
@@ -167,7 +171,8 @@ def main(argv):
167171
return handler.do_imap(m.group('server'), m.group('user'),
168172
m.group('pass'), mailbox, ssl)
169173

170-
return usage(argv, _('Error: The source must be either "mailbox", "pop" or "apop"'))
174+
return usage(argv, _('Error: The source must be either "mailbox",'
175+
' "pop", "apop", "imap" or "imaps"'))
171176
finally:
172177
db.close()
173178

0 commit comments

Comments
 (0)