Loading ...
Sorry, an error occurred while loading the content.
 

Need Help about Postfix Policy with perl

Expand Messages
  • Pratchaya Rudjanisoragun
    Hello Everyone Let I ask one question about postfix policy According to page http://www.postfix.org/SMTPD_POLICY_README.html I try to create policy by
    Message 1 of 6 , Mar 26, 2014
      Hello Everyone

      Let I ask one question about postfix policy
      According to page http://www.postfix.org/SMTPD_POLICY_README.html
      I try to create policy by following above page but I always get the error as below

      Mar 26 18:07:29 TON postfix/smtpd[24332]: connect from localhost[127.0.0.1]
      Mar 26 18:07:44 TON postfix/spawn[24335]: warning: command /usr/bin/perl exit status 255
      Mar 26 18:07:44 TON postfix/smtpd[24332]: warning: premature end-of-input on private/greylist while reading input attribute name
      Mar 26 18:07:45 TON postfix/spawn[24335]: warning: command /usr/bin/perl exit status 255
      Mar 26 18:07:45 TON postfix/smtpd[24332]: warning: premature end-of-input on private/greylist while reading input attribute name
      Mar 26 18:07:45 TON postfix/smtpd[24332]: warning: problem talking to server private/greylist: Connection reset by peer
      Mar 26 18:07:45 TON postfix/smtpd[24332]: NOQUEUE: reject: RCPT from localhost[127.0.0.1]: 451 4.3.5 Server configuration problem; from=<a@...> to=<b@...> proto=SMTP

      My configuration
      Main.cf
      smtpd_recipient_restrictions = check_policy_service unix:private/greylist,permit_mynetworks,reject

      master.cf
      greylist unix - n n - - spawn
      user=nobody argv=/usr/bin/perl /usr/libexec/postfix/greylist.pl

      CentOS release 6.2 64bit
      postfix-2.6.6-2.2.el6_1.x86_64

      What wrong in my configuration ?

      Thanks in advance

      Ton
    • Wietse Venema
      ... Open a shell as root, then execute these commands: # su nobody $ /usr/bin/perl /usr/libexec/postfix/greylist.pl And report any error message. Wietse
      Message 2 of 6 , Mar 26, 2014
        Pratchaya Rudjanisoragun:
        > greylist unix - n n - - spawn
        > user=nobody argv=/usr/bin/perl /usr/libexec/postfix/greylist.pl

        Open a shell as root, then execute these commands:

        # su nobody
        $ /usr/bin/perl /usr/libexec/postfix/greylist.pl

        And report any error message.

        Wietse
      • Pratchaya Rudjanisoragun
        Dear Wietse, As I tried it return error as bellow. #su nobody This account is currently not available. How should I do? Thank in advance. Ton ... From:
        Message 3 of 6 , Mar 26, 2014
          Dear Wietse,

          As I tried it return error as bellow.
          #su nobody
          This account is currently not available.

          How should I do?

          Thank in advance.
          Ton

          -----Original Message-----
          From: owner-postfix-users@... [mailto:owner-postfix-users@...] On Behalf Of Wietse Venema
          Sent: Wednesday, March 26, 2014 6:37 PM
          To: Postfix users
          Subject: Re: Need Help about Postfix Policy with perl

          Pratchaya Rudjanisoragun:
          > greylist unix - n n - - spawn
          > user=nobody argv=/usr/bin/perl /usr/libexec/postfix/greylist.pl

          Open a shell as root, then execute these commands:

          # su nobody
          $ /usr/bin/perl /usr/libexec/postfix/greylist.pl

          And report any error message.

          Wietse
        • Wietse Venema
          ... Save the script below as su.pl then execute: perl su.pl /usr/bin/perl /usr/libexec/postfix/greylist.pl Wietse Begin script #!/usr/bin/perl die nobody:
          Message 4 of 6 , Mar 26, 2014
            Wietse:
            > Open a shell as root, then execute these commands:
            > # su nobody
            > $ /usr/bin/perl /usr/libexec/postfix/greylist.pl

            Pratchaya Rudjanisoragun:
            > #su nobody
            > This account is currently not available.

            Save the script below as "su.pl" then execute:

            perl su.pl /usr/bin/perl /usr/libexec/postfix/greylist.pl

            Wietse

            Begin script
            #!/usr/bin/perl

            die "nobody: not found\n" unless ($n, $p, $uid, $gid, $q, $c, $g, $d,
            $s) = getpwnam("nobody");
            die "cannot set effective gid to $gid: $!\n" unless ($) = "$gid $gid");
            die "cannot set real gid to $gid: $!\n" unless ($( = "$gid $gid");
            die "cannot set uid to $uid: $!\n" unless ($> = $< = $uid);
            exec(@ARGV) || die "exec $ARGV[0]: $!\n";
            End script
          • Wietse Venema
            ... That is. execute from a root shell prompt: # perl su.pl /usr/bin/perl /usr/libexec/postfix/greylist.pl
            Message 5 of 6 , Mar 26, 2014
              Wietse Venema:
              > Wietse:
              > > Open a shell as root, then execute these commands:
              > > # su nobody
              > > $ /usr/bin/perl /usr/libexec/postfix/greylist.pl
              >
              > Pratchaya Rudjanisoragun:
              > > #su nobody
              > > This account is currently not available.
              >
              > Save the script below as "su.pl" then execute:
              >
              > perl su.pl /usr/bin/perl /usr/libexec/postfix/greylist.pl

              That is. execute from a root shell prompt:

              # perl su.pl /usr/bin/perl /usr/libexec/postfix/greylist.pl

              > Wietse
              >
              > Begin script
              > #!/usr/bin/perl
              >
              > die "nobody: not found\n" unless ($n, $p, $uid, $gid, $q, $c, $g, $d,
              > $s) = getpwnam("nobody");
              > die "cannot set effective gid to $gid: $!\n" unless ($) = "$gid $gid");
              > die "cannot set real gid to $gid: $!\n" unless ($( = "$gid $gid");
              > die "cannot set uid to $uid: $!\n" unless ($> = $< = $uid);
              > exec(@ARGV) || die "exec $ARGV[0]: $!\n";
              > End script
              >
            • Pratchaya Rudjanisoragun
              Thank you very much , I will try this. Best Regards, Ton ... From: owner-postfix-users@postfix.org [mailto:owner-postfix-users@postfix.org] On Behalf Of Wietse
              Message 6 of 6 , Mar 26, 2014
                Thank you very much , I will try this.

                Best Regards,
                Ton

                -----Original Message-----
                From: owner-postfix-users@... [mailto:owner-postfix-users@...] On Behalf Of Wietse Venema
                Sent: Wednesday, March 26, 2014 8:41 PM
                To: Postfix users
                Subject: Re: Need Help about Postfix Policy with perl

                Wietse Venema:
                > Wietse:
                > > Open a shell as root, then execute these commands:
                > > # su nobody
                > > $ /usr/bin/perl /usr/libexec/postfix/greylist.pl
                >
                > Pratchaya Rudjanisoragun:
                > > #su nobody
                > > This account is currently not available.
                >
                > Save the script below as "su.pl" then execute:
                >
                > perl su.pl /usr/bin/perl /usr/libexec/postfix/greylist.pl

                That is. execute from a root shell prompt:

                # perl su.pl /usr/bin/perl /usr/libexec/postfix/greylist.pl

                > Wietse
                >
                > Begin script
                > #!/usr/bin/perl
                >
                > die "nobody: not found\n" unless ($n, $p, $uid, $gid, $q, $c, $g, $d,
                > $s) = getpwnam("nobody");
                > die "cannot set effective gid to $gid: $!\n" unless ($) = "$gid
                > $gid"); die "cannot set real gid to $gid: $!\n" unless ($( = "$gid
                > $gid"); die "cannot set uid to $uid: $!\n" unless ($> = $< = $uid);
                > exec(@ARGV) || die "exec $ARGV[0]: $!\n"; End script
                >
              Your message has been successfully submitted and would be delivered to recipients shortly.