lib/specinfra/command/openbsd/base/mail_alias.rb in specinfra-2.43.11 vs lib/specinfra/command/openbsd/base/mail_alias.rb in specinfra-2.44.0

- old
+ new

@@ -1,7 +1,8 @@ class Specinfra::Command::Openbsd::Base::MailAlias < Specinfra::Command::Base::MailAlias class << self def check_is_aliased_to(recipient, target) - "egrep '^#{escape(recipient)}:.*#{escape(target)}' /etc/mail/aliases" + target = %Q{([[:space:]]|,)["']?#{escape(target)}["']?(,|$)} + "egrep ^#{escape(recipient)}:.*#{escape(target)} /etc/mail/aliases" end end end