Spam Control — CyberPanel - WebHosting Control Panel for OpenLiteSpeed
CyberHosting

Spam Control

Hi i am little bit confuse about SpamAssassin about below line
Smtp inet n - n - - smtpd When i insert that line mail work but spam not work

and when i insert
spamassassin unix - n n - - pipe flags=R user=spamd argv=/usr/bin/spamc -e /usr/sbin/sendmail -oi -f ${sender} ${recipient}

Mail not coming which line work better


Please help me

Tagged:
Tagged:

Comments

  • The first line is amended if it's not already to show like
    smtp inet n - n - - smtpd -o content_filter=spamassassin

    then at the bottom is where the second line goes.
    spamassassin unix - n n - - pipe flags=R user=spamd argv=/usr/bin/spamc -e /usr/sbin/sendmail -oi -f ${sender} ${recipient}


    Here's an example of the full file. Note line number 11 and 130
    https://pastebin.com/DgeUPWnk

    then after
    service postfix restart

    check its working
  • Just in case anyone else runs into this on Centos7 OpenVZ

    Seems the default install does not work at least on the OP one which we finally got working.


    If you get this message but are not seeing the email in the inbox and permissions and everything else is right:
    delivered via spamassassin service)

    Open config file and change the below line
    nano /etc/postfix/master.cf

    From:
    spamassassin unix - n n - - pipe flags=R user=spamd argv=/usr/bin/spamc -e /usr/sbin/sendmail -oi -f ${sender} ${recipient}

    To:
    spamassassin unix - n n - - pipe flags=DROhu user=vmail:vmail argv=/usr/bin/spamc -f -e /usr/libexec/dovecot/deliver -f ${sender} -d ${user}@${nexthop}

    If this is on Ubuntu and your getting that error the line might need to be using the Ubuntu lib path of /usr/lib/dovecot/deliver
    spamassassin unix - n n - - pipe flags=DROhu user=vmail:vmail argv=/usr/bin/spamc -f -e /usr/lib/dovecot/deliver -f ${sender} -d ${user}@${nexthop}

    service dovecot restart && service postfix restart && service spamassassin restart;
    service dovecot status && service postfix status && service spamassassin status;

    Hopefully, that fixes the issue.


    Optional things that might be needed that we did try during debugging.

    If you get this error:
    spamc[7957]: connect to spamd on ::1 failed, retrying (#1 of 3): Connection refused

    Disable IPv6:
    Append below lines in /etc/sysctl.conf:
    nano /etc/sysctl.conf
    net.ipv6.conf.all.disable_ipv6 = 1
    net.ipv6.conf.default.disable_ipv6 = 1

    To make the settings affective, execute :
    sysctl -p


    Add missing spamd user:
    groupadd spamd
    useradd -g spamd -s /bin/false -d /var/log/spamassassin spamd
    chown spamd:spamd /var/log/spamassassin
    service spamassassin restart


    Create this file with the below value to ensure spamd listening on localhost
    [[email protected] ~]# cat /etc/mail/spamassassin/spamc.conf
    -d 127.0.0.1
    [[email protected] ~]#

  • Thanks whattheserver this notes lot of work me
  • I have ubuntu and new to cyberpanel, I have the settings in order that deletes the spam directly from server

    required_hits 5.0
    report_safe 1
    rewrite_header Subject [SPAM]
    required_score 5

    however the messages marked as spam are coming to my inbox,any solution
  • Type your comment> @whattheserver said:
    > Just in case anyone else runs into this on Centos7 OpenVZ
    >
    > Seems the default install does not work at least on the OP one which we finally got working.
    >
    >
    > If you get this message but are not seeing the email in the inbox and permissions and everything else is right:
    > delivered via spamassassin service)
    >
    > Open config file and change the below line
    > nano /etc/postfix/master.cf
    >
    > From:
    > spamassassin unix - n n - - pipe flags=R user=spamd argv=/usr/bin/spamc -e /usr/sbin/sendmail -oi -f ${sender} ${recipient}
    >
    > To:
    > spamassassin unix - n n - - pipe flags=DROhu user=vmail:vmail argv=/usr/bin/spamc -f -e /usr/libexec/dovecot/deliver -f ${sender} -d ${user}@${nexthop}
    >
    > If this is on Ubuntu and your getting that error the line might need to be using the Ubuntu lib path of /usr/lib/dovecot/deliver
    > spamassassin unix - n n - - pipe flags=DROhu user=vmail:vmail argv=/usr/bin/spamc -f -e /usr/lib/dovecot/deliver -f ${sender} -d ${user}@${nexthop}
    >
    > service dovecot restart && service postfix restart && service spamassassin restart;
    > service dovecot status && service postfix status && service spamassassin status;
    >
    > Hopefully, that fixes the issue.
    >
    >
    > Optional things that might be needed that we did try during debugging.
    >
    > If you get this error:
    > spamc[7957]: connect to spamd on ::1 failed, retrying (#1 of 3): Connection refused
    >
    > Disable IPv6:
    > Append below lines in /etc/sysctl.conf:
    > nano /etc/sysctl.conf
    > net.ipv6.conf.all.disable_ipv6 = 1
    > net.ipv6.conf.default.disable_ipv6 = 1
    >
    > To make the settings affective, execute :
    > sysctl -p
    >
    >
    > Add missing spamd user:
    > groupadd spamd
    > useradd -g spamd -s /bin/false -d /var/log/spamassassin spamd
    > chown spamd:spamd /var/log/spamassassin
    > service spamassassin restart
    >
    >
    > Create this file with the below value to ensure spamd listening on localhost
    > [[email protected] ~]# cat /etc/mail/spamassassin/spamc.conf
    > -d 127.0.0.1
    > [[email protected] ~]#

    I had the same spamd error in my stock CentOS 8 image. You will need to ensure with future CyberPanel releases that the following is in sysctl.conf. This comes from this post above.

    ---

    If you get this error:
    spamc[7957]: connect to spamd on ::1 failed, retrying (#1 of 3): Connection refused

    Disable IPv6:
    Append below lines in /etc/sysctl.conf:
    nano /etc/sysctl.conf
    net.ipv6.conf.all.disable_ipv6 = 1
    net.ipv6.conf.default.disable_ipv6 = 1

    To make the settings affective, execute :
    sysctl -p

    ---

    My CentOS 8's sysct.conf already had net.ipv6.conf.all.disable_ipv6 = 1, but was missing net.ipv6.conf.default.disable_ipv6 = 1. You may want to add a check for this in future CyberPanel release because it was causing my emails to take about 6 minutes to get received and delivered from the time they were sent by the sending server.
  • > @hennaboy said:
    > But what if you are installing and require it enabled?
    >
    > Disable ipv6 is individual requirement.

    That is incorrect. Due to some misconfiguration, having IPv6 enabled causes Postfix to fail to properly pipe incoming mail through SpamAssassin. The result is the error message above that states a connection refusal. It will continue doing this for three attempts which amounts to 5-7 minutes before each email message will get delivered. Further, this causes the email server to have an added processing load from messages queuing up that fail to go through SpamAssassin. The biggest problem with this bug is SpamAssassin never will see these emails and therefore no email spam filtering ever actually occurs. You can call this an individual requirement, but most people install SpamAssasssin and they don't want their email delayed and their email server overloaded.
  • > @hennaboy said:
    > Ive used IPv6 on one of my servers without this issue.
    >
    > Unless you can come back and give exact errors then it may be just isolated to your own setup which again brings it back to individual requirement and issue.
    >
    > So, I still stand by my statement that this is an individual requirement and it should not be disabled as default.
    >
    >

    @hennoboy, if you are building just to your server, then everyone is going to have issues. The issue is repeatable on Contabo, a very highly used VPS service. The fact this issue has reported by numerous users does not call this an individual requirement, but lays bare that it is a widespread issue that deserves direct attention.

    Repeatedly telling people that that "it works on my system," is not appropriate remedial procedure. It just tells us you do not want to be bothered and you are more interested in supporting just your own system and no one else's. I would urge you to ask more probing questions than simply defaulting to the answer "oh, it works for me."
  • edited October 6
    > I don't post for post count or to promote my signature. If that is your implication I can remove my signature and still say exactly the same.

    I understand you do this on a voluntary basis and users including myself are extremely grateful when you proactively contribute. However, it is like trying to squeeze blood out of a turnip when you say more or less "oh, but it works on my setup" in many threads and you effectively shut the door on the conversation when you do. The point often is that it doesn't work on other people's setups in many circumstances, and your telling us your setup works doesn't make our setups work.

    The actual solution requires some fine-tuning, maybe even a mere line of code being tweaked to suit the circumstance, and it also requires some back and forth in conversation. Asking clarifying questions like "What VPS host are you running it on?" or "Can you provide me some IP configuration information by running the following command?" would go a long way to remediate.

    Now, I understand you want to help and that is commendable, but such default responses can come off like you are on the defensive and you just want to prove that you are right. I also understand that it can be tiring at times when users miss what you may think is something so basic. But we are not experts in everything and that includes technical professionals like myself who do hosting as a hobby.

    Believe it or not, Einstein had no idea what a beans plant was when a fellow physicist showed it to him, meaning Einstein did not know beans! At the end of the day, even if you are doing this as a volunteer service (and thank you again for it), you still have to point people in the right direction. We do not know what you are thinking in your head--we aren't mind readers, after all--so a little engagement would do wonders.
  • edited October 6
    > @hennaboy said:
    >
    > Unless you can come back and give exact errors then it may be just isolated to your own setup which again brings it back to individual requirement and issue.
    >

    I already stated the exact error but here it is directly from above:

    > If you get this error:
    > spamc[7957]: connect to spamd on ::1 failed, retrying (#1 of 3): Connection refused

    I understand your confidence in CyberPanel and I readily agree: it is marvelous software. But let's be realistic, please, and troubleshoot. Every software solution can be improved.
Sign In or Register to comment.
CyberPanel Discord

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!