diff options
author | Marius Mauch <genone@gentoo.org> | 2007-01-25 15:49:26 +0000 |
---|---|---|
committer | Marius Mauch <genone@gentoo.org> | 2007-01-25 15:49:26 +0000 |
commit | 3b08c21101b0801d7c5d6c145a27bef5cd42078c (patch) | |
tree | 2eea73b311d67b567410670630335796bf0a272c /pym/portage/elog_modules/mod_mail.py | |
parent | b4eed9540e19ee7038ac875f0e084f8256675580 (diff) | |
download | portage-3b08c21101b0801d7c5d6c145a27bef5cd42078c.tar.gz portage-3b08c21101b0801d7c5d6c145a27bef5cd42078c.tar.bz2 portage-3b08c21101b0801d7c5d6c145a27bef5cd42078c.zip |
Namespace sanitizing, step 1
svn path=/main/trunk/; revision=5778
Diffstat (limited to 'pym/portage/elog_modules/mod_mail.py')
-rw-r--r-- | pym/portage/elog_modules/mod_mail.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/pym/portage/elog_modules/mod_mail.py b/pym/portage/elog_modules/mod_mail.py new file mode 100644 index 000000000..b8e17a51a --- /dev/null +++ b/pym/portage/elog_modules/mod_mail.py @@ -0,0 +1,22 @@ +# portage.py -- core Portage functionality +# Copyright 1998-2004 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +import portage_mail, socket + +def process(mysettings, cpv, logentries, fulltext): + if mysettings.has_key("PORTAGE_ELOG_MAILURI"): + myrecipient = mysettings["PORTAGE_ELOG_MAILURI"].split()[0] + else: + myrecipient = "root@localhost" + + myfrom = mysettings["PORTAGE_ELOG_MAILFROM"] + mysubject = mysettings["PORTAGE_ELOG_MAILSUBJECT"] + mysubject = mysubject.replace("${PACKAGE}", cpv) + mysubject = mysubject.replace("${HOST}", socket.getfqdn()) + + mymessage = portage_mail.create_message(myfrom, myrecipient, mysubject, fulltext) + portage_mail.send_mail(mysettings, mymessage) + + return |