Qmail Postfix TrendMicro Integration At PAHWA Enterprises: Difference between revisions
Appearance
Created page with " == Qmail Postfix TrendMicro Integration At PAHWA Enterprises == =1. Architecture of mail: = front end postfix port 25 Proxy port of Trend 10024 Downstream port ..." |
No edit summary |
||
| Line 6: | Line 6: | ||
front end postfix port 25 | front end postfix port 25 | ||
Proxy port of Trend 10024 | Proxy port of Trend 10024 | ||
Downstream port 825 (qmail) | Downstream port 825 (qmail) | ||
Centralize DATABASE: LDAP | |||
| Line 18: | Line 15: | ||
#vi main.cf | #vi main.cf | ||
queue_directory = /var/spool/postfix | queue_directory = /var/spool/postfix | ||
command_directory = /usr/sbin | command_directory = /usr/sbin | ||
daemon_directory = /usr/libexec/postfix | daemon_directory = /usr/libexec/postfix | ||
mail_owner = postfix | mail_owner = postfix | ||
myhostname = mail21c.pahwa.com | myhostname = mail21c.pahwa.com | ||
mydomain = pahwa.com | mydomain = pahwa.com | ||
inet_interfaces = all | inet_interfaces = all | ||
mydestination = $myhostname, localhost.$mydomain, localhost, pahwa.com | mydestination = $myhostname, localhost.$mydomain, localhost, pahwa.com | ||
unknown_local_recipient_reject_code = 550 | unknown_local_recipient_reject_code = 550 | ||
mynetworks = 127.0.0.0/8, 192.168.0.3, 192.168.0.10, 210.211.174.225, 59.176.16.97, 219.65.189.118, 59.93.252.157, 122.164.56.219 | mynetworks = 127.0.0.0/8, 192.168.0.3, 192.168.0.10, 210.211.174.225, 59.176.16.97, 219.65.189.118, 59.93.252.157, 122.164.56.219 | ||
debug_peer_level = 2 | |||
debugger_command = | |||
debug_peer_level = 2 | sendmail_path = /usr/sbin/sendmail.postfix | ||
debugger_command = | newaliases_path = /usr/bin/newaliases.postfix | ||
mailq_path = /usr/bin/mailq.postfix | |||
setgid_group = postdrop | |||
sendmail_path = /usr/sbin/sendmail.postfix | html_directory = /usr/share/doc/postfix-2.4.1-documentation/html | ||
newaliases_path = /usr/bin/newaliases.postfix | manpage_directory = /usr/share/man | ||
mailq_path = /usr/bin/mailq.postfix | sample_directory = /etc/postfix | ||
setgid_group = postdrop | readme_directory = /usr/share/doc/postfix-2.4.1-documentation/readme | ||
html_directory = /usr/share/doc/postfix-2.4.1-documentation/html | smtpd_sasl_auth_enable = yes | ||
manpage_directory = /usr/share/man | smtpd_sasl_security_options = noanonymous | ||
sample_directory = /etc/postfix | broken_sasl_auth_clients = yes | ||
readme_directory = /usr/share/doc/postfix-2.4.1-documentation/readme | smtpd_sasl_local_domain = | ||
smtpd_sasl_auth_enable = yes | accounts_server_host = localhost | ||
smtpd_sasl_security_options = noanonymous | accounts_search_base = dc=pahwa,dc=com | ||
broken_sasl_auth_clients = yes | accounts_query_filter = (&(objectClass=qmailUser)(mail=%s)) | ||
smtpd_sasl_local_domain = | accounts_result_attribute = mailMessageStore | ||
accounts_server_host = localhost | accounts_result_format = %s/Maildir/ | ||
accounts_search_base = dc=pahwa,dc=com | accounts_scope = sub | ||
accounts_query_filter = (&(objectClass=qmailUser)(mail=%s)) | accounts_cache = yes | ||
accounts_result_attribute = mailMessageStore | accounts_bind = yes | ||
accounts_result_format = %s/Maildir/ | accounts_bind_dn = cn=Manager, dc=pahwa, dc=com | ||
accounts_scope = sub | accounts_bind_pw = secretpahwa | ||
accounts_cache = yes | accounts_version = 3 | ||
accounts_bind = yes | alternate_server_host = localhost | ||
accounts_bind_dn = cn=Manager, dc=pahwa, dc=com | alternate_search_base = dc=pahwa,dc=com | ||
accounts_bind_pw = secretpahwa | alternate_query_filter = (&(objectClass=qmailUser)(mailAlternateAddress=%s)) | ||
accounts_version = 3 | alternate_result_attribute = mailMessageStore | ||
alternate_server_host = localhost | alternate_result_format = %s/Maildir/ | ||
alternate_search_base = dc=pahwa,dc=com | alternate_scope = sub | ||
alternate_query_filter = (&(objectClass=qmailUser)(mailAlternateAddress=%s)) | alternate_cache = yes | ||
alternate_result_attribute = mailMessageStore | alternate_bind = yes | ||
alternate_result_format = %s/Maildir/ | alternate_bind_dn = cn=Manager, dc=pahwa, dc=com | ||
alternate_scope = sub | alternate_bind_pw = secretpahwa | ||
alternate_cache = yes | alternate_version = 3 | ||
alternate_bind = yes | virtual_transport = virtual | ||
alternate_bind_dn = cn=Manager, dc=pahwa, dc=com | virtual_uid_maps = static:508 | ||
alternate_bind_pw = secretpahwa | virtual_gid_maps = static:503 | ||
alternate_version = 3 | virtual_mailbox_base = /home/vmail | ||
virtual_transport = virtual | virtual_mailbox_maps = ldap:accounts,ldap:alternate | ||
virtual_uid_maps = static:508 | virtual_create_maildirsize = yes | ||
virtual_gid_maps = static:503 | virtual_mailbox_extended = yes | ||
virtual_mailbox_base = /home/vmail | disable_dns_lookups = no | ||
virtual_mailbox_maps = ldap:accounts,ldap:alternate | local_recipient_maps = $virtual_mailbox_maps | ||
virtual_create_maildirsize = yes | smtpd_client_restrictions = reject_rbl_client bl.spamcop.net, | ||
virtual_mailbox_extended = yes | |||
disable_dns_lookups = no | |||
local_recipient_maps = $virtual_mailbox_maps | |||
smtpd_client_restrictions = | |||
permit | permit | ||
disable_vrfy_command = yes | disable_vrfy_command = yes | ||
smtpd_recipient_restrictions = | smtpd_recipient_restrictions=permit_mynetworks, | ||
permit_sasl_authenticated, | permit_sasl_authenticated, | ||
reject_non_fqdn_sender, | reject_non_fqdn_sender, | ||
| Line 88: | Line 79: | ||
reject_unauth_destination, | reject_unauth_destination, | ||
reject_unauth_pipelining | reject_unauth_pipelining | ||
smtpd_sender_restrictions = | smtpd_sender_restrictions = | ||
permit_mynetworks, | permit_mynetworks, | ||
permit_sasl_authenticated, | permit_sasl_authenticated, | ||
reject_unknown_sender_domain | reject_unknown_sender_domain | ||
default_process_limit=200 | default_process_limit=200 | ||
imss_timeout=10m | imss_timeout=10m | ||
imss_connect_timeout=1s | imss_connect_timeout=1s | ||
content_filter = imss:localhost:10024 | content_filter = imss:localhost:10024 | ||
imss_destination_recipient_limit=200 | imss_destination_recipient_limit=200 | ||
imss_destination_concurrency_limit=20 | imss_destination_concurrency_limit=20 | ||
#vi master.cf | #vi master.cf | ||
smtp inet n - n - - smtpd | smtp inet n - n - - smtpd | ||
imss unix - - n - - smtp | imss unix - - n - - smtp | ||
-o disable_dns_lookups=yes | -o disable_dns_lookups=yes | ||
-o smtp_connect_timeout=$imss_connect_timeout | -o smtp_connect_timeout=$imss_connect_timeout | ||
-o smtp_data_done_timeout=$imss_timeout | -o smtp_data_done_timeout=$imss_timeout | ||
pickup fifo n - n 60 1 pickup | pickup fifo n - n 60 1 pickup | ||
cleanup unix n - n - 0 cleanup | cleanup unix n - n - 0 cleanup | ||
qmgr fifo n - n 300 1 qmgr | qmgr fifo n - n 300 1 qmgr | ||
tlsmgr unix - - n 1000? 1 tlsmgr | tlsmgr unix - - n 1000? 1 tlsmgr | ||
rewrite unix - - n - - trivial-rewrite | rewrite unix - - n - - trivial-rewrite | ||
bounce unix - - n - 0 bounce | bounce unix - - n - 0 bounce | ||
defer unix - - n - 0 bounce | defer unix - - n - 0 bounce | ||
trace unix - - n - 0 bounce | trace unix - - n - 0 bounce | ||
verify unix - - n - 1 verify | verify unix - - n - 1 verify | ||
flush unix n - n 1000? 0 flush | flush unix n - n 1000? 0 flush | ||
proxymap unix - - n - - proxymap | proxymap unix - - n - - proxymap | ||
smtp unix - - n - - smtp | smtp unix - - n - - smtp | ||
relay unix - - n - - smtp | relay unix - - n - - smtp | ||
-o fallback_relay= | -o fallback_relay= | ||
showq unix n - n - - showq | showq unix n - n - - showq | ||
error unix - - n - - error | error unix - - n - - error | ||
discard unix - - n - - discard | discard unix - - n - - discard | ||
local unix - n n - - local | local unix - n n - - local | ||
virtual unix - n n - - virtual | virtual unix - n n - - virtual | ||
lmtp unix - - n - - lmtp | lmtp unix - - n - - lmtp | ||
anvil unix - - n - 1 anvil | anvil unix - - n - 1 anvil | ||
scache unix - - n - 1 scache | scache unix - - n - 1 scache | ||
maildrop unix - n n - - pipe | maildrop unix - n n - - pipe | ||
flags=DRhu user=vmail argv=/usr/local/bin/maildrop -d ${recipient} | flags=DRhu user=vmail argv=/usr/local/bin/maildrop -d ${recipient} | ||
old-cyrus unix - n n - - pipe | old-cyrus unix - n n - - pipe | ||
flags=R user=cyrus argv=/usr/lib/cyrus-imapd/deliver -e -m ${extension} ${user} | flags=R user=cyrus argv=/usr/lib/cyrus-imapd/deliver -e -m ${extension} ${user} | ||
cyrus unix - n n - - pipe | cyrus unix - n n - - pipe | ||
user=cyrus argv=/usr/lib/cyrus-imapd/deliver -e -r ${sender} -m ${extension} ${user} | user=cyrus argv=/usr/lib/cyrus-imapd/deliver -e -r ${sender} -m ${extension} ${user} | ||
uucp unix - n n - - pipe | uucp unix - n n - - pipe | ||
flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient) | flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient) | ||
ifmail unix - n n - - pipe | ifmail unix - n n - - pipe | ||
flags=F user=ftn argv=/usr/lib/ifmail/ifmail -r $nexthop ($recipient) | flags=F user=ftn argv=/usr/lib/ifmail/ifmail -r $nexthop ($recipient) | ||
bsmtp unix - n n - - pipe | bsmtp unix - n n - - pipe | ||
flags=Fq. user=foo argv=/usr/local/sbin/bsmtp -f $sender $nexthop $recipient | flags=Fq. user=foo argv=/usr/local/sbin/bsmtp -f $sender $nexthop $recipient | ||
################################# | |||
This postfix will pass mail to trend and trend will pass to qmail. | This postfix will pass mail to trend and trend will pass to qmail. | ||
| Line 149: | Line 140: | ||
= SMTP AUTH via postfix = | = SMTP AUTH via postfix = | ||
# vi /etc/saslauthd.conf | |||
ldap_servers: ldap://localhost/ | |||
ldap_search_base: dc=pahwa, dc=com | |||
Services to RUN | |||
#/etc/init.d/postfix start | |||
#/etc/init.d/saslauthd start | |||
#################################################3 | |||
IMSS login | |||
https://ip:8445 | |||
user: admin | user: admin | ||
pass: imss7.0 | pass: imss7.0 | ||
############################################## | |||
One instance is also build for | |||
1. config dir /var/qmail4 | 1. config dir /var/qmail4 | ||
| Line 187: | Line 171: | ||
#!/bin/sh | #!/bin/sh | ||
cd /var/qmail4/control | cd /var/qmail4/control | ||
ldapsearch -x | grep "mail:" > valid ; sed "s/mail: //g" valid > validrcptto.txt | ldapsearch -x | grep "mail:" > valid ; sed "s/mail: //g" valid > validrcptto.txt | ||
ldapsearch -x | grep "mailAlternateAddress:" > valid1 ; sed "s/mailAlternateAddress: //g" valid1 >> validrcptto.txt | ldapsearch -x | grep "mailAlternateAddress:" > valid1 ; sed "s/mailAlternateAddress: //g" valid1 >> validrcptto.txt | ||
cdbmake-12 validrcptto.cdb validrcptto.tmp < validrcptto.txt | cdbmake-12 validrcptto.cdb validrcptto.tmp < validrcptto.txt | ||
In future if Postfix misbehave we need to change | |||
#ln -s /var/qmail4/supervise/qmail4-send /service/ | #ln -s /var/qmail4/supervise/qmail4-send /service/ | ||
#ln -s /var/qmail4/supervise/qmail4-smtp /service/ | #ln -s /var/qmail4/supervise/qmail4-smtp /service/ | ||
restart the qmail | |||
change port 825 for local users. | |||
Revision as of 03:44, 3 December 2012
Qmail Postfix TrendMicro Integration At PAHWA Enterprises
1. Architecture of mail:
front end postfix port 25 Proxy port of Trend 10024 Downstream port 825 (qmail) Centralize DATABASE: LDAP
2. Configuration of postfix
- vi main.cf
queue_directory = /var/spool/postfix command_directory = /usr/sbin daemon_directory = /usr/libexec/postfix mail_owner = postfix myhostname = mail21c.pahwa.com mydomain = pahwa.com inet_interfaces = all mydestination = $myhostname, localhost.$mydomain, localhost, pahwa.com unknown_local_recipient_reject_code = 550 mynetworks = 127.0.0.0/8, 192.168.0.3, 192.168.0.10, 210.211.174.225, 59.176.16.97, 219.65.189.118, 59.93.252.157, 122.164.56.219 debug_peer_level = 2 debugger_command = sendmail_path = /usr/sbin/sendmail.postfix newaliases_path = /usr/bin/newaliases.postfix mailq_path = /usr/bin/mailq.postfix setgid_group = postdrop html_directory = /usr/share/doc/postfix-2.4.1-documentation/html manpage_directory = /usr/share/man sample_directory = /etc/postfix readme_directory = /usr/share/doc/postfix-2.4.1-documentation/readme smtpd_sasl_auth_enable = yes smtpd_sasl_security_options = noanonymous broken_sasl_auth_clients = yes smtpd_sasl_local_domain = accounts_server_host = localhost accounts_search_base = dc=pahwa,dc=com accounts_query_filter = (&(objectClass=qmailUser)(mail=%s)) accounts_result_attribute = mailMessageStore accounts_result_format = %s/Maildir/ accounts_scope = sub accounts_cache = yes accounts_bind = yes accounts_bind_dn = cn=Manager, dc=pahwa, dc=com accounts_bind_pw = secretpahwa accounts_version = 3 alternate_server_host = localhost alternate_search_base = dc=pahwa,dc=com alternate_query_filter = (&(objectClass=qmailUser)(mailAlternateAddress=%s)) alternate_result_attribute = mailMessageStore alternate_result_format = %s/Maildir/ alternate_scope = sub alternate_cache = yes alternate_bind = yes alternate_bind_dn = cn=Manager, dc=pahwa, dc=com alternate_bind_pw = secretpahwa alternate_version = 3 virtual_transport = virtual virtual_uid_maps = static:508 virtual_gid_maps = static:503 virtual_mailbox_base = /home/vmail virtual_mailbox_maps = ldap:accounts,ldap:alternate virtual_create_maildirsize = yes virtual_mailbox_extended = yes disable_dns_lookups = no local_recipient_maps = $virtual_mailbox_maps smtpd_client_restrictions = reject_rbl_client bl.spamcop.net, permit disable_vrfy_command = yes smtpd_recipient_restrictions=permit_mynetworks, permit_sasl_authenticated, reject_non_fqdn_sender, reject_non_fqdn_recipient, reject_unauth_destination, reject_unauth_pipelining smtpd_sender_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unknown_sender_domain default_process_limit=200 imss_timeout=10m imss_connect_timeout=1s content_filter = imss:localhost:10024 imss_destination_recipient_limit=200 imss_destination_concurrency_limit=20
- vi master.cf
smtp inet n - n - - smtpd
imss unix - - n - - smtp
-o disable_dns_lookups=yes
-o smtp_connect_timeout=$imss_connect_timeout
-o smtp_data_done_timeout=$imss_timeout
pickup fifo n - n 60 1 pickup
cleanup unix n - n - 0 cleanup
qmgr fifo n - n 300 1 qmgr
tlsmgr unix - - n 1000? 1 tlsmgr
rewrite unix - - n - - trivial-rewrite
bounce unix - - n - 0 bounce
defer unix - - n - 0 bounce
trace unix - - n - 0 bounce
verify unix - - n - 1 verify
flush unix n - n 1000? 0 flush
proxymap unix - - n - - proxymap
smtp unix - - n - - smtp
relay unix - - n - - smtp
-o fallback_relay=
showq unix n - n - - showq
error unix - - n - - error
discard unix - - n - - discard
local unix - n n - - local
virtual unix - n n - - virtual
lmtp unix - - n - - lmtp
anvil unix - - n - 1 anvil
scache unix - - n - 1 scache
maildrop unix - n n - - pipe
flags=DRhu user=vmail argv=/usr/local/bin/maildrop -d ${recipient}
old-cyrus unix - n n - - pipe
flags=R user=cyrus argv=/usr/lib/cyrus-imapd/deliver -e -m ${extension} ${user}
cyrus unix - n n - - pipe
user=cyrus argv=/usr/lib/cyrus-imapd/deliver -e -r ${sender} -m ${extension} ${user}
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=foo argv=/usr/local/sbin/bsmtp -f $sender $nexthop $recipient
This postfix will pass mail to trend and trend will pass to qmail.
= SMTP AUTH via postfix =
- vi /etc/saslauthd.conf
ldap_servers: ldap://localhost/ ldap_search_base: dc=pahwa, dc=com
Services to RUN
#/etc/init.d/postfix start #/etc/init.d/saslauthd start
- 3
IMSS login
https://ip:8445
user: admin pass: imss7.0
One instance is also build for
1. config dir /var/qmail4 2. Latest Combined patch on qmail4 script to generate valid rcpt
- vi /root/validrcpt.sh
- !/bin/sh
cd /var/qmail4/control
ldapsearch -x | grep "mail:" > valid ; sed "s/mail: //g" valid > validrcptto.txt ldapsearch -x | grep "mailAlternateAddress:" > valid1 ; sed "s/mailAlternateAddress: //g" valid1 >> validrcptto.txt cdbmake-12 validrcptto.cdb validrcptto.tmp < validrcptto.txt
In future if Postfix misbehave we need to change
#ln -s /var/qmail4/supervise/qmail4-send /service/ #ln -s /var/qmail4/supervise/qmail4-smtp /service/
restart the qmail
change port 825 for local users.