Definition at line 379 of file smtpd.py.
def process_message |
( |
|
self, |
|
|
|
peer, |
|
|
|
mailfrom, |
|
|
|
rcpttos, |
|
|
|
data |
|
) |
| |
Definition at line 380 of file smtpd.py.
References PureProxy._deliver(), dospath.join(), and dospath.split().
382 from cStringIO
import StringIO
383 from Mailman
import Utils
384 from Mailman
import Message
385 from Mailman
import MailList
391 local = rcpt.lower().
split(
'@')[0]
399 parts = local.split(
'-')
407 if not Utils.list_exists(listname)
or command
not in (
408 '',
'admin',
'owner',
'request',
'join',
'leave'):
410 listnames.append((rcpt, listname, command))
414 for rcpt, listname, command
in listnames:
417 print >> DEBUGSTREAM,
'forwarding recips:',
' '.
join(rcpttos)
419 refused = self.
_deliver(mailfrom, rcpttos, data)
421 print >> DEBUGSTREAM,
'we got refusals'
425 msg = Message.Message(s)
429 if not msg.getheader(
'from'):
430 msg[
'From'] = mailfrom
431 if not msg.getheader(
'date'):
432 msg[
'Date'] = time.ctime(time.time())
433 for rcpt, listname, command
in listnames:
434 print >> DEBUGSTREAM,
'sending message to', rcpt
435 mlist = mlists.get(listname)
437 mlist = MailList.MailList(listname, lock=0)
438 mlists[listname] = mlist
442 msg.Enqueue(mlist, tolist=1)
443 elif command ==
'admin':
444 msg.Enqueue(mlist, toadmin=1)
445 elif command ==
'owner':
446 msg.Enqueue(mlist, toowner=1)
447 elif command ==
'request':
448 msg.Enqueue(mlist, torequest=1)
449 elif command
in (
'join',
'leave'):
451 if command ==
'join':
452 msg[
'Subject'] =
'subscribe'
454 msg[
'Subject'] =
'unsubscribe'
455 msg.Enqueue(mlist, torequest=1)
The documentation for this class was generated from the following file: