- Timestamp:
- 02/19/04 15:20:21 (21 years ago)
- Location:
- pykota/trunk
- Files:
-
- 5 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/conf/pykota.conf.sample
r1345 r1353 33 33 34 34 # Quota Storage Server hostname (and optional port) 35 # e.g. db. mydomain.com:543235 # e.g. db.example.com:5432 36 36 storageserver: localhost 37 37 … … 136 136 # If the value is not set then localhost is used. 137 137 smtpserver: localhost 138 139 # Email domain 140 # If the value is not set, and the mail attribute for the user 141 # is not set in the PyKota storage, be it LDAP (see usermail directive 142 # above) or PostgreSQL, then email messages are sent to 143 # username@smtpserver 144 # 145 # If the value is set, then email messages are sent to 146 # username@maildomain using the SMTP server defined above 147 # 148 # Set the appropriate value below, example.com set as per RFC2606. 149 maildomain: example.com 138 150 139 151 # Should we force usernames to be all lowercase when printing ? … … 304 316 # In the lines below "%(printer)s" is automatically replaced 305 317 # at run time with your printer's Fully Qualified Domain Name 306 # e.g. myprinter. domain.com318 # e.g. myprinter.example.com 307 319 # 308 320 # Only snmp(community, oid) and external(command) are supported -
pykota/trunk/NEWS
r1351 r1353 22 22 PyKota NEWS : 23 23 24 - 1.18alpha6 : 25 26 - New configuration directive added : maildomain 27 to specify the domain to send mail to when user 28 email address is not set in PyKota database. 29 30 - More complete email message headers. 31 24 32 - 1.18alpha5 : 25 33 -
pykota/trunk/pykota/config.py
r1257 r1353 22 22 # 23 23 # $Log$ 24 # Revision 1.43 2004/02/19 14:20:21 jalet 25 # maildomain pykota.conf directive added. 26 # Small improvements on mail headers quality. 27 # 24 28 # Revision 1.42 2004/01/08 14:10:32 jalet 25 29 # Copyright year changed. … … 371 375 return "localhost" 372 376 377 def getMailDomain(self) : 378 """Returns the mail domain to use to send messages to users.""" 379 try : 380 return self.getGlobalOption("maildomain") 381 except PyKotaConfigError : 382 return 383 373 384 def getAdminMail(self, printername) : 374 385 """Returns the Email address of the Print Quota Administrator.""" -
pykota/trunk/pykota/tool.py
r1290 r1353 22 22 # 23 23 # $Log$ 24 # Revision 1.73 2004/02/19 14:20:21 jalet 25 # maildomain pykota.conf directive added. 26 # Small improvements on mail headers quality. 27 # 24 28 # Revision 1.72 2004/01/14 15:51:19 jalet 25 29 # Docstring added. … … 317 321 self.storage = storage.openConnection(self) 318 322 self.smtpserver = self.config.getSMTPServer() 323 self.maildomain = self.config.getMailDomain() 319 324 320 325 def logdebug(self, message) : … … 425 430 """Sends an email message containing headers to some user.""" 426 431 if "@" not in touser : 427 touser = "%s@%s" % (touser, self. smtpserver)432 touser = "%s@%s" % (touser, self.maildomain or self.smtpserver) 428 433 server = smtplib.SMTP(self.smtpserver) 429 434 try : 430 server.sendmail(adminmail, [touser], fullmessage)435 server.sendmail(adminmail, [touser], "From: %s\nTo: %s\n%s" % (adminmail, touser, fullmessage)) 431 436 except smtplib.SMTPRecipientsRefused, answer : 432 437 for (k, v) in answer.recipients.items() : … … 574 579 email = user.Email or user.Name 575 580 if "@" not in email : 576 email = "%s@%s" % (email, self. smtpserver)581 email = "%s@%s" % (email, self.maildomain or self.smtpserver) 577 582 os.system(cmd % locals()) 578 583 -
pykota/trunk/pykota/version.py
r1351 r1353 22 22 # 23 23 24 __version__ = "1.18alpha 5_unofficial"24 __version__ = "1.18alpha6_unofficial" 25 25 26 26 __doc__ = """PyKota : a complete Printing Quota Solution for CUPS and LPRng."""