How can I send Spam to Spam folder?

Discussion in 'HOWTO-Related Questions' started by 3rods, Oct 3, 2010.

  1. 3rods

    3rods New Member

    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.

    Code:
    $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:

    Code:
    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:[127.0.0.1]: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 = 127.0.0.0/8
    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/mysql-virtual_transports.cf
    virtual_alias_domains =
    virtual_alias_maps = proxy:mysql:/etc/postfix/mysql-virtual_forwardings.cf, mysql:/etc/postfix/mysql-virtual_email2email.cf
    virtual_gid_maps = static:5000
    virtual_mailbox_base = /home/vmail
    virtual_mailbox_domains = proxy:mysql:/etc/postfix/mysql-virtual_domains.cf
    virtual_mailbox_maps = proxy:mysql:/etc/postfix/mysql-virtual_mailboxes.cf
    virtual_uid_maps = static:5000
    
    
     
  2. falko

    falko Super Moderator Howtoforge Staff

  3. 3rods

    3rods New Member

    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?

    *domain.com maildrop
    *otherdomain.com [1.2.3.4]:25
    etc?

    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.
     
  4. falko

    falko Super Moderator Howtoforge Staff

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

Share This Page