Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    SpamD v4.3.7 on 1.2.1-RC1

    Scheduled Pinned Locked Moved pfSense Packages
    30 Posts 6 Posters 17.3k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • C
      cheesyboofs
      last edited by

      It apparently works in 1.3.

      God knows how?

      Can't try vanilla install of 1.3 as I don't have a spare CD-R at the moment but I fear it will be the same!

      Upgrade from 1.2.1 TO-> 1.3-ALPHA-ALPHA built on Wed Aug 20 11:21:04 EDT 2008 FreeBSD 7.0-RELEASE-p3

      # /usr/local/etc/rc.d/spamd.sh start
      /usr/local/etc/rc.d/spamd.sh: /sbin/mount_fdescfs: not found
      whitelist whitelist 0 entries
      blacklist blacklist 0 entries
      spamd: spamlogd: Can't find service "spamd-sync" in /etc/servicesCan't find service "spamd-sync" in /etc/services
      

      1.jpg
      1.jpg_thumb
      2.jpg
      2.jpg_thumb

      Author of pfSense themes:

      DARK-ORANGE

      CODE-RED

      1 Reply Last reply Reply Quote 0
      • C
        cheesyboofs
        last edited by

        Does the pfSense spamd package support multi WAN? i.e. If my mail comes in and goes out of my opt interface should it still work?

        Author of pfSense themes:

        DARK-ORANGE

        CODE-RED

        1 Reply Last reply Reply Quote 0
        • S
          sullrich
          last edited by

          Fixed the /etc/services issues.

          I would think that spamd should be able to accept mail on all interfaces, IIRC.  It listens on ..

          1 Reply Last reply Reply Quote 0
          • C
            cheesyboofs
            last edited by

            fresh install from ISO 1.2.1-RC1 built on Wed Aug 13 04:23:51 EDT 2008 + spamd 4.3.7

            Just not doing anything for me, mails arn't even slowed!

            /usr/local/etc/rc.d/spamd.sh start

            /usr/local/etc/rc.d/spamd.sh: /sbin/mount_fdescfs: not found
            spamd: whitelist whitelist 0 entries
            blacklist blacklist 0 entries
            Getting http://www.openbsd.org/spamd/traplist.gz
            bind: Address already in use

            blacklist UofATraplist 38691 entries

            /usr/local/etc/rc.d/spamd.sh restart

            No matching processes were found
            killall: warning: kill -TERM 21771: No such process
            killall: warning: kill -TERM 21769: No such process
            /usr/local/etc/rc.d/spamd.sh: /sbin/mount_fdescfs: not found
            whitelist whitelist 0 entries
            blacklist blacklist 0 entries
            Getting http://www.openbsd.org/spamd/traplist.gz

            pfctl: /dev/fd/7: No such file or directory

            blacklist UofATraplist 38691 entries

            Why does it say, Address already in use?
            Why does it say,  /sbin/mount_fdescfs: not found?

            UPDATE to: 1.2.1-RC1 built on Mon Aug 25 07:40:58 EDT 2008

            Executing custom_php_resync_config_command()…done.
            Writing configuration... done.
            Starting service.

            All packages reinstalled.

            /usr/local/etc/rc.d/spamd.sh restart

            No matching processes were found
            killall: warning: kill -TERM 3829: No such process
            killall: warning: kill -TERM 3826: No such process
            /usr/local/etc/rc.d/spamd.sh: /sbin/mount_fdescfs: not found
            whitelist whitelist 0 entries
            blacklist blacklist 0 entries
            Getting http://www.openbsd.org/spamd/traplist.gz

            pfctl: /dev/fd/7: No such file or directory

            blacklist UofATraplist 38374 entries

            Author of pfSense themes:

            DARK-ORANGE

            CODE-RED

            1 Reply Last reply Reply Quote 0
            • ?
              Guest
              last edited by

              SpamD is working fine for us in production on a single-WAN setup.  We have not tested with multi-WAN, but for single-WAN it works very well, except for the RRD graphs not being updated.

              1 Reply Last reply Reply Quote 0
              • W
                wallabybob
                last edited by

                @cheesyboofs:

                Why does it say, Address already in use?

                Something else is already listening on the port (smtp port?) spamd uses?

                1 Reply Last reply Reply Quote 0
                • C
                  cheesyboofs
                  last edited by

                  My understanding is that spamd listens on 127.0.0.1 and then forwards on to my mail server (ip)

                  rc_start() {
                          /sbin/mount_fdescfs fdescfs /dev/fd
                  /usr/local/sbin/spamd-setup -d &
                  /sbin/pflogd &
                  /usr/local/libexec/spamd  -G 25:4:864 -n "pfsense" -c 800 -B 700 -w 1 127.0.0.1 &
                  /usr/local/libexec/spamlogd

                  }

                  I still have my NAT and firewall rule in place for port 25, should this be removed once spamd is installed? or should I change it so that port 25 is routed to 127.0.0.1 (pfsense) instead and then let spamd forward it on to exchange?

                  mail.jpg
                  mail.jpg_thumb

                  Author of pfSense themes:

                  DARK-ORANGE

                  CODE-RED

                  1 Reply Last reply Reply Quote 0
                  • N
                    nocer
                    last edited by

                    Hi.

                    My spamd runs fine on 1.3(I know nothing about 1.2.1, sorry) box, only difference is the port#, I use 8025 instead. I've configured "spamd -g" runs at localhost:8025. The following is my quick/dirty but works fine pf rules;

                    –-
                    table <spamd>persist
                    table <spamd-white>persist
                    no rdr on { lo0, lo1 } from any to any
                    rdr pass inet proto tcp from <spamd>to any port smtp -> 127.0.0.1 port 8025
                    rdr pass inet proto tcp from ! <spamd-white>os {"Windows 2000", "Windows XP"} to any port smtp -> 127.0.0.1 port 8025

                    It look like you're getting "fdescfs" nags because there's no "mount_fdescfs" command exists in /sbin, but spamd requires /dev/fd for updating its white-list. Copy mount_fdescfs from other FreeBSD or use /boot/kernel/fdescfs.ko instead. Add the following line in your fstab; fdescfs /dev/fd fdescfs rw 0 0

                    This is only my environment and may not fit yours but really hope this helps.</spamd-white></spamd></spamd-white></spamd>

                    1 Reply Last reply Reply Quote 0
                    • C
                      cheesyboofs
                      last edited by

                      I think I have figured it out and now have it working I think!

                      I removed my WAN -> LAN NAT entry and changed my port 25 rule and now I'm getting mails graylisted as I should.

                      Just look at how many I got in the first 40 seconds of the service being up and running and you will see why I was so keen to get it working.

                      @ Sullrich - might be an idea to have a prompt on the spamd config page to mention removing existing NAT entries.

                      @ MOD's please move to the packages section of the forum as this issue was clearly not related to 1.2.1, many thanks to all.

                      mail2.jpg
                      mail2.jpg_thumb
                      mail.jpg
                      mail.jpg_thumb

                      Author of pfSense themes:

                      DARK-ORANGE

                      CODE-RED

                      1 Reply Last reply Reply Quote 0
                      • C
                        cheesyboofs
                        last edited by

                        I think I'm nearly there, I am now correctly getting white list entries for known good servers but I'm still not getting the mails?
                        I can see them coming in via the logs on the firewall but I don't think they are getting sent on to exchange.

                        Apart from the NextMTA: 192.168.100.5 is there anything else I need to tweak? NAT maybe?

                        Help!

                        EDIT: @ sullrich  I think nocer has something

                        but spamd requires /dev/fd for updating its white-list.

                        as none of the whitlist entries blow have been copied to /var/db/whitelist.txt. So I have used the white list tab to add some (not the silly button) and this updated  /var/db/whitelist.txt still not getting any mails though.

                        mail3.jpg
                        mail3.jpg_thumb

                        Author of pfSense themes:

                        DARK-ORANGE

                        CODE-RED

                        1 Reply Last reply Reply Quote 0
                        • N
                          nocer
                          last edited by

                          @cheesyboofs:

                          EDIT: @ sullrich  I think nocer has something

                          but spamd requires /dev/fd for updating its white-list.

                          as none of the whitlist entries blow have been copied to /var/db/whitelist.txt. So I have used the white list tab to add some (not the silly button) and this updated  /var/db/whitelist.txt still not getting any mails though.

                          Hello, I'm not able to address your MTA issue but may /dev/fd or grey listing/white listing.

                          Well, while back ago I happend to see the following message every few minutes when struggling with spamd running;

                          –-
                          pfctl: /dev/fd/7: No such file or direcotry.

                          Then I realized that spamd uses pfctl to update its white-list table because looking thru the grey.c I found the following;


                          static char *pargv[11]= {
                                  "pfctl", "-p", "/dev/pf", "-q", "-t",
                                  "spamd-white", "-T", "replace", "-f" "-", NULL
                          };
                          –-

                          and it also does;


                          if (asprintf(&fdpath, "/dev/fd/%d", pfdev) == -1)
                                        return(-1);
                                pargv[2] = fdpath;
                          –-

                          Basicall pfdev opens /dev/pf which is the file descriptor required. So I checked my /dev/fd and found so sad,


                          $ ls -l /dev/fd
                          total 0
                          crw-rw-rw-  1 root  wheel    0,  18 Mar  4 23:14 0
                          crw-rw-rw-  1 root  wheel    0,  20 Mar  4 23:14 1
                          crw-rw-rw-  1 root  wheel    0,  22 Mar  4 23:14 2

                          There were only three of them, but as the error messages said pf needed 7 at least so I check another machine which ran OpenBSD, it had 65(0-64) of them there. So I did;


                          $ sudo mount_fdescfs fdescfs /dev/fd

                          which forced the kernel to make descriptors as needed and added the following into fstab;


                          fdescfs /dev/fd fdescfs rw 0 0

                          That's pretty much for now.

                          @ Sullrich
                          Would it be possible to add /sbin/mount_fdescfs at leaset because it is called in rc and modify fstab at the startup if there's spamd configured?

                          1 Reply Last reply Reply Quote 0
                          • C
                            cheesyboofs
                            last edited by

                            Thanks nocer,

                            Still not quite there yet!

                            sudo mount_fdescfs fdescfs /dev/fd

                            sudo: Command not found.

                            So;

                            vi /etc/fstab

                            Device                Mountpoint      FStype  Options        Dump    Pass#

                            /dev/ad0s1a            /              ufs    rw              1      1
                            /dev/ad0s1b            none            swap    sw              0      0
                            fdescfs                /dev/fd        fdescfs rw              0      0
                            ~

                            :wq!

                            mount -a

                            mount

                            /dev/ad0s1a on / (ufs, local)
                            devfs on /dev (devfs, local)
                            /dev/md0 on /var/run (ufs, local)
                            devfs on /var/dhcpd/dev (devfs, local)
                            fdescfs on /dev/fd (fdescfs)

                            ls -l /dev/fd

                            total 16
                            crw–w----  1 root  tty      0, 113 Aug 31 12:07 0
                            crw--w----  1 root  tty      0, 113 Aug 31 12:07 1
                            crw--w----  1 root  tty      0, 113 Aug 31 12:07 2
                            d-w-------  1 root  wheel      512 Aug 20 18:37 3
                            d---------  1 root  wheel      512 Aug 29 17:06 4

                            /usr/local/etc/rc.d/spamd.sh restart

                            No matching processes were found
                            killall: warning: kill -TERM 96371: No such process
                            killall: warning: kill -TERM 96369: No such process
                            /usr/local/etc/rc.d/spamd.sh: /sbin/mount_fdescfs: not found
                            whitelist whitelist 0 entries
                            blacklist blacklist 0 entries

                            ls -l /sbin

                            total 2614
                            -r-xr-xr-x  1 root  wheel    7364 Aug 13 04:51 adjkerntz
                            -r-xr-xr-x  1 root  wheel  13664 Aug 13 04:51 atacontrol
                            -r-xr-xr-x  1 root  wheel    819 Nov 16  2005 athctrl.sh
                            -r-xr-xr-x  1 root  wheel  28636 Aug 13 04:51 bsdlabel
                            -r-xr-xr-x  1 root  wheel    6096 Aug 13 04:51 conscontrol
                            -r-xr-xr-x  1 root  wheel  342500 Aug 13 05:23 devd
                            -r-xr-xr-x  1 root  wheel  10992 Aug 13 04:51 devfs
                            -r-xr-xr-x  1 root  wheel  74456 Aug 13 04:51 dhclient
                            -r-xr-xr-x  1 root  wheel    8876 Jul  2  2007 dhclient-script
                            -r-xr-xr-x  1 root  wheel  28636 Aug 13 04:51 disklabel
                            -r-xr-xr-x  1 root  wheel    6048 Aug 13 04:51 dmesg
                            -r-xr-xr-x  1 root  wheel  47788 Aug 13 04:51 dump
                            -r-xr-xr-x  1 root  wheel  11516 Aug 13 04:51 dumpfs
                            -r-xr-xr-x  1 root  wheel    4676 Aug 13 04:51 dumpon
                            -r-xr-xr-x  1 root  wheel    6848 Aug 13 04:51 fastboot
                            -r-xr-xr-x  1 root  wheel    6848 Aug 13 04:51 fasthalt
                            -r-xr-xr-x  1 root  wheel  23796 Aug 13 04:51 fdisk
                            -r-xr-xr-x  1 root  wheel  14556 Aug 13 04:51 fsck
                            -r-xr-xr-x  1 root  wheel  87016 Aug 13 04:51 fsck_4.2bsd
                            -r-xr-xr-x  1 root  wheel  87016 Aug 13 04:51 fsck_ffs
                            -r-xr-xr-x  1 root  wheel  27944 Aug 13 04:51 fsck_msdosfs
                            -r-xr-xr-x  1 root  wheel  87016 Aug 13 04:51 fsck_ufs
                            -r-xr-xr-x  1 root  wheel  20276 Aug 13 04:51 gcache
                            -r-xr-xr-x  1 root  wheel  20276 Aug 13 04:51 gjournal
                            -r-xr-xr-x  1 root  wheel  20276 Aug 13 04:51 glabel
                            -r-xr-xr-x  1 root  wheel  20276 Aug 13 04:51 gmirror
                            -r-xr-xr-x  1 root  wheel  20276 Aug 13 04:51 gmultipath
                            -r-xr-xr-x  1 root  wheel  20276 Aug 13 04:51 gpart
                            -r-xr-xr-x  1 root  wheel  39120 Aug 13 04:51 growfs
                            -r-xr-xr-x  1 root  wheel  20276 Aug 13 04:51 gvirstor
                            -r-xr-xr-x  1 root  wheel    6848 Aug 13 04:51 halt
                            -r-xr-xr-x  1 root  wheel    6904 Aug 13 04:51 idmapd
                            -r-xr-xr-x  1 root  wheel  87856 Aug 13 04:51 ifconfig
                            -r-xr-xr-x  1 root  wheel  434100 Aug 13 04:51 init
                            -r-xr-xr-x  1 root  wheel  76988 Aug 13 04:51 ipfw
                            -r-xr-xr-x  1 root  wheel  26552 Aug 13 04:51 iscontrol
                            -r-xr-xr-x  1 root  wheel    7272 Aug 13 04:51 kldconfig
                            -r-xr-xr-x  1 root  wheel    3756 Aug 13 04:51 kldload
                            -r-xr-xr-x  1 root  wheel    5312 Aug 13 04:51 kldstat
                            -r-xr-xr-x  1 root  wheel    4412 Aug 13 04:51 kldunload
                            -r-xr-xr-x  1 root  wheel  18476 Aug 13 04:51 ldconfig
                            -r-xr-xr-x  1 root  wheel    9668 Aug 13 04:51 md5
                            -r-xr-xr-x  1 root  wheel  10300 Aug 13 04:51 mdconfig
                            -r-xr-xr-x  1 root  wheel  14284 Aug 13 04:51 mdmfs
                            -r-xr-xr-x  1 root  wheel    4816 Aug 13 04:51 mknod
                            -r-xr-xr-x  1 root  wheel  17036 Aug 13 04:51 mount
                            -r-xr-xr-x  1 root  wheel    8812 Aug 13 04:51 mount_cd9660
                            -r-xr-xr-x  1 root  wheel  14284 Aug 13 04:51 mount_mfs
                            -r-xr-xr-x  1 root  wheel  10192 Aug 13 04:51 mount_msdosfs
                            -r-xr-xr-x  1 root  wheel    6564 Aug 13 04:51 mount_nullfs
                            -r-xr-xr-x  1 root  wheel    7124 Aug 13 04:51 mount_unionfs
                            -r-xr-xr-x  1 root  wheel  29104 Aug 13 04:51 newfs
                            -r-xr-xr-x  1 root  wheel  20024 Aug 13 04:51 newfs_msdos
                            lr-xr-xr-x  1 root  wheel      17 Aug 20 18:28 nologin -> /usr/sbin/nologin
                            -r-xr-xr-x  1 root  wheel  205672 Aug 13 04:51 pfctl
                            -r-xr-xr-x  1 root  wheel  18772 Aug 13 04:51 pflogd
                            -r-xr-xr-x  1 root  wheel  23872 Aug 13 04:51 ping
                            -r-xr-xr-x  1 root  wheel  31196 Aug 13 04:51 ping6
                            -r-xr-xr-x  1 root  wheel    6848 Aug 13 04:51 reboot
                            -r-xr-xr-x  1 root  wheel    7812 Aug 13 04:51 recoverdisk
                            -r-xr-xr-x  1 root  wheel    9668 Aug 13 04:51 rmd160
                            -r-xr-xr-x  1 root  wheel  23644 Aug 13 04:51 route
                            -r-xr-xr-x  1 root  wheel  85808 Aug 13 04:51 routed
                            -r-xr-xr-x  1 root  wheel  14456 Aug 13 04:51 rtquery
                            -r-xr-xr-x  1 root  wheel  22676 Aug 13 04:51 rtsol
                            -r-xr-xr-x  1 root  wheel  58056 Aug 13 04:51 setkey
                            -r-xr-xr-x  1 root  wheel    9668 Aug 13 04:51 sha1
                            -r-xr-xr-x  1 root  wheel    9668 Aug 13 04:51 sha256
                            -r-xr-xr-x  1 root  wheel  10700 Aug 13 04:51 shutdown
                            -r-xr-xr-x  1 root  wheel    7472 Aug 13 04:51 swapctl
                            -r-xr-xr-x  1 root  wheel    7472 Aug 13 04:51 swapoff
                            -r-xr-xr-x  1 root  wheel    7472 Aug 13 04:51 swapon
                            -r-xr-xr-x  1 root  wheel  14204 Aug 13 04:51 sysctl
                            -r-xr-xr-x  1 root  wheel  10500 Aug 13 04:51 tunefs
                            -r-xr-xr-x  1 root  wheel  14476 Aug 13 04:51 umount

                            @ Submicron, I am genuinely please yours is working for you but that doesn't change the fact that mine is not from a fresh install! It does not change the fact that there seems to be missing files IMHO.
                            Is it possible that yours is working  because you have upgraded from 1.1 or 1.2 or have another app installed and that is why you have the missing files?

                            Regards to all.

                            Author of pfSense themes:

                            DARK-ORANGE

                            CODE-RED

                            1 Reply Last reply Reply Quote 0
                            • N
                              nocer
                              last edited by

                              @cheesyboofs:

                              sudo mount_fdescfs fdescfs /dev/fd

                              sudo: Command not found.

                              Ooops, command not exist so you need to copy from another FreeBSD machine. However,

                              vi /etc/fstab

                              Device                Mountpoint      FStype  Options        Dump    Pass#

                              /dev/ad0s1a            /              ufs    rw              1      1
                              /dev/ad0s1b            none            swap    sw              0      0
                              fdescfs                /dev/fd        fdescfs rw              0      0
                              ~

                              :wq!

                              is quite a way of workaround(this forces to load fdescfs.ko which is a heart of mount_fdescfs command), as I said in previous post.
                              Now you're not seeing fd related errors at least and can ignore "/usr/local/etc/rc.d/spamd.sh: /sbin/mount_fdescfs: not found" message.

                              cheers,

                              1 Reply Last reply Reply Quote 0
                              • C
                                cheesyboofs
                                last edited by

                                Its still not playing ball and its quite frustrating because I have traphic shaping, openvpn and load-balancing working so this should be a walk in the park.

                                I fired up an old 6.2 VM (1.2-Release) and sure enough there are extra files, missing in 7 (1.2.1-BETA) So I copied over mount_fdescfs from 6.2 to 7,

                                But now I get another file missing!

                                /usr/local/etc/rc.d/spamd.sh restart

                                No matching processes were found
                                killall: warning: kill -TERM 25083: No such process
                                /libexec/ld-elf.so.1: Shared object "libc.so.6" not found, required by "mount_fdescfs"
                                whitelist whitelist 0 entries
                                blacklist blacklist 0 entries

                                What a right pain in the arse  :-\

                                Author of pfSense themes:

                                DARK-ORANGE

                                CODE-RED

                                1 Reply Last reply Reply Quote 0
                                • C
                                  cheesyboofs
                                  last edited by

                                  ls /lib

                                  geom                    libc.so.6               libmd.so.4
                                  libalias.so.6           libc.so.7               libncurses.so.7
                                  libalias_cuseeme.so     libcam.so.4             libncursesw.so.7
                                  libalias_dummy.so       libcrypt.so.4           libpcap.so.5
                                  libalias_ftp.so         libcrypto.so.5          libreadline.so.7
                                  libalias_irc.so         libdevstat.so.6         libsbuf.so.4
                                  libalias_nbt.so         libedit.so.6            libssp.so.0
                                  libalias_pptp.so        libgcc_s.so.1           libthr.so.3
                                  libalias_skinny.so      libgeom.so.4            libufs.so.4
                                  libalias_smedia.so      libipsec.so.3           libutil.so.7
                                  libbegemot.so.3         libkiconv.so.3          libz.so.4
                                  libbsdxml.so.3          libkvm.so.4
                                  libbsnmp.so.4           libm.so.5

                                  cat /etc/fstab

                                  Device                Mountpoint      FStype  Options         Dump    Pass#

                                  /dev/ad0s1a             /               ufs     rw              1       1
                                  /dev/ad0s1b             none            swap    sw              0       0
                                  fdescfs                 /dev/fd         fdescfs rw              0       0

                                  /usr/local/etc/rc.d/spamd.sh restart

                                  No matching processes were found
                                  killall: warning: kill -TERM 29643: No such process
                                  killall: warning: kill -TERM 29641: No such process
                                  whitelist whitelist 0 entries
                                  blacklist blacklist 0 entries

                                  I have now copied over libc.so.6 from 1.2-Release and now I get no errors but I'm also not getting any hits in my Spamd Database and no mails to exchange. I am getting hits on the firewall rule. please check my settings to confirm I'm not missing anything obvious.

                                  I have no NAT set up for port 25 because I'm asuming Spamd does that

                                  As you can see I have six mails coming in but none in the spamd database.

                                  1.jpg
                                  1.jpg_thumb
                                  2.jpg
                                  2.jpg_thumb
                                  3.jpg
                                  3.jpg_thumb
                                  4.jpg
                                  4.jpg_thumb

                                  Author of pfSense themes:

                                  DARK-ORANGE

                                  CODE-RED

                                  1 Reply Last reply Reply Quote 0
                                  • W
                                    wallabybob
                                    last edited by

                                    That your restart attempts on spamd seem to consistently report events like

                                    killall: warning: kill -TERM 96371: No such process

                                    suggests to me that one or two processes that the spamd restart is supposed to start are not staying running.

                                    An earlier reply showed

                                    rc_start() {
                                            /sbin/mount_fdescfs fdescfs /dev/fd
                                    /usr/local/sbin/spamd-setup -d &
                                    /sbin/pflogd &
                                    /usr/local/libexec/spamd  -G 25:4:864 -n "pfsense" -c 800 -B 700 -w 1 127.0.0.1 &
                                    /usr/local/libexec/spamlogd

                                    So after the spamd startup has completed spamd-setup, pflogd, spamd and spamlogd should have been started. I have only the vaguest knowledge of spamd so based only on conventions I have observed, I would expect pflogd, spamd and spamlogd to continue running in the background. An inspection of the stop function in /usr/local/etc/rc.d/spamd.sh should give clues to which processes should still be running. The ps command can then be used to check they are running. If you find any of the programs not running try starting it by typing the corresponding command in rc_start() - you might get some clues why the program didn't continue running. A few weeks ago I was chasing a problem with bandwidthd not staying running. It was only when I tried starting it by shell command that I discovered the problem was missing libraries.

                                    The name spamd-setup suggests spamd-setup might perform purely an initialisation function and so exit when it has completed that. But the rc_start() function starts a number of processes asynchronously. So what if spamd starts BEFORE spamd-setup has completed its initialisation? (This question can be difficult to answer. Sometimes clues are left in log files.) spamd might exit (even exit quietly) if it starts before necessary initialisation has completed. You might have this problem if everything starts and stays running when you start the programs individually by shell command but find that one or more programs don't stay running when started by /usr/local/etc/rc.d/spamd.sh

                                    1 Reply Last reply Reply Quote 0
                                    • C
                                      cheesyboofs
                                      last edited by

                                      Thanks for your response, I have done as you suggested and ran the commands manually to try and find out where it may be going wrong but am having trouble interpreting the results.

                                      cat /usr/local/etc/rc.d/spamd.sh

                                      #!/bin/sh

                                      This file was automatically generated

                                      by the pfSense service handler.

                                      rc_start() {
                                              /sbin/mount_fdescfs fdescfs /dev/fd
                                      /usr/local/sbin/spamd-setup -d &
                                      /sbin/pflogd &
                                      /usr/local/libexec/spamd  -G 25:4:864 -n "mail.cheeyboofs.co.uk" -c 800 -B 100 127.0.0.1 &
                                      /usr/local/libexec/spamlogd

                                      }

                                      rc_stop() {
                                              /usr/bin/killall spamd-setup
                                      /usr/bin/killall spamlogd
                                      /usr/bin/killall spamd
                                      /usr/bin/killall pflogd
                                      sleep 2
                                      }

                                      case $1 in
                                              start)
                                                      rc_start
                                                      ;;
                                              stop)
                                                      rc_stop
                                                      ;;
                                              restart)
                                                      rc_stop
                                                      rc_start
                                                      ;;
                                      esac

                                      –------------------------------------------------------

                                      /sbin/mount_fdescfs fdescfs /dev/fd

                                      /usr/local/sbin/spamd-setup -d &

                                      [1] 74419

                                      whitelist whitelist 0 entries

                                      blacklist blacklist 0 entries
                                      #/sbin/pflogd &
                                      [2] 74458
                                      [1]    Done
                                      #/usr/local/sbin/spamd-setup -d

                                      /usr/local/libexec/spamd  -G 25:4:864 -n "mail.cheeyboofs.co.uk" -c 800 -B 100 127.0.0.1 &

                                      [3] 74581
                                      [2]    Done
                                      #/sbin/pflogd

                                      /usr/local/libexec/spamlogd

                                      [3]  + Done
                                      #/usr/local/libexec/spamd -G 25:4:864 -n mail.cheeyboofs.co.uk -c 800 -B 100  …

                                      –------------------------------------------------------

                                      PID USERNAME  THR PRI NICE   SIZE    RES STATE    TIME   WCPU COMMAND
                                      1829 root        4  44   20  3596K  1088K select   0:55  0.00% slbd
                                      1675 root        1   8   20  3484K  1624K wait     0:25  0.00% sh
                                      1531 root        1   8   20  3132K   800K nanslp   0:07  0.00% check_reload_status
                                      1469 _ntp        1  44    0  3132K  1224K select   0:05  0.00% ntpd
                                        857 root        1   4    0 44824K 18140K accept   0:04  0.00% php
                                      1450 dhcpd       1  44    0  3132K  2140K select   0:04  0.00% dhcpd
                                        847 root        1   4    0  5072K  2828K kqread   0:03  0.00% lighttpd
                                        545 root        1  44    0  4892K  3460K select   0:02  0.00% openvpn
                                        452 root        1 -58    0  5696K  1848K bpf      0:01  0.00% tcpdump
                                        393 _dhcp       1  44    0  3132K  1264K select   0:01  0.00% dhclient
                                        316 _dhcp       1  44    0  3132K  1260K select   0:01  0.00% dhclient
                                        856 root        1   4    0 45848K 18380K accept   0:01  0.00% php
                                        924 nobody      1  44    0  3132K  1340K select   0:01  0.00% dnsmasq
                                      68801 root        1  44    0  7736K  3276K select   0:00  0.00% sshd
                                      1478 root        1   8    0  3212K  1256K nanslp   0:00  0.00% cron
                                      71932 root        1  44    0  7736K  3188K select   0:00  0.00% sshd
                                      1470 root        1  44    0  3132K  1216K select   0:00  0.00% ntpd
                                      68843 root        1  44    0  4912K  2292K select   0:00  0.00% sftp-server
                                      1533 root        1   8    0  3132K   888K nanslp   0:00  0.00% minicron
                                      70234 root        1  44    0  3240K  1272K select   0:00  0.00% syslogd
                                      72751 root        1  20    0  4524K  2380K pause    0:00  0.00% tcsh
                                        118 root        1  44    0  1888K   452K select   0:00  0.00% devd
                                        852 root        1   8    0 39704K  5236K wait     0:00  0.00% php
                                        853 root        1   8    0 39704K  5236K wait     0:00  0.00% php
                                      77733 root        1  44    0  3516K  1888K RUN      0:00  0.00% top
                                      1568 root        1   8    0  3488K  1448K wait     0:00  0.00% login
                                      1569 root        1   8    0  3488K  1448K wait     0:00  0.00% login
                                      72081 root        1  -8    0  3132K   772K piperd   0:00  0.00% sshlockout_pf
                                      72087 root        1   8    0  3484K  1336K wait     0:00  0.00% sh
                                      72088 root        1   8    0  3484K  1348K wait     0:00  0.00% sh
                                      68842 root        1   8    0  3484K  1324K wait     0:00  0.00% sh
                                      1572 root        1   5    0  3484K  1344K ttyin    0:00  0.00% sh
                                      77109 _spamd      1   8    0 13788K  4972K nanslp   0:00  0.00% spamd
                                      1573 root        1   5    0  3484K  1344K ttyin    0:00  0.00% sh
                                      1570 root        1   8    0  3484K  1336K wait     0:00  0.00% sh
                                      1571 root        1   8    0  3484K  1336K wait     0:00  0.00% sh
                                      77107 _pflogd     1 -58    0  3344K  1388K bpf      0:00  0.00% pflogd

                                      –------------------------------------------------------

                                      /usr/bin/killall spamd-setup

                                      No matching processes were found

                                      /usr/bin/killall spamlogd

                                      /usr/bin/killall spamd

                                      killall: warning: kill -TERM 74582: No such process

                                      /usr/bin/killall pflogd

                                      –------------------------------------------------------

                                      PID USERNAME  THR PRI NICE   SIZE    RES STATE    TIME   WCPU COMMAND
                                      1829 root        4  44   20  3596K  1088K select   0:55  0.00% slbd
                                      1675 root        1   8   20  3484K  1624K wait     0:26  0.00% sh
                                      1531 root        1   8   20  3132K   800K nanslp   0:07  0.00% check_reload_status
                                      1469 _ntp        1  44    0  3132K  1224K select   0:06  0.00% ntpd
                                        857 root        1   4    0 44824K 18140K accept   0:04  0.00% php
                                      1450 dhcpd       1  44    0  3132K  2140K select   0:04  0.00% dhcpd
                                        847 root        1   4    0  5072K  2828K kqread   0:03  0.00% lighttpd
                                        545 root        1  44    0  4892K  3460K select   0:02  0.00% openvpn
                                        452 root        1 -58    0  5696K  1848K bpf      0:01  0.00% tcpdump
                                        393 _dhcp       1  44    0  3132K  1264K select   0:01  0.00% dhclient
                                        316 _dhcp       1  44    0  3132K  1260K select   0:01  0.00% dhclient
                                        856 root        1   4    0 45848K 18380K accept   0:01  0.00% php
                                        924 nobody      1  44    0  3132K  1340K select   0:01  0.00% dnsmasq
                                      68801 root        1  44    0  7736K  3276K select   0:00  0.00% sshd
                                      1478 root        1   8    0  3212K  1256K nanslp   0:00  0.00% cron
                                      71932 root        1  44    0  7736K  3188K select   0:00  0.00% sshd
                                      1470 root        1  44    0  3132K  1216K select   0:00  0.00% ntpd
                                      68843 root        1  44    0  4912K  2292K select   0:00  0.00% sftp-server
                                      1533 root        1   8    0  3132K   888K nanslp   0:00  0.00% minicron
                                      70234 root        1  44    0  3240K  1280K select   0:00  0.00% syslogd
                                      72751 root        1  20    0  4524K  2380K pause    0:00  0.00% tcsh
                                        118 root        1  44    0  1888K   452K select   0:00  0.00% devd
                                        852 root        1   8    0 39704K  5236K wait     0:00  0.00% php
                                        853 root        1   8    0 39704K  5236K wait     0:00  0.00% php
                                      78295 root        1  44    0  3516K  1756K RUN      0:00  0.00% top
                                      1568 root        1   8    0  3488K  1448K wait     0:00  0.00% login
                                      1569 root        1   8    0  3488K  1448K wait     0:00  0.00% login
                                      72081 root        1  -8    0  3132K   772K piperd   0:00  0.00% sshlockout_pf
                                      72087 root        1   8    0  3484K  1336K wait     0:00  0.00% sh
                                      72088 root        1   8    0  3484K  1348K wait     0:00  0.00% sh
                                      68842 root        1   8    0  3484K  1324K wait     0:00  0.00% sh
                                      1572 root        1   5    0  3484K  1344K ttyin    0:00  0.00% sh
                                      1573 root        1   5    0  3484K  1344K ttyin    0:00  0.00% sh
                                      1570 root        1   8    0  3484K  1336K wait     0:00  0.00% sh
                                      1571 root        1   8    0  3484K  1336K wait     0:00  0.00% sh
                                        250 root        1  44    0  5020K  2812K select   0:00  0.00% sshd
                                        453 root        1  -8    0  3132K   728K piperd   0:00  0.00% logger

                                      –------------------------------------------------------

                                      And I can't seem to find out what

                                      spamd[73273]: /sbin/pfctl returned status 1

                                      means, is it a good thing or bad thing?

                                      Untitled-2.jpg
                                      Untitled-2.jpg_thumb

                                      Author of pfSense themes:

                                      DARK-ORANGE

                                      CODE-RED

                                      1 Reply Last reply Reply Quote 0
                                      • C
                                        cheesyboofs
                                        last edited by

                                        I have now given up on the Spamd package  :( I have found a free package to install on the exchange server its self that does the same thing and does it well JEP(S) http://www.proxmea.com/?q=node/19
                                        Cheers

                                        Author of pfSense themes:

                                        DARK-ORANGE

                                        CODE-RED

                                        1 Reply Last reply Reply Quote 0
                                        • W
                                          wallabybob
                                          last edited by

                                          I'll add an explanation in italics for some of the things you saw.

                                          @cheesyboofs:

                                          Thanks for your response, I have done as you suggested and ran the commands manually to try and find out where it may be going wrong but am having trouble interpreting the results.

                                          /sbin/mount_fdescfs fdescfs /dev/fd

                                          /usr/local/sbin/spamd-setup -d &

                                          [1] 74419
                                          The & on the end of the command causes it to run in the background without the shell waiting for it to complete. The command runs in process 74419

                                          whitelist whitelist 0 entries

                                          blacklist blacklist 0 entries
                                          #/sbin/pflogd &
                                          [2] 74458
                                          [1]    Done
                                          process 74419 has exited: spamd-setup has completed
                                          #/usr/local/sbin/spamd-setup -d

                                          /usr/local/libexec/spamd  -G 25:4:864 -n "mail.cheeyboofs.co.uk" -c 800 -B 100 127.0.0.1 &

                                          [3] 74581
                                          spamd is running in process 74581
                                          [2]    Done
                                          pflogd has exited. This is suspicious. Perhaps there was already a pflogd running.
                                          #/sbin/pflogd
                                          Run pflogd, this time wait for its completion.

                                          /usr/local/libexec/spamlogd

                                          Now that the previous command (pflogd) has completed run spamlogd and wait for its completion.
                                          [3]  + Done
                                          process 74581, spamd,  has completed
                                          #/usr/local/libexec/spamd -G 25:4:864 -n mail.cheeyboofs.co.uk -c 800 -B 100  …

                                          And I can't seem to find out what

                                          spamd[73273]: /sbin/pfctl returned status 1

                                          means, is it a good thing or bad thing?

                                          It probably means pfctl exited with status 1 which could be a status unique to pfctl or it could be pfctl reporting that it got an unexpected error return status 1 (EPERM, permission error) from a system call.

                                          As I suspected spamd is exiting rather than continuing to run in the background. If you wanted to explore this further you could consult the spamd manual page by typing spamd into the man page or keyword search box at http://www.openbsd.org/cgi-bin/man.cgi (spamd came to FreeBSD from OpenBSD) and look for the command options for getting more output from spamd). If you don't already know your way around a Unix system you probably have a fair bit of learning if you want to pursue this further.

                                          1 Reply Last reply Reply Quote 0
                                          • I
                                            iced98lx
                                            last edited by

                                            @cheesyboofs:

                                            I have now given up on the Spamd package  :( I have found a free package to install on the exchange server its self that does the same thing and does it well JEP(S) http://www.proxmea.com/?q=node/19
                                            Cheers

                                            what's the free version lacking over the paid version? (out of curiosity, run an exchange box as well)

                                            1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post
                                            Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.