Postfix part 2 BCC Maps , SMTP Auth , relay domains

Blind Carbon Copy Maps

#vim /etc/postfix/main.cf

#always_bcc = username  -->this user will get the copy of every message traversing/communicating in your system.
always_bcc = root       #you can use file redirects insted of root user

save/exit
#service postfix reload/restart

For demo:
send mail from userX  to userY, the root user will get the copy of message.

-- -- -- --- -
To get BCC msg Sent (Received) by selective user

[root@server1 postfix]# vim /etc/postfix/main.cf
#always_bcc = root
sender_bcc_maps = hash:/etc/postfix/sender_bcc                                                       
#recipient_bcc_maps = hash:/etc/postfix/recipient_bcc    //mail received by user listed in recipient_bcc will be bcc'd to target user/file

[root@server1 postfix]#vim /etc/postfix/sender_bcc
#LHS(sender to match)   RHS(BCC Recipient)
salman                  root

[root@server1 postfix]#postmap sender_bcc

[root@server1 postfix]# file sender_bcc.db      < - hash db created
sender_bcc.db: Berkeley DB (Hash, version 9, native byte-order)

= = = = = = =  =  =
=   SMTP Auth  =
= = = = = = =  =  =

[root@server1 sasl2]# rpm -qa | grep sasl
cyrus-sasl-lib-2.1.23-13.el6_3.1.i686
cyrus-sasl-plain-2.1.23-13.el6_3.1.i686
cyrus-sasl-gssapi-2.1.23-13.el6_3.1.i686
cyrus-sasl-2.1.23-13.el6_3.1.i686
cyrus-sasl-devel-2.1.23-13.el6_3.1.i686
cyrus-sasl-md5-2.1.23-13.el6_3.1.i686

#vim /etc/postfix/main.cf
             #add
smtpd_sasl_path=smtpd             
smtpd_sasl_auth_enable = yes    

(we are using pam authentication)

#cat /etc/sysconfig/saslauthd                                       #for more info and modification

...................................................................................................................................................
#vim /usr/lib/sasl2/smtpd.conf

pwcheck_method: saslauthd
mech_list: PLAIN LOGIN


[root@server1 postfix]#service saslauthd start                    
OR
[root@server1 postfix]# saslauthd -a pam                           
[root@server1 postfix]# ps -ef | grep sasl
root      1281     1  0 07:54 ?        00:00:00 saslauthd -a pam
root      1282  1281  0 07:54 ?        00:00:00 saslauthd -a pam
root      1283  1281  0 07:54 ?        00:00:00 saslauthd -a pam
root      1284  1281  0 07:54 ?        00:00:00 saslauthd -a pam
root      1285  1281  0 07:54 ?        00:00:00 saslauthd -a pam
root      1290  1261  0 07:56 pts/0    00:00:00 grep sasl

# vim /etc/postfix/main.cf

smtpd_sasl_auth_enable = yes


smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination 



Relaydomain database
- - - -- - -  - - - - - - - --  --
Defining Rlay_domains Maps
# rpm -qa | grep db
Initially check for the Berkley DB packages are installed. These packages will be used by the postfix for database support.

/etc/postfix/main.cf

relay_domains = $ mydestination,  hash:/etc/postfix/relay_domains    #this could be any name


# vim /etc/postfix/relaydomains
domain1.com
domain2.com
domain3.com
domain4.com
domain5.com
# postmap /etc/postfix/relaydomains
# postfix reload

No comments:

Post a Comment