---
name: spamd
version: 4.9.1_1
origin: mail/spamd
comment: Traps spammers with a very slow smtp-login and return 4xx error
arch: freebsd:9:x86:64
www: http://freebsdspamd.berlios.de/
maintainer: ohauer@FreeBSD.org
prefix: /usr/local
licenselogic: single
licenses: [BSD]
flatsize: 137914
desc: "Spamd is a fake sendmail(8)-like daemon which rejects false mail. It is \ndesigned
  to be very efficient so that it does not slow down the receiving\nmachine.\n\nspamd
  considers sending hosts to be of three types:\n\n blacklisted hosts are redirected
  to spamd and tarpitted i.e. they are \n communicated with very slowly to consume
  the sender's resources. Mail is\n rejected with either a 450 or 550 error message.
  A blacklisted host will not\n be allowed to talk to a real mail server.\n\n whitelisted
  hosts do not talk to spamd. Their connections are instead sent to\n a real mail
  server, such as sendmail(8).\n\n greylisted hosts are redirected to spamd, but spamd
  has not yet decided if\n they are likely spammers. They are given a temporary failure
  message by spamd\n when they try to deliver mail.\n\nWWW: http://freebsdspamd.berlios.de/\n"
categories: [mail]
users: [_spamd]
groups: [_spamd]
files:
  /usr/local/etc/rc.d/obspamd: 75b653cc45bd0ccad81d97a4cae06044f22014ce02c88d57c99caf0b2026c6d2
  /usr/local/etc/rc.d/obspamlogd: bcdb1a2c54255510fff3b20c55ef43b5d44aff56b1a0c75ce6edc59e2d891686
  /usr/local/etc/spamd/spamd.conf.sample: 98819b8d2279f9a2fc3cffe2e63c1205e919a7040ae936c801c323a0fc4c50b5
  /usr/local/libexec/spamd: 90df6ffdb4449b959ffbf8c1d6e1d02aa39655b50dcc099345b76656c89d0cde
  /usr/local/libexec/spamlogd: eb19a16dcca2b03e5de68297f607bdf0c6ea487ad1e696f4a01b3a4085750f77
  /usr/local/man/man5/spamd.conf.5.gz: 86a272f9641155fb93b51b4c1e74984a1219796d08d42d6c8bd7659baf2d5172
  /usr/local/man/man8/spamd-setup.8.gz: 40a5d8bc72b4319e2903727be6d4f7753f75b7846ac04e3cfaf512e5985eb180
  /usr/local/man/man8/spamd.8.gz: d54e94e61d33b739b5772e10c4e1d3eac150116666870a1385d57fdb84166a4a
  /usr/local/man/man8/spamdb.8.gz: c0158d84fd3b255e038ba7f349dc115f7ad83bce2b384c06a93223b3abac0d70
  /usr/local/man/man8/spamlogd.8.gz: dc15440ab3fcf518b57246f169bcc3d6ea0b6959336daad371bce6f7f248e9ac
  /usr/local/sbin/spamd-setup: 21e8fbf5d2eab6148c99716377457c6b5d0f2835c340fe7b7c3f67ce312be298
  /usr/local/sbin/spamdb: e2a87147e51f0fadf8e8834f19b293358edffaef5861fd367db5f3848833f005
  /usr/local/share/doc/spamd/ipfw-spamd.txt: b2bed1cc0def42c55579f9c62ceb59977b1434e26f8a84f1d8d67287a853ec77
  /usr/local/share/doc/spamd/spamdb.txt: 8e4e942b060c8d01c51e8e47d244911ac8f201572e0665e3b3c2f4d8847206b0
  /usr/local/share/licenses/spamd-4.9.1_1/BSD: 85e7a53b5e2d3e350e2d084fed2f94b7f63005f8e1168740e1e84aa9fa5d48ce
  /usr/local/share/licenses/spamd-4.9.1_1/LICENSE: d9cce0db43502eb1bd8fbef7e960cfaa43b5647186f7f7379923b336209fd77b
  /usr/local/share/licenses/spamd-4.9.1_1/catalog.mk: e02f8c06bb3be37e31ca0f031b7ad3ceacd8f13392d19f0ac2698fd6ed09ca89
directories:
  /usr/local/share/licenses/spamd-4.9.1_1/: n
  /usr/local/share/licenses/: y
  /usr/local/share/doc/spamd/: n
  /usr/local/etc/spamd/: y
scripts:
  post-install: |
    echo "===> Creating users and/or groups."
    if ! /usr/sbin/pw groupshow _spamd >/dev/null 2>&1; then  echo "Creating group '_spamd' with gid '132'.";  /usr/sbin/pw groupadd _spamd -g 132; else echo "Using existing group '_spamd'."; fi
    if ! /usr/sbin/pw usershow _spamd >/dev/null 2>&1; then  echo "Creating user '_spamd' with uid '132'.";  /usr/sbin/pw useradd _spamd -u 132 -g 132  -c "Spam Daemon" -d /var/empty -s /usr/sbin/nologin;  else echo "Using existing user '_spamd'."; fi
    cd /usr/local
    cd /usr/local
  pre-deinstall: |
    if /usr/sbin/pw usershow _spamd >/dev/null 2>&1; then  echo "==> You should manually remove the \"_spamd\" user. "; fi
    cd /usr/local
    cd /usr/local
  post-deinstall: |
    cd /usr/local
    cd /usr/local
  install: "#!/bin/sh\n#\n# ex:ts=4:sw=4:noet\n#-*- mode: makefile; tab-width: 4;
    -*-\n#\n# $FreeBSD: ports/mail/spamd/files/pkg-install.in,v 1.5 2012/11/17 05:59:14
    svnexp Exp $\n\nSPAMDUSER=_spamd\nSPAMDGROUP=_spamd\nFILE=\"/etc/services\"\n\ncheck_db()
    {\n\tDB=/var/db/spamd\n\tif [ -f ${DB} ]; then\n\t\tOWN=$(stat -f \"%25Su\" ${DB})\n\t\tGRP=$(stat
    -f \"%25Sg\" ${DB})\n\t\tif [ \"x${OWN}\" != \"x${SPAMDUSER}\" ]; then\n\t\t\techo
    \"==> chown ${SPAMDUSER} ${DB} (previous ${OWN})\"\n\t\t\t\tchown ${SPAMDUSER}
    ${DB}\n\t\tfi\n\t\tif [ \"x${GRP}\" != \"x${SPAMDGROUP}\" ]; then\n\t\t\techo
    \"==> chgrp ${SPAMDGROUP} ${DB} (previous ${GRP})\"\n\t\t\tchgrp ${SPAMDGROUP}
    ${DB}\n\t\tfi\n\tfi\n}\n\ncheck_service() {\n\tlocal SERVICE PORT PROTO COMMENT\n\n\tSERVICE=$1\n\tPORT=$2\n\tPROTO=$3\n\tCOMMENT=$4\n\n\t#
    check\n\tOK=no\n\tHAS_SERVICE=no\n\tCOUNT=1\n\tfor i in $(grep ^${SERVICE} ${FILE});
    do\n\t\tif [ ${COUNT} -eq 1 ] && [ x\"${i}\" = x\"${SERVICE}\" ]; then\n\t\t\tHAS_SERVICE=yes\n\t\telif
    [ ${COUNT} -eq 2 ] && [ \"${HAS_SERVICE}\" = \"yes\" ] && \\\n\t\t\t[ x\"${i}\"
    = x\"${PORT}/${PROTO}\" ]; then\n\t\t\tOK=yes\n\t\t\tbreak\n\t\tfi\n\t\tCOUNT=$((
    ${COUNT} + 1 ))\n\tdone\n\t# add an entry for SERVICE to /etc/services\n\tif [
    \"${OK}\" = \"no\" ]; then\n\t\techo \"==> add entry \\\"${SERVICE} ${PORT}/${PROTO}\\\"\"\n\t\t(\n\t\t\tgrep
    -v -e \"^${SERVICE}.*${PORT}/${PROTO}\" ${FILE}\n\t\t\techo \"${SERVICE}\t${PORT}/${PROTO}
    \  # ${COMMENT}\"\n\t\t) >> ${FILE}.new\n\t\tmv ${FILE}.new ${FILE}\n\tfi\n}\n\n#
    always add service entries\nif [ \"$2\" = \"PRE-INSTALL\" ]; then\n\techo \"Checking
    ${FILE} for missing service entries\"\n\t[ ! -f ${FILE} ] && echo \"==> cannot
    find ${FILE} ... => exit\" &&  exit 1\n\tcheck_service spamd 8025 tcp \"spamd(8)\"\n\tcheck_service
    spamd-sync 8025 udp \"spamd(8) synchronisation\"\n\tcheck_service spamd-cfg 8026
    tcp \"spamd(8) configuration\"\nfi\n\nif [ \"$2\" = \"POST-INSTALL\" ]; then\n\tcheck_db\nfi\n"
  deinstall: "#!/bin/sh\n#\n# ex:ts=4:sw=4:noet\n#-*- mode: makefile; tab-width: 4;
    -*-\n#\n# $FreeBSD: ports/mail/spamd/pkg-deinstall,v 1.2 2012/11/17 05:59:14 svnexp
    Exp $\n\nif [ \"$2\" = \"DEINSTALL\" ]; then\n\tFILE=\"/etc/services\"\n\techo
    \"===>   Removing spamd entries from ${FILE}\"\n\tsed -i '' \\\n\t\t-e \"/^spamd-sync.*8025/d\"
    \\\n\t\t-e \"/^spamd-cfg.*8026/d\" \\\n\t\t-e \"/^spamd.*8025/d\" \\\n\t\t${FILE}\nfi\n"
message: "**********************************************************************\nTo
  enable spamd you need:\n\n1) Enable spamd in /etc/rc.conf with the following line:\n
  \  obspamd_enable=\"YES\"\n   obspamlogd_enable=\"YES\"\n\n   For PF you can specify
  a dedicated pflog interface with parameter\n   obspamlogd_pflog_if. This interface
  will be created and removed\n   by the rc script of spamlogd.\n\n2) Configuration
  template is available in /usr/local/etc/spamd as\n   spamd.conf.sample file.  Copy
  then to spamd.conf file and\n   edit to suit your needs.\n\n3) mount fdescfs to
  /dev/fd with the following line in /etc/fstab\n\tfdescfs  \t/dev/fd  \tfdescfs rw
  \t0 \t0\n\n   Note for XEN users:\n   The XEN kernel ships without modules, therefore
  you have to add\n   the following lines to the kernel config and build a new kernel.\n\toptions
  FDESCFS\n\tdevice\tpf\n\tdevice\tpflog\n\n4) Add following lines to the pf.conf(5)\n\n
  \ table <spamd-white> persist\n  no rdr inet proto tcp from <spamd-white> to any
  \\\n      port smtp\n  rdr pass inet proto tcp from any to any \\\n      port smtp
  -> 127.0.0.1 port spamd\n\nFreeBSD only features (not in OpenBSD):\n  - sync for
  spamdb (parameter -Y)\n    See /usr/local/share/doc/spamd/ for usage.\n\n**********************************************************************\n"
