From 7172aeddc17b279adc05e9c6dc4b8b33deb0923d Mon Sep 17 00:00:00 2001 From: Frantisek Hrdina Date: Thu, 4 Jul 2024 10:57:40 +0200 Subject: [PATCH] Fix bodycheck and headercheck tests for rhel10 --- Sanity/bodycheck/main.fmf | 2 +- Sanity/bodycheck/runtest.sh | 21 +++++++++++---------- Sanity/headercheck/main.fmf | 2 +- Sanity/headercheck/runtest.sh | 18 +++++++++--------- 4 files changed, 22 insertions(+), 21 deletions(-) diff --git a/Sanity/bodycheck/main.fmf b/Sanity/bodycheck/main.fmf index cf0dda0..eec68a6 100755 --- a/Sanity/bodycheck/main.fmf +++ b/Sanity/bodycheck/main.fmf @@ -9,11 +9,11 @@ recommend: - postfix - nc - rsyslog + - postfix-lmdb duration: 20m enabled: true tag: - Tier1 - - postfix::junk::bodycheck tier: '1' adjust: - enabled: false diff --git a/Sanity/bodycheck/runtest.sh b/Sanity/bodycheck/runtest.sh index a9b9520..06f4ead 100755 --- a/Sanity/bodycheck/runtest.sh +++ b/Sanity/bodycheck/runtest.sh @@ -33,6 +33,7 @@ PACKAGE="postfix" rlJournalStart rlPhaseStartSetup rlAssertRpm $PACKAGE + rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory" rlRun "pushd $TmpDir" @@ -44,7 +45,7 @@ rlJournalStart rlServiceStop "postfix" rlFileBackup "/etc/postfix/main.cf" - rlFileBackup "/etc/postfix/vmailbox" + rlFileBackup --missing-ok "/etc/postfix/vmailbox" rlFileBackup "/etc/postfix/virtual" rlFileBackup "/var/log/maillog" rlPhaseEnd @@ -59,8 +60,8 @@ rlJournalStart cat << "EOF" > "/etc/postfix/main.cf" myhostname = randomstuff.at -alias_maps = hash:/etc/aliases -alias_database = hash:/etc/aliases +alias_maps = lmdb:/etc/aliases +alias_database = lmdb:/etc/aliases myorigin = /etc/mailname mydestination = localhost.randomstuff.at, localhost @@ -75,11 +76,11 @@ smtpd_relay_restrictions = reject_unauth_destination virtual_mailbox_domains = example.com virtual_mailbox_base = /var/mail/vhosts -virtual_mailbox_maps = hash:/etc/postfix/vmailbox +virtual_mailbox_maps = lmdb:/etc/postfix/vmailbox virtual_minimum_uid = 100 virtual_uid_maps = static:5000 virtual_gid_maps = static:5000 -virtual_alias_maps = hash:/etc/postfix/virtual +virtual_alias_maps = lmdb:/etc/postfix/virtual body_checks = regexp:/etc/postfix/body_checks EOF @@ -97,8 +98,8 @@ EOF /Aliens/ REJECT EOF - rlRun "postmap /etc/postfix/virtual" - rlRun "postmap /etc/postfix/vmailbox" + rlRun "postmap lmdb:/etc/postfix/virtual" + rlRun "postmap lmdb:/etc/postfix/vmailbox" rlServiceStart "postfix" rlPhaseEnd @@ -109,7 +110,7 @@ EHLO aliens.outerworld MAIL FROM: friendly@alien.xt RCPT TO: info@example.com DATA -Hello we are friendly Aliens and we are comming in peace! +Hello we are friendly Aliens and we are coming in peace! . EOF @@ -125,8 +126,8 @@ EOF rlServiceStop "postfix" - rlRun "rm -rf /etc/postfix/vmailbox.db" - rlRun "rm -rf /etc/postfix/virtual.db" + rlRun "rm -rf /etc/postfix/vmailbox.lmdb" + rlRun "rm -rf /etc/postfix/virtual.lmdb" rlRun "rm -rf /etc/postfix/body_checks" rlFileRestore diff --git a/Sanity/headercheck/main.fmf b/Sanity/headercheck/main.fmf index 133fe74..35e4431 100755 --- a/Sanity/headercheck/main.fmf +++ b/Sanity/headercheck/main.fmf @@ -9,11 +9,11 @@ recommend: - postfix - nc - rsyslog + - postfix-lmdb duration: 20m enabled: true tag: - Tier1 - - postfix::junk::headercheck tier: '1' adjust: - enabled: false diff --git a/Sanity/headercheck/runtest.sh b/Sanity/headercheck/runtest.sh index e79370f..c0aa7d1 100755 --- a/Sanity/headercheck/runtest.sh +++ b/Sanity/headercheck/runtest.sh @@ -44,7 +44,7 @@ rlJournalStart rlServiceStop "postfix" rlFileBackup "/etc/postfix/main.cf" - rlFileBackup "/etc/postfix/vmailbox" + rlFileBackup --mising-ok "/etc/postfix/vmailbox" rlFileBackup "/etc/postfix/virtual" rlFileBackup "/var/log/maillog" rlPhaseEnd @@ -59,8 +59,8 @@ rlJournalStart cat << "EOF" > "/etc/postfix/main.cf" myhostname = randomstuff.at -alias_maps = hash:/etc/aliases -alias_database = hash:/etc/aliases +alias_maps = lmdb:/etc/aliases +alias_database = lmdb:/etc/aliases myorigin = /etc/mailname mydestination = localhost.randomstuff.at, localhost @@ -75,11 +75,11 @@ smtpd_relay_restrictions = reject_unauth_destination virtual_mailbox_domains = example.com virtual_mailbox_base = /var/mail/vhosts -virtual_mailbox_maps = hash:/etc/postfix/vmailbox +virtual_mailbox_maps = lmdb:/etc/postfix/vmailbox virtual_minimum_uid = 100 virtual_uid_maps = static:5000 virtual_gid_maps = static:5000 -virtual_alias_maps = hash:/etc/postfix/virtual +virtual_alias_maps = lmdb:/etc/postfix/virtual header_checks = regexp:/etc/postfix/header_checks EOF @@ -97,8 +97,8 @@ EOF /^From.*alien\.xt/ REJECT Sorry, no aliens welcome! EOF - rlRun "postmap /etc/postfix/virtual" - rlRun "postmap /etc/postfix/vmailbox" + rlRun "postmap lmdb:/etc/postfix/virtual" + rlRun "postmap lmdb:/etc/postfix/vmailbox" rlServiceStart "postfix" rlPhaseEnd @@ -125,8 +125,8 @@ EOF rlRun "rm -rf /var/mail/vhosts" rlServiceStop "postfix" - rlRun "rm -rf /etc/postfix/vmailbox.db" - rlRun "rm -rf /etc/postfix/virtual.db" + rlRun "rm -rf /etc/postfix/vmailbox.lmdb" + rlRun "rm -rf /etc/postfix/virtual.lmdb" rlRun "rm -rf /etc/postfix/header_checks" rlFileRestore