Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
spamassassin
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
certo
spamassassin
Commits
646d49d1
Commit
646d49d1
authored
Jan 22, 2021
by
Vladimir Bashkirtsev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Configured systemd unit file and periodic update
parent
2b23350a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
109 additions
and
1 deletion
+109
-1
Makefile
Makefile
+77
-1
sa-update.cron
sa-update.cron
+32
-0
No files found.
Makefile
View file @
646d49d1
all
:
all
:
spamassassin-service sa-update-service sa-update-timer
tar
xf Mail-SpamAssassin-3.4.4.tar.bz2
tar
xf Mail-SpamAssassin-3.4.4.tar.bz2
cd
Mail-SpamAssassin-3.4.4
&&
perl Makefile.PL
cd
Mail-SpamAssassin-3.4.4
&&
perl Makefile.PL
$(MAKE)
-C
Mail-SpamAssassin-3.4.4
$(MAKE)
-C
Mail-SpamAssassin-3.4.4
$(MAKE)
-C
Mail-SpamAssassin-3.4.4
install
$(MAKE)
-C
Mail-SpamAssassin-3.4.4
install
install
-v
-Dm755
sa-update.cron /usr/share/spamassassin
@
echo
"
$$
SPAMASSASSIN_SERVICE"
>
/lib/systemd/system/spamassassin.service
systemctl
enable
spamassassin.service
@
echo
"
$$
SA_UPDATE_SERVICE"
>
/lib/systemd/system/sa-update.service
@
echo
"
$$
SA_UPDATE_TIMER"
>
/lib/systemd/system/sa-update.timer
install
-d
-m700
/etc/mail/spamassassin/sa-update-keys
rm
-rf
Mail-SpamAssassin-3.4.4
rm
-rf
Mail-SpamAssassin-3.4.4
spamassassin-service
:
define
SPAMASSASSIN_SERVICE
[Unit]
Description
=
Spamassassin daemon
After
=
syslog.target network.target
Wants
=
sa-update.timer
[Service]
ExecStart
=
/usr/bin/spamd
Restart
=
always
[Install]
WantedBy
=
multi-user.target
endef
export
SPAMASSASSIN_SERVICE
sa-update-service
:
define
SA_UPDATE_SERVICE
### Spamassassin Rules Updates ###
#
# http://wiki.apache.org/spamassassin/RuleUpdates
#
# sa-update automatically updates your rules once per day if a spam daemon like
# spamd or amavisd are running.
[Unit]
Description
=
Spamassassin Rules Update
Documentation
=
man:sa-update
(
1
)
[Service]
# Note that the opposite of "yes" is the empty string, NOT "no"
# Options for the actual sa-update command
# These are added to the channel configuration from
# /etc/mail/spamassassin/channel.d/*.conf
Environment
=
OPTIONS
=
-v
# Debug script - send mail even if no update available
#Environment=DEBUG=yes
# Send mail when updates successfully processed
# Default: send mail only on error
#Environment=NOTIFY_UPD=yes
ExecStart
=
/usr/share/spamassassin/sa-update.cron
SuccessExitStatus
=
1
endef
export
SA_UPDATE_SERVICE
sa-update-timer
:
define
SA_UPDATE_TIMER
### Spamassassin Rules Updates ###
#
# http://wiki.apache.org/spamassassin/RuleUpdates
#
# sa-update automatically updates your rules once per day if a spam daemon like
# spamd or amavisd are running.
[Unit]
Description
=
Spamassassin Rules Update timer
Documentation
=
man:sa-update
(
1
)
[Timer]
OnCalendar
=
daily
[Install]
WantedBy
=
spamassassin.service
endef
export
SA_UPDATE_TIMER
sa-update.cron
0 → 100755
View file @
646d49d1
#!/bin/bash
# sa-update must create keyring
if
[
!
-d
/etc/mail/spamassassin/sa-update-keys
]
;
then
sa-update
fi
/usr/bin/sa-update
status
=
$?
now
=
`
date
+
"%d-%b-%Y %T"
`
if
[
$status
-eq
0
]
;
then
echo
"
$now
: SpamAssassin: Update processed successfully"
systemctl condrestart spamassassin.service
>
& /dev/null
systemctl
--quiet
is-active mimedefang.service
;
[
$?
-eq
0
]
&&
systemctl reload mimedefang.service
>
& /dev/null
exit
$status
fi
if
[
$status
-eq
1
]
;
then
echo
"
$now
: SpamAssassin: No update available"
exit
$status
fi
if
[
$status
-eq
2
]
;
then
echo
"
$now
: SpamAssassin: Problem applying update - pre files failed lint check"
exit
$status
fi
if
[
$status
-eq
4
]
;
then
echo
"
$now
: SpamAssassin: Update available, but download or extract failed"
exit
$status
fi
echo
"
$now
: SpamAssassin: Unknown error code
$status
from sa-update"
exit
$status
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment