Support ${HOST} substitution in "From" field. Thanks to wschlich.
authorZac Medico <zmedico@gentoo.org>
Fri, 28 Mar 2008 12:43:12 +0000 (12:43 -0000)
committerZac Medico <zmedico@gentoo.org>
Fri, 28 Mar 2008 12:43:12 +0000 (12:43 -0000)
(trunk r9510)

svn path=/main/branches/2.1.2/; revision=9570

pym/elog_modules/mod_mail.py
pym/elog_modules/mod_mail_summary.py

index 058faa7c0656ff5aa1743a97204f1145c5f023db..01771262d5bdf20c78dbabb64b6b8cac3677ce0b 100644 (file)
@@ -14,6 +14,7 @@ def process(mysettings, cpv, logentries, fulltext):
                myrecipient = "root@localhost"
        
        myfrom = mysettings["PORTAGE_ELOG_MAILFROM"]
+       myfrom = myfrom.replace("${HOST}", socket.getfqdn())
        mysubject = mysettings["PORTAGE_ELOG_MAILSUBJECT"]
        mysubject = mysubject.replace("${PACKAGE}", cpv)
        mysubject = mysubject.replace("${HOST}", socket.getfqdn())
index 339b4b827ac715a47b92172e2f7bdbf7464a7a29..50e8171df4d8c3df2d18e2982af51ee671ad2167 100644 (file)
@@ -39,6 +39,7 @@ def _finalize(mysettings, items):
                myrecipient = "root@localhost"
        
        myfrom = mysettings["PORTAGE_ELOG_MAILFROM"]
+       myfrom = myfrom.replace("${HOST}", socket.getfqdn())
        mysubject = mysettings["PORTAGE_ELOG_MAILSUBJECT"]
        mysubject = mysubject.replace("${PACKAGE}", count)
        mysubject = mysubject.replace("${HOST}", socket.getfqdn())