1

I was hoping someone can help me out here. Cannot seem to get check_policy_service working. I am running policyd on port 10031 and postfix does not even makes a connection to it.

Already gone through the below thread, my problem is almost similar except the fact that firewall is already disabled on my system and thus port 10031 is not blocked by the firewall.

http://marc.info/?l=postfix-users&m=143886189409700&w=2

Here is the output form postconf -n :

alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/libexec/postfix
inet_interfaces = localhost
lmtp_host_lookup = native
mail_owner = postfix
mail_spool_directory = /var/spool/mail
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
mydestination = $myhostname
mydomain = mydomain.com
myorigin = $mydomain
newaliases_path = /usr/bin/newaliases.postfix
notify_classes = resource, software, policy
queue_directory = /var/spool/postfix
relayhost = [mail-relay.mydomain.com]
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
smtp_fallback_relay = [mail-relay.mydomain.com]
smtp_host_lookup = native
smtpd_banner = $myhostname ESMTP $mail_name
smtpd_end_of_data_restrictions = check_policy_service inet:127.0.0.1:10031
smtpd_recipient_restrictions = check_policy_service inet:127.0.0.1:10031, reject_unauth_destination, reject_unlisted_recipient
transport_maps = hash:/etc/postfix/transport unknown_local_recipient_reject_code = 450

Postfix version 2.3.3

OS: RHEL5.4

Adrian Cid Almaguer
  • 7,815
  • 13
  • 41
  • 63
rsingh
  • 31
  • 2

1 Answers1

0

Ah! This should be marked resolved/closed.

I was making a mistake. I was generating mail locally on the server using sendmail/mailx etc which results in that mail getting picked up by the pickup daemon rather than by the smtpd i.e sendmail on the server locally is direct writing a queue file into the "maildrop" directory which is getting picked up by postfix 'pickup' rather than smtpd . So in order to check mail against check_policy_service, the mail must be submitted via SMTP (using any smtp client like mini_sendmail). Once i did that, connection to policy server was made and checked against throttling and got expected result.

Use below to send mail to smtp and thus validate against the set policies:

 cat /tmp/mail.txt | mini_sendmail -ffoo@bar.com -s127.0.0.1 -p25 foo2@ybar.com

Thanks.

rsingh
  • 31
  • 2