1. Please take a little time for this simple survey! Thank you for participating!
    Dismiss Notice
  2. Dear Pleskians, please read this carefully! New attachments and other rules Thank you!
    Dismiss Notice
  3. Dear Pleskians, I really hope that you will share your opinion in this Special topic for chatter about Plesk in the Clouds. Thank you!
    Dismiss Notice

Spam folders and extension addresses

Discussion in 'Plesk for Linux - 8.x and Older' started by rubenmv, Apr 30, 2007.

  1. rubenmv

    rubenmv Guest

    Hi all:

    I'm on the first week as a plesk 8.1 user, and boy do I have problems :-(

    First off, I'm migrating from a postfix+kitchen sink, lovely handcrafted mail system that took me ages to set up, does that job and has a few perks that I like a lot. (I'm migrating away from that because I think a control panel even though uglier, might help me do things faster and easier)

    The two killer features I have are:
    • Extension addresses server-wide
    • Spam folders, server and domain wide

    Both of this things are tightly coupled with the MTA and it's delivery mechanism. I've done both with qmail and more recently with postfix.

    So the question to you all: How can I implement both spam folders ( quarantined spam messages as decided by SpamAssassin) and extension addresses (delivery of messages sent to user@domain AND user-whatever at the same Maildir) ? ** IN PLESK OF COURSE **

    Thanks in advance
  2. agriffiths

    agriffiths Guest

    Wow, something must be in the water because I'm in exactly the same boat. I'm moving many accounts to a plesk server; the users have used extension addresses for years so disabling them now would be painful. If anyone has any ideas on how to implement this in plesk I'd love to hear from you.
  3. rubenmv

    rubenmv Guest


  4. Yogananda

    Yogananda Guest


    Hi Guys,

    I do have the same problem. New with Plesk and seems like I have not much luck with SpamAssassin.
    Are there any tricks or real manuals that explain things in this world?

    Thank you!!!
  5. servertune

    servertune Guest

    Re: SpamAssassin

    I am not sure if this KB will help: http://kb.swsoft.com/category123.php
  6. Yogananda

    Yogananda Guest

    Thanks ServerTune

    Thank you ServerTune, I believe this is exactly what I need:


    It is mention right at the end: using Bayes Bases for all mailboxes using the rules of one mailbox that I personal can train.
    Our aim is to have all our users lighten up from the burden to make themselves rules. So in this way I can make rules from a single mailbox and have them apply to everyone.

    Now I just have to ask to my team-mate who has the codes to access low-level. I hope is not too complicate.

    Can I ask you a small favor? Could you kindly read the thread I mention above and let me know if it would work for this specific case?

    You are really kind and I thank you so much

    Joy to you!
  7. rubenmv

    rubenmv Guest

    Re: Re: SpamAssassin


    I'm still looking as to how to separate the spam msgs from the ham, *before* the user opens her MUA

    Qmail in plesk acts really weird, i've been changing every combination of /var/qmail/users/assign, and /var/qmail/mailnames/DOMAIN/{.qmail, .qmail-default} as well as /var/qmail/mailnames/DOMAIN/USER/{.qmail,.qmail-default} with no success.

    I can't receive msgs in USER-FOO@DOMAIN, and I can't find the place where to tell procmail to route spam msgs to a given maildir.

  8. servertune

    servertune Guest

    These documents show HowTo train SA to sort our ham from spam:
    - Wiki

    - SWsoft

    It is unfortunate that there is no feature in the current Plesk to train SA. This should be done manually from the command line in the following way.

    1. Store SPAM and HAM messages in two different folders, for example 'spam_mails' and 'ham_mails'.

    2. Train Spamassassin for one mailbox using the messages from that folders:

    # cd /path/to/spam_mail/
    # for message in * ; do /usr/local/psa/admin/sbin/spammng --bayes --mailname=mailname@domain.com --spam=$message ; done
    # cd /path/to/ham_mail/
    # for message in * ; do /usr/local/psa/admin/sbin/spammng --bayes --mailname=mailname@domain.com --ham=$message ; done

    3. Then repeat this command for every mailbox on the server or just copy bayes bases (./domain.com/mailname/.spamassassin/bayes_*) from this mailbox to each other.

    I suggest you read these threads for more information about SA tarining:


    Another way to train Spamassassin is to upload spam filter rules manually from: http://www.rulesemporium.com/rules.htm

    You need to put them in:

    FYI, psa-spamassassin provides the Plesk GUI for SpamAssassin

    To verify that spamassassin is indeed tagging messages as spam, send an email with the following in the body. This should be put all on one line without out any whitespace or page breaks:

    This should be marked with a spam score of 1000.
  9. rubenmv

    rubenmv Guest

    Yes, I know there's a way to mark spam and ham messages and that there's a way to train SA to recognize them into a bayes database.

    BUT what I want is to *sort* spam into a user/Spam maildir and ham into user/Maildir automatically .

    This allows the user to browse through her mailbox and move any messages that didn't got marked by SA (false negatives) into the Spam folder. Same thing with false positives (ham marked wrongly as spam)

    On top of this, I also want that any message sent to USER-FOO@DOMAIN, and also USER-BAR@DOMAIN get received by Qmail, and processed in the same way as USER@DOMAIN

    Both of this requirements are normal features of Qmail, that doesn't work on Plesk :-(

  10. Yogananda

    Yogananda Guest

    Many Thanks!

    Dear Servertune,

    thank you very much for your kindness. I will try to do my best to follow your precious advices.
    Hopefully my poor users won't be strangled by these unwanted messages anymore. It really start to be an overwhelming situation.
    I wish I could help you back somehow, so to repay your kindness.

    Joy to you
  11. agriffiths

    agriffiths Guest

    I managed to get extension addresses to work by replacing Plesk's smtpd with qpsmtpd (which I wanted anyway). qpsmtpd does use the correct entry in the users/cdb database, although Plesk overwrites users/assign when you add a new user.

    To get around this I manually add the extension stuff in a seperate file. I moved qmail-newu to qmail-newu-plesk and replaced it with a script that moves the assign file, cats the users/extension file and the assign file and runs qmail-newu-plesk.

    That seems to work with a couple of exceptions. First, new users don't get extension addresses automatically, although you can do that in a script as well if you'd like.

    I'm also only running qpsmtpd on port 25, so TLS connections don't support extension addresses. That's OK for me although others may want to run qpsmtpd with TLS.
  12. agriffiths

    agriffiths Guest

    Oh, I should have mentioned. I suspect, but I'm not sure, that plesk compiiled qmail's smtpd without extension support. That's probably why it doesn't work out of the box.