First, thanks to the CentOS folks for creating such as awesome distro! Second, thanks to all for contributing to such an great mailling list!
I installed MailScanner/SpamAssassin/ClamAV last week based on the excellent threads that have recently discussed the subject. For folks who missed it, I used Johnny's wonderful guide at http://www.hughesjr.com/content/category/1/14/30/Guides (see Part 4).
I'm using CentOS 3.4. On the MTA side, I am using Postfix with a virtual alias table. I want to have MailScanner use the "forward" "Spam Actions" option to put all spam in a central email account (it's a local account on the same server). I can email to this central spam account no problem (both locally and from outside accounts such as gmail). The "Spam Actions = forward blah@blah.com" works if blah@blah.com is an account on a separate system (such as this account on gmail). However, no matter what I do, I cannot make it work with a local account -- I always get the following postfix error in /var/log/maillog:
..., status=bounced (user unknown in virtual alias table).
I'm guessing it has something to do with the fact that I'm using a virtual alias table, but I don't want to get rid of that (even for testing purposes) because it's obviously being used for live email. :-)
I know this might be more of a Postfix or MailScanner question, but I thought I would start here.
Many thanks for any assistance! Kennedy
You would do well to post this question on the MailScanner list as the audience is all MailScanner users and have probably seen this problem before.
Mike
-----Original Message----- From: centos-bounces@centos.org [mailto:centos-bounces@centos.org] On Behalf Of Kennedy Clark Sent: Thursday, April 07, 2005 9:30 AM To: CentOS mailing list Subject: [CentOS] MailScanner SPAM Forward & Postfix Problem
First, thanks to the CentOS folks for creating such as awesome distro! Second, thanks to all for contributing to such an great mailling list!
I installed MailScanner/SpamAssassin/ClamAV last week based on the excellent threads that have recently discussed the subject. For folks who missed it, I used Johnny's wonderful guide at http://www.hughesjr.com/content/category/1/14/30/Guides (see Part 4).
I'm using CentOS 3.4. On the MTA side, I am using Postfix with a virtual alias table. I want to have MailScanner use the "forward" "Spam Actions" option to put all spam in a central email account (it's a local account on the same server). I can email to this central spam account no problem (both locally and from outside accounts such as gmail). The "Spam Actions = forward blah@blah.com" works if blah@blah.com is an account on a separate system (such as this account on gmail). However, no matter what I do, I cannot make it work with a local account -- I always get the following postfix error in /var/log/maillog:
..., status=bounced (user unknown in virtual alias table).
I'm guessing it has something to do with the fact that I'm using a virtual alias table, but I don't want to get rid of that (even for testing purposes) because it's obviously being used for live email. :-)
I know this might be more of a Postfix or MailScanner question, but I thought I would start here.
Many thanks for any assistance! Kennedy _______________________________________________ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
I spoke to some very helpful folks on the MailScanner list (especially Drew) and they sorted me out. I thought I would share in case others run into this problem. First, MailScanner apparently occurs AFTER the postfix virtual mapping takes place... so you have to use the /etc/postfix/aliases vs /etc/postfix/virtual_alias.
Next problem: I had to get /etc/postfix/aliases working together with the /etc/postfix/virtual_alias table. After banging my head on the wall for about a day, the answer was embarrassingly simple. You can't have the same domain in the main.cf variable 'mydestination =' (sends domains in this list to /etc/postfix/aliases) and 'virtual_alias_domains =' (sends these domains to the /etc/postfix/virtual_alias table). So, I did this to create a "fake" subdomain of sample1.com:
/etc/MailScanner/MailScanner.conf Spam Actions = store forward spam@localhost.sample1.com High Scoring Spam Actions = store forward spam@localhost.sample1.com
/etc/postfix/main.cf myhostname = svr.sample1.com mydomain = sample1.com mydestination = $myhostname, localhost.$mydomain virtual_alias_domains = sample1.com, sample2.org
/etc/postfix/virtual_alias joe@sample1.com joeb@localhost joe@sample2.org joeb@localhost bob@sample1.com bob@localhost @sample2.org frank@localhost group1@sample1.com joeb@localhost, bob@localhost, bob@localhost ...
/etc/postfix/alias # Deliver spam to local 'spam' shell account spam@localhost.sample1.com: spam
The trick was using spam@LOCALHOST.sample1.com in both MailScanner.conf AND /etc/postfix/alias (along with having this subdomain of sample1.com listed in mydestination of postfix). These 3 items together allowed local delivery without the virtual_alias stuff getting in the way. MailScanner was now happy and the spam forward worked.
Let me know if folks see a better way of doing this.
Kennedy