~mmlmtp/mailman/mm3lmtp

« back to all changes in this revision

Viewing changes to mailman/queue/lmtp.py

  • Committer: William Mead
  • Date: 2008-07-16 14:52:05 UTC
  • Revision ID: wam22@quant.staff.uscs.susx.ac.uk-20080716145205-ywu1bag2u7zo3oj6
rev6: Fixed Doctest

Show diffs side-by-side

added added

removed removed

Lines of Context:
127
127
            self.push(EERR_554+'. Syntax: lhlo hostname')
128
128
            return
129
129
        if self._SMTPChannel__greeting:
130
 
            self.push('503 Duplicate LHLO')
 
130
            self.push(EERR_551+'. Duplicate LHLO')
131
131
        else:
132
132
            self._SMTPChannel__greeting = arg
133
133
            self.push('250 %s' % self._SMTPChannel__fqdn)
162
162
        except:
163
163
            return 'Unknown Error'
164
164
    
165
 
    # rcpttocheck checks if list is a known list. 
166
 
    # Uses code defined in LMTPRunner.process_message  
 
165
    # rcpttocheck checks if list is a known list.
167
166
    def rcpttocheck(self, to):
168
167
        try:
169
168
            listnames = Channel.lists(self)
185
184
        member = mlist.members.get_member(unicode(mailfrom))
186
185
        if member:
187
186
                return
188
 
        elif matches_p(mailfrom, mlist.accept_these_nonmembers):   
 
187
        elif matches_p(mailfrom, mlist.accept_these_nonmembers): 
189
188
            return
190
189
        else:
191
190
            return 'EERR_572'
 
191
            
192
192
 
193
193
    def smtp_RCPT(self, arg):
194
194
        if not self._SMTPChannel__mailfrom:
217
217
        if subaddress in SUBADDRESS_NAMES:
218
218
            if self.listmembercheck(self._SMTPChannel__mailfrom, listname) == 'EERR_572':
219
219
                if subaddress == 'leave' or subaddress == 'unsubscribe': 
220
 
                    self.push(EERR_572+'. The subaddresses -leave and -subscribe can not be used by unknown senders')
 
220
                    self.push(EERR_572+', the subaddresses -leave and -unsubscribe can not be used by unauthorised senders')
221
221
                    return
222
222
        self._SMTPChannel__rcpttos.append(address)
223
223
        self.push('250 Ok') 
224
 
          
 
224
 
225
225
 
226
226
class LMTPRunner(Runner, smtpd.SMTPServer):
227
227
    # Only __init__ is called on startup. Asyncore is responsible for later