LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Postfix + Procmail + Wild Card Subdomains with local delivery (https://www.linuxquestions.org/questions/linux-server-73/postfix-procmail-wild-card-subdomains-with-local-delivery-4175438396/)

sushantchawla2005 11-23-2012 01:51 AM

Postfix + Procmail + Wild Card Subdomains with local delivery
 
Dear All Experts,

I am trying to solve a problem from the last weeks but having no luck so far.

I am required to:

+ Host postfix mail server for incoming mails only with approx. 10 domains & their subdomains which must accept wild card subdomains.

+ Second is with wild card subdomains there comes a lot of spams, so I need to filter spam through spamassassin & place the spam mails in different folder of the respective email accounts say Spam which as per my knowledge is only possible with local delivery of mails handled by some MDA like procmail, etc??

Now I am able to setup one part of the server i,e postfix accepting mails from specified domains (not wild card) & filter through spamassassin & place the mails in respective folders with procmail.

I am getting stuck with other part now i,e accepting wild card subdomains with this setup.

My postfix main.cf file looks like this:

smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
biff = no
append_dot_mydomain = no
# TLS parameters
smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
smtpd_use_tls=yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
myhostname = testserver
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = pcre:/etc/postfix/virtual/vdomains
virtual_maps = hash:/etc/postfix/virtual/addresses
relayhost =
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
home_mailbox = Maildir/
mailbox_command = /usr/bin/procmail -a "$EXTENSION"
My postfix master.cf file looks like this:

smtp inet n - - - - smtpd
pickup fifo n - - 60 1 pickup
cleanup unix n - - - 0 cleanup
qmgr fifo n - n 300 1 qmgr
tlsmgr unix - - - 1000? 1 tlsmgr
rewrite unix - - - - - trivial-rewrite
bounce unix - - - - 0 bounce
defer unix - - - - 0 bounce
trace unix - - - - 0 bounce
verify unix - - - - 1 verify
flush unix n - - 1000? 0 flush
proxymap unix - - n - - proxymap
proxywrite unix - - n - 1 proxymap
smtp unix - - - - - smtp
relay unix - - - - - smtp
-o smtp_fallback_relay=
showq unix n - - - - showq
error unix - - - - - error
retry unix - - - - - error
discard unix - - - - - discard
local unix - n n - - local
virtual unix - n n - - virtual
lmtp unix - - - - - lmtp
anvil unix - - - - 1 anvil
scache unix - - - - 1 scache
maildrop unix - n n - - pipe
flags=DRhu user=vmail argv=/usr/bin/maildrop -d ${recipient}
uucp unix - n n - - pipe
flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient)
ifmail unix - n n - - pipe
flags=F user=ftn argv=/usr/lib/ifmail/ifmail -r $nexthop ($recipient)
bsmtp unix - n n - - pipe
flags=Fq. user=bsmtp argv=/usr/lib/bsmtp/bsmtp -t$nexthop -f$sender $recipient
scalemail-backend unix - n n - 2 pipe
flags=R user=scalemail argv=/usr/lib/scalemail/bin/scalemail-store ${nexthop} ${user} ${extension}
mailman unix - n n - - pipe
flags=FR user=list argv=/usr/lib/mailman/bin/postfix-to-mailman.py
${nexthop} ${user}
procmail unix - n n - - pipe
flags=Rq user=filter argv=/usr/local/bin/procmail -t -m /etc/procmailrc ${sender} ${recipient}


Any help would be highly appreciated. Please help!!!

Thanks
Sushant


All times are GMT -5. The time now is 03:29 PM.