HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (
-   HOWTO-Related Questions (
-   -   How can I send Spam to Spam folder? (

3rods 3rd October 2010 23:06

How can I send Spam to Spam folder?
I'm running the Virtual Users And Domains With Postfix, Courier, MySQL And SquirrelMail (Ubuntu 10.04) as a mail server and I'd like to have a way to send spam emails to INBOX.Spam for virtual users.

All of my config files are unchanged from the example, except I have not installed squirrelmail. I've done some research in the areas of Amavis and maildrop; however, I'm at a loss as to how to tie everything together.

I've added the following to /etc/amavis/conf.d/50-user, but I'm not sure where to go from here.


$addr_extension_spam  = 'spam';
$recipient_delimiter = '+';
$final_spam_destiny      = D_PASS;  # (defaults to D_REJECT) D_DISCARD

Since this configuration uses virtual users defined in MySQL, it's confusing me - at what point do I need to redirect spam?

If someone could give me a overview of what I need to do, I can look at the man pages and google the rest. I'm just not sure what the implementation needs to be.

Here is a postconf -n:


alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
append_dot_mydomain = no
biff = no
broken_sasl_auth_clients = yes
config_directory = /etc/postfix
content_filter = amavis:[]:10024
html_directory = /usr/share/doc/postfix/html
inet_interfaces = all
mailbox_size_limit = 0
message_size_limit = 20480000
mydestination = mail.[DOMAIN].com, localhost, localhost.localdomain
myhostname = mail.[DOMAIN].com
mynetworks =
myorigin = /etc/mailname
proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $virtual_mailbox_maps $virtual_mailbox_domains $relay_recipient_maps $relay_domains $canonical_maps $sender_canonical_maps $recipient_canonical_maps $relocated_maps $transport_maps $mynetworks $virtual_mailbox_limit_maps
readme_directory = /usr/share/doc/postfix
receive_override_options = no_address_mappings
recipient_delimiter = +
relayhost =
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
smtpd_recipient_restrictions = check_recipient_access hash:/etc/postfix/protected_destinations, permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination
smtpd_restriction_classes = insiders_only
smtpd_sasl_auth_enable = yes
smtpd_sasl_authenticated_header = yes
smtpd_tls_cert_file = /etc/postfix/smtpd.cert
smtpd_tls_key_file = /etc/postfix/smtpd.key
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtpd_use_tls = yes
transport_maps = proxy:mysql:/etc/postfix/
virtual_alias_domains =
virtual_alias_maps = proxy:mysql:/etc/postfix/, mysql:/etc/postfix/
virtual_gid_maps = static:5000
virtual_mailbox_base = /home/vmail
virtual_mailbox_domains = proxy:mysql:/etc/postfix/
virtual_mailbox_maps = proxy:mysql:/etc/postfix/
virtual_uid_maps = static:5000

falko 4th October 2010 18:59

I have to admit I haven't tried them, but maybe these links give you some hints:

3rods 4th October 2010 19:05

Keeping the vmail configuration in mind from the tutorial, would I just add a line in the mysql DB (transports) to redirect all mail to maildrop?

* maildrop
* []:25

I think once I get it there, I can script actions to send it to the right mailbox. Getting it to that point is half the battle.

falko 5th October 2010 19:19

To be honest I've never tried that, so I'm afraid I'm not a big help here... :(

All times are GMT +2. The time now is 01:23.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.