{"id":1076,"date":"2011-07-23T15:21:39","date_gmt":"2011-07-23T13:21:39","guid":{"rendered":"https:\/\/thebc.ch\/blog\/?p=1076"},"modified":"2017-03-12T09:16:51","modified_gmt":"2017-03-12T08:16:51","slug":"email-notification-with-yum-updatesd-via-mailx","status":"publish","type":"post","link":"https:\/\/thebc.ch\/blog\/?p=1076","title":{"rendered":"Email notification with yum-updatesd via mailx"},"content":{"rendered":"<p>&nbsp;<\/p>\n<p>1. Install and configure <strong>yum-updatesd<\/strong><\/p>\n<div class=\"codecolorer-container text default\" style=\"overflow:auto;white-space:nowrap;width:100%;\"><table cellspacing=\"0\" cellpadding=\"0\"><tbody><tr><td class=\"line-numbers\"><div>1<br \/><\/div><\/td><td><div class=\"text codecolorer\"># yum install yum-updatesd mailx ssmtp # Or msmtp<\/div><\/td><\/tr><\/tbody><\/table><\/div>\n<p>We want only be notified of new updates. We want not to install them automatically. Your \/etc\/yum\/yum-updatesd.conf should be similar to this:<\/p>\n<div class=\"codecolorer-container text default\" style=\"overflow:auto;white-space:nowrap;width:100%;\"><table cellspacing=\"0\" cellpadding=\"0\"><tbody><tr><td class=\"line-numbers\"><div>1<br \/>2<br \/>3<br \/>4<br \/>5<br \/>6<br \/>7<br \/>8<br \/>9<br \/>10<br \/>11<br \/>12<br \/>13<br \/>14<br \/>15<br \/>16<br \/>17<br \/>18<br \/>19<br \/>20<br \/><\/div><\/td><td><div class=\"text codecolorer\">[main]<br \/>\n# how often to check for new updates (in seconds)<br \/>\nrun_interval = 3600<br \/>\n# how often to allow checking on request (in seconds)<br \/>\nupdaterefresh = 600<br \/>\n# how to send notifications (valid: dbus, email, syslog)<br \/>\nemit_via = email<br \/>\n# who to send the email notifications to<br \/>\nemail_to = someuser@thebc.ch<br \/>\n# who send the notifications<br \/>\nemail_from = someuser@thebc.ch<br \/>\n# should we listen via dbus to give out update information\/check for<br \/>\n# new updates<br \/>\ndbus_listener = yes<br \/>\n# automatically install updates<br \/>\ndo_update = no<br \/>\n# automatically download updates<br \/>\ndo_download = no<br \/>\n# automatically download deps of updates<br \/>\ndo_download_deps = no<\/div><\/td><\/tr><\/tbody><\/table><\/div>\n<p>&nbsp;<\/p>\n<p>2. Configure <strong>ssmtp<\/strong><\/p>\n<div class=\"codecolorer-container text default\" style=\"overflow:auto;white-space:nowrap;width:100%;\"><table cellspacing=\"0\" cellpadding=\"0\"><tbody><tr><td class=\"line-numbers\"><div>1<br \/>2<br \/>3<br \/>4<br \/>5<br \/>6<br \/>7<br \/>8<br \/>9<br \/>10<br \/>11<br \/>12<br \/>13<br \/>14<br \/>15<br \/>16<br \/>17<br \/><\/div><\/td><td><div class=\"text codecolorer\">#<br \/>\n# Config file for sSMTP sendmail<br \/>\n#<br \/>\n# The person who gets all mail for userids &amp;lt; 1000<br \/>\n# Make this empty to disable rewriting.<br \/>\nroot=someuser@thebc.ch<br \/>\n# The place where the mail goes. The actual machine name is required no<br \/>\n# MX records are consulted. Commonly mailhosts are named mail.domain.com<br \/>\nmailhub=mailbox.thebc.ch # In most cases it will be better do give here the IP-address of your mailserver<br \/>\n# Where will the mail seem to come from?<br \/>\n#rewriteDomain=<br \/>\n# The full hostname<br \/>\nhostname=thisserver.thebc.ch<br \/>\n# Are users allowed to set their own From: address?<br \/>\n# YES - Allow the user to specify their own From: address<br \/>\n# NO - Use the system generated From: address<br \/>\n# FromLineOverride=YES<\/div><\/td><\/tr><\/tbody><\/table><\/div>\n<p>&nbsp;<\/p>\n<p>3. Test Your config<\/p>\n<div class=\"codecolorer-container text default\" style=\"overflow:auto;white-space:nowrap;width:100%;\"><table cellspacing=\"0\" cellpadding=\"0\"><tbody><tr><td class=\"line-numbers\"><div>1<br \/><\/div><\/td><td><div class=\"text codecolorer\"># yum-updatesd --no-fork --oneshot --debug<\/div><\/td><\/tr><\/tbody><\/table><\/div>\n<p>&nbsp;<\/p>\n<p>4. Enable and start <strong>yum-updatesd<\/strong><\/p>\n<div class=\"codecolorer-container text default\" style=\"overflow:auto;white-space:nowrap;width:100%;\"><table cellspacing=\"0\" cellpadding=\"0\"><tbody><tr><td class=\"line-numbers\"><div>1<br \/><\/div><\/td><td><div class=\"text codecolorer\"># systemctl enable yum-updatesd<\/div><\/td><\/tr><\/tbody><\/table><\/div>\n<div class=\"codecolorer-container text default\" style=\"overflow:auto;white-space:nowrap;width:100%;\"><table cellspacing=\"0\" cellpadding=\"0\"><tbody><tr><td class=\"line-numbers\"><div>1<br \/><\/div><\/td><td><div class=\"text codecolorer\"># systemctl start yum-updatesd<\/div><\/td><\/tr><\/tbody><\/table><\/div>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp; 1. Install and configure yum-updatesd 1# yum install yum-updatesd mailx ssmtp # Or msmtp We want only be notified of new updates. We want not to install them automatically. Your \/etc\/yum\/yum-updatesd.conf should be similar to this: 1234567891011121314151617181920[main] # how &hellip; <a href=\"https:\/\/thebc.ch\/blog\/?p=1076\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[26,10,5],"tags":[40,39],"class_list":["post-1076","post","type-post","status-publish","format-standard","hentry","category-centos","category-fedora","category-linux","tag-mailx","tag-yum-updatesd"],"_links":{"self":[{"href":"https:\/\/thebc.ch\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1076","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/thebc.ch\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/thebc.ch\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/thebc.ch\/blog\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/thebc.ch\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1076"}],"version-history":[{"count":18,"href":"https:\/\/thebc.ch\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1076\/revisions"}],"predecessor-version":[{"id":5689,"href":"https:\/\/thebc.ch\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1076\/revisions\/5689"}],"wp:attachment":[{"href":"https:\/\/thebc.ch\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1076"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/thebc.ch\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1076"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/thebc.ch\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1076"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}