Page 1 of 2 12 LastLast
Results 1 to 10 of 16
  1. #1

    Default spamassassin and alias

    spamassassin won't process e-mail for alias accounts. I know this.

    However, has anyone done a workaround. Redirects? .forwards? etc. Anyideas?

  2. #2
    Senior Member FZ's Avatar
    Join Date
    May 2003
    Location
    Johannesburg, South Africa
    Posts
    1,024

    Default

    Ahhh, the wonders of Procmail. If you don't mind getting your hands dirty with some code, and losing GUI functionality/managability for the specific e-mail aliases you want SpamAssassin to work with, you could remove the aliases from the Site Manager, enable catch-all, and then use Procmail to manually forward mail sent to specific addresses (doing so only after the mail has passed through SpamAssassin).
    Fayez Zaheer

  3. #3
    Senior Member jalal's Avatar
    Join Date
    May 2003
    Location
    Germany
    Posts
    1,377

    Default

    Is it true?

    One of my aliases gets passed through SpamAssassin, I haven't really checked other cases, but now I will do.

  4. #4

    Default

    FZ, thanks. I thought about the procmail idea too, but was hoping I didn't think of something simplier. I guess there isn't another way around. Procmail is a great tool, ain't it!

  5. #5
    Senior Member FZ's Avatar
    Join Date
    May 2003
    Location
    Johannesburg, South Africa
    Posts
    1,024

    Default

    Procmail rocks
    Fayez Zaheer

  6. #6

    Default

    FZ, I setup the procmail solution with a catchall, etc. etc, but that doesn't seem to work.

    Anyone else get it to work. It seems that procmail is handling prior to spamassassin taking a look at the messages.

  7. #7

    Default

    nevermind. I guess it does work. I had prodmail running Spamassassin last, which I am surprised I did not notice first time.

  8. #8
    Senior Member dansroka's Avatar
    Join Date
    Nov 2003
    Location
    New Jersey
    Posts
    177

    Default

    A couple newbie questions:

    (1) Why doesn't spamassassin process mail sent to an alias? Since the email forwards to a valid email account, wouldn't it then be processed by procmail, just like an email send directly to that account?

    I'd rather not have the catch-all enabled. I still have the possibly-naive hope that spam sent to invalid-email addresses will generate an invalid-email error, which will deter those spammers from trying those addresses again. Silly I know, but a guy can dream.

    (2) If I enable the catch-all, can someone point to a template recipe that will forward my desired aliases, but discard all other aliases (to avoid spam sent to random email addresses).

    Merci.
    Dan

  9. #9
    Senior Member FZ's Avatar
    Join Date
    May 2003
    Location
    Johannesburg, South Africa
    Posts
    1,024

    Default

    1. As far as I know, if you are using mail forwarding added via the Site Manager, it is added at the "Sendmail level" (see the files in /etc/mail/), which means it is processed BEFORE Procmail recipes. The procmailrc file in /etc/ is where the pipe to SpamAssassin is specified, so naturally, mail never "reaches" this stage if being forwarded.

    As for the invalid e-mail address thing, I question how effective this solution is. First of all, in my experience (3 years of 100 spam e-mails a day) spammers never send to random addresses - they always send to addresses that have been harvested from somewhere (most likely indexed, etc.) So, that's the first problem. Another problem is that spammers never use real e-mail addresses anyway - I mean think about it, the accounts they use (if real at all) would get shut down in a matter of hours/days anyway (for having spammed people). And it isn't as if they really check their e-mail to see if someone replied complimenting their marketing abilities! If bouncing is what you want to do, you can do it without sacrificing your catch-all (but you have to specify which To: addresses you want mail bounced for), have a look at this: http://forums.westhost.com/phpBB2/viewtopic.php?t=732

    2. As for an example recipe, here goes (don't think I understand exactly what it is you want to do):

    Code:
    :0:
    * ! ^TO_firstusername
    * ! ^TO_secondusername
    * ! ^TO_AndSoOn
    /dev/null
    That will delete all mail that is not addressed (To:, CC: or BCC to firstusername, secondusername and "AndSoOn". If you were literally talking about fowarding addresses, then read the above - Procmail will not "receive" that mail to process. However, you can always remove the forwarding from your Site Manager, and then use Procmail to manually forward this mail (that way you can run SpamAssassin on it, and do whatever filtering you need to) - the end result would be the same, except that it would pass through the "Sendmail level" and onto the "Procmail level" giving you more control.
    Fayez Zaheer

  10. #10
    Senior Member dansroka's Avatar
    Join Date
    Nov 2003
    Location
    New Jersey
    Posts
    177

    Default

    As always, thank you for your help and explanations. Hmm, I think I am starting to understand this a little more! So let's see -- there are different ways of creating aliases. While they both have the same end-result, I assume that you chose between the methods based on your specific needs:

    (1) Setting it up at the sendmail-level (like by Site Manager) is probably best for email that is being sent to completely different email addresses on another server (email not handled via your Westhost account). (E.g. I have email aliases for my family, so that their email gets immediately forwarded to their personal POP email accounts.) It gets rid of the email before your Westhost server has to do much work.

    (2) Whereas having an alias set up at the procmail level gives you certain advantages (better fine-tuned filtering, spamassassin, etc.), although it means your server has to process more data. This is probably best for "synonym" email addresses -- variations on spelling, etc all going to the same person (e.g. dan@, daniel@, president@, webmaster@).

    Thanks for the recipe. I found some online resources, so I'll need to do a little studying to get the grammar down and fine-tune it for my needs.

    Regarding the spam, I do get some spam to general email addresses, like "info@", that spammers assume may be valid. But you are right, it probably isn't as great as I assume. And I doubt that spammers spend any resources clearing out invalid email addresses from their lists -- it just isn't cost-effective for them to do it.

    Thanks.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •