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

Strange postfix-amavis problem

Expand Messages
  • Yusuf TAMBAG
    Hi all, I ve installed Postfix+SMTP Auth and integrated it with amavis on a solaris 10 machine. When I send an e-mail (I run a script that sends 15 mail 4-5
    Message 1 of 9 , Dec 29, 2005
    • 0 Attachment
      Hi all,

      I've installed Postfix+SMTP Auth and integrated it with amavis on a
      solaris 10 machine. When I send an e-mail (I run a script that sends 15
      mail 4-5 times and 5-8 out of 60-75 gives this error while others
      successfully delivered) sometimes the e-mail deferred with following
      error in mail log:

      Dec 29 09:13:29 newton postfix/smtp[24868]: [ID 197553 mail.info]
      91D1D7A297: to=<yusuf@...>,
      relay=127.0.0.1[127.0.0.1]:10024, delay=555, delays=554/0.07/0.01/0.58,
      dsn=4.4.1, status=deferred (host 127.0.0.1[127.0.0.1] said: 450 4.4.1
      Can't connect to 127.0.0.1 port 10025, at /opt/csw/sbin/amavisd-new
      line 4193, <GEN5> line 30., MTA([127.0.0.1]:10025), id=24828-01 (in
      reply to end of DATA command))

      postfix-amavis configuration in master.cf is below. I can connect both
      ports using telnet. I've changed number of concurrent processes from 4
      to 50 with no luck :'(

      -regards

      smtp-amavis unix - - y - 4 smtp
      -o smtp_data_done_timeout=1200
      -o smtp_send_xforward_command=yes
      -o disable_dns_lookups=yes

      127.0.0.1:10025 inet n - y - 100 smtpd
      -o content_filter=
      -o local_recipient_maps=
      -o relay_recipient_maps=
      -o smtpd_restriction_classes=
      -o smtpd_helo_restrictions=
      -o smtpd_sender_restrictions=
      -o smtpd_recipient_restrictions=permit_mynetworks,reject
      -o mynetworks=127.0.0.0/8
      -o strict_rfc821_envelopes=yes
      -o smtpd_error_sleep_time=0
      -o smtpd_soft_error_limit=1001
      -o smtpd_hard_error_limit=1000
      -o receive_override_options=no_header_body_checks
    • mouss
      ... amavis can t connect to the after the filter smtpd listener (the one listening on 127.0.0.1:10025). check that it is running, and if so look for what it
      Message 2 of 9 , Dec 30, 2005
      • 0 Attachment
        Yusuf TAMBAG a écrit :
        > Hi all,
        >
        > I've installed Postfix+SMTP Auth and integrated it with amavis on a
        > solaris 10 machine. When I send an e-mail (I run a script that sends 15
        > mail 4-5 times and 5-8 out of 60-75 gives this error while others
        > successfully delivered) sometimes the e-mail deferred with following
        > error in mail log:
        >
        > Dec 29 09:13:29 newton postfix/smtp[24868]: [ID 197553 mail.info]
        > 91D1D7A297: to=<yusuf@...>,
        > relay=127.0.0.1[127.0.0.1]:10024, delay=555, delays=554/0.07/0.01/0.58,
        > dsn=4.4.1, status=deferred (host 127.0.0.1[127.0.0.1] said: 450 4.4.1
        > Can't connect to 127.0.0.1 port 10025, at /opt/csw/sbin/amavisd-new
        > line 4193, <GEN5> line 30., MTA([127.0.0.1]:10025), id=24828-01 (in
        > reply to end of DATA command))
        >

        amavis can't connect to the after the filter smtpd listener (the one
        listening on 127.0.0.1:10025). check that it is running, and if so look
        for what it says when the error occurs. do a postfix reload to make
        sure you have reloaded postfix after editing master.cf.

        > postfix-amavis configuration in master.cf is below. I can connect both
        > ports using telnet.

        which both? you have 3 ports here: 25, 10024, 10025.

        I've changed number of concurrent processes from 4
        > to 50 with no luck :'(

        don't.

        >
        > -regards
        >
        > smtp-amavis unix - - y - 4 smtp
        > -o smtp_data_done_timeout=1200
        > -o smtp_send_xforward_command=yes
        > -o disable_dns_lookups=yes
        >

        This one is working, since it could send the mail to amavis.

        > 127.0.0.1:10025 inet n - y - 100 smtpd
        > -o content_filter=
        > -o local_recipient_maps=
        > -o relay_recipient_maps=
        > -o smtpd_restriction_classes=
        > -o smtpd_helo_restrictions=
        > -o smtpd_sender_restrictions=
        > -o smtpd_recipient_restrictions=permit_mynetworks,reject
        > -o mynetworks=127.0.0.0/8
        > -o strict_rfc821_envelopes=yes
        > -o smtpd_error_sleep_time=0
        > -o smtpd_soft_error_limit=1001
        > -o smtpd_hard_error_limit=1000
        > -o receive_override_options=no_header_body_checks
        >
        >

        for some reason, this one doesn't work.
      • Yusuf TAMBAG
        Thank you so much Gary :) I did a workaround in amavisd-new script, line 4193 connects to postfix smtpd and for some reason if it can not connect, it gives
        Message 3 of 9 , Dec 30, 2005
        • 0 Attachment
          Thank you so much Gary :)
          I did a workaround in amavisd-new script, line 4193 connects to postfix
          smtpd and for some reason if it can not connect, it gives that error. I
          simply put connection in a while loop :)
          while(!defined($smtp_handle)) {
          $smtp_handle = Net::SMTP->new($relayhost, Port => $relayhost_port,
          ($localaddr eq '' ? () : (LocalAddr => $localaddr)),
          ($heloname eq '' ? () : (Hello => $heloname)),
          ExactAddresses => 1,
          # Timeout => max(60, min(5 * 60, $remaining_time)), # for each
          operation
          Timeout => 0, # no timeouts, disable nonblocking mode on socket
          #Debug => debug_oneshot(),
          );
          sleep(3);
          }


          Gary V wrote:
          >> > Hi all,
          >> >
          >> > I've installed Postfix+SMTP Auth and integrated it with amavis on a
          >> > solaris 10 machine. When I send an e-mail (I run a script that
          >> sends 15
          >> > mail 4-5 times and 5-8 out of 60-75 gives this error while others
          >> > successfully delivered) sometimes the e-mail deferred with following
          >> > error in mail log:
          >> >
          >> > Dec 29 09:13:29 newton postfix/smtp[24868]: [ID 197553 mail.info]
          >> > 91D1D7A297: to=<yusuf@...>,
          >> > relay=127.0.0.1[127.0.0.1]:10024, delay=555,
          >> delays=554/0.07/0.01/0.58,
          >> > dsn=4.4.1, status=deferred (host 127.0.0.1[127.0.0.1] said: 450 4.4.1
          >> > Can't connect to 127.0.0.1 port 10025, at /opt/csw/sbin/amavisd-new
          >> > line 4193, <GEN5> line 30., MTA([127.0.0.1]:10025), id=24828-01 (in
          >> > reply to end of DATA command))
          >> >
          >>
          >> amavis can't connect to the after the filter smtpd listener (the one
          >> listening on 127.0.0.1:10025). check that it is running, and if so look
          >> for what it says when the error occurs. do a postfix reload to make
          >> sure you have reloaded postfix after editing master.cf.
          >>
          >> > postfix-amavis configuration in master.cf is below. I can connect both
          >> > ports using telnet.
          >>
          >> which both? you have 3 ports here: 25, 10024, 10025.
          >>
          >> I've changed number of concurrent processes from 4
          >> > to 50 with no luck :'(
          >>
          >> don't.
          >>
          >> >
          >> > -regards
          >> >
          >> > smtp-amavis unix - - y - 4 smtp
          >> > -o smtp_data_done_timeout=1200
          >> > -o smtp_send_xforward_command=yes
          >> > -o disable_dns_lookups=yes
          >> >
          >>
          >> This one is working, since it could send the mail to amavis.
          >>
          >> > 127.0.0.1:10025 inet n - y - 100 smtpd
          >> > -o content_filter=
          >> > -o local_recipient_maps=
          >> > -o relay_recipient_maps=
          >> > -o smtpd_restriction_classes=
          >> > -o smtpd_helo_restrictions=
          >> > -o smtpd_sender_restrictions=
          >> > -o smtpd_recipient_restrictions=permit_mynetworks,reject
          >> > -o mynetworks=127.0.0.0/8
          >> > -o strict_rfc821_envelopes=yes
          >> > -o smtpd_error_sleep_time=0
          >> > -o smtpd_soft_error_limit=1001
          >> > -o smtpd_hard_error_limit=1000
          >> > -o receive_override_options=no_header_body_checks
          >> >
          >> >
          >>
          >> for some reason, this one doesn't work.
          >>
          >
          > Do you (or your script) maybe reload Postfix after you send it the batch?
          >
          > amavisd:
          >
          > } elsif ($err =~ /^Can't connect/) {
          > $smtp_response = sprintf("450 4.4.1 %s, MTA(%s), id=%s",
          > $err, $mta_id, am_id());
          >
          > Gary V
          >
          > _________________________________________________________________
          > Is your PC infected? Get a FREE online computer virus scan from
          > McAfee® Security.
          > http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963
        • Gary V
          ... Do you (or your script) maybe reload Postfix after you send it the batch? amavisd: } elsif ($err =~ /^Can t connect/) { $smtp_response = sprintf( 450 4.4.1
          Message 4 of 9 , Dec 30, 2005
          • 0 Attachment
            > > Hi all,
            > >
            > > I've installed Postfix+SMTP Auth and integrated it with amavis on a
            > > solaris 10 machine. When I send an e-mail (I run a script that sends 15
            > > mail 4-5 times and 5-8 out of 60-75 gives this error while others
            > > successfully delivered) sometimes the e-mail deferred with following
            > > error in mail log:
            > >
            > > Dec 29 09:13:29 newton postfix/smtp[24868]: [ID 197553 mail.info]
            > > 91D1D7A297: to=<yusuf@...>,
            > > relay=127.0.0.1[127.0.0.1]:10024, delay=555, delays=554/0.07/0.01/0.58,
            > > dsn=4.4.1, status=deferred (host 127.0.0.1[127.0.0.1] said: 450 4.4.1
            > > Can't connect to 127.0.0.1 port 10025, at /opt/csw/sbin/amavisd-new
            > > line 4193, <GEN5> line 30., MTA([127.0.0.1]:10025), id=24828-01 (in
            > > reply to end of DATA command))
            > >
            >
            >amavis can't connect to the after the filter smtpd listener (the one
            >listening on 127.0.0.1:10025). check that it is running, and if so look
            >for what it says when the error occurs. do a postfix reload to make
            >sure you have reloaded postfix after editing master.cf.
            >
            > > postfix-amavis configuration in master.cf is below. I can connect both
            > > ports using telnet.
            >
            >which both? you have 3 ports here: 25, 10024, 10025.
            >
            > I've changed number of concurrent processes from 4
            > > to 50 with no luck :'(
            >
            >don't.
            >
            > >
            > > -regards
            > >
            > > smtp-amavis unix - - y - 4 smtp
            > > -o smtp_data_done_timeout=1200
            > > -o smtp_send_xforward_command=yes
            > > -o disable_dns_lookups=yes
            > >
            >
            >This one is working, since it could send the mail to amavis.
            >
            > > 127.0.0.1:10025 inet n - y - 100 smtpd
            > > -o content_filter=
            > > -o local_recipient_maps=
            > > -o relay_recipient_maps=
            > > -o smtpd_restriction_classes=
            > > -o smtpd_helo_restrictions=
            > > -o smtpd_sender_restrictions=
            > > -o smtpd_recipient_restrictions=permit_mynetworks,reject
            > > -o mynetworks=127.0.0.0/8
            > > -o strict_rfc821_envelopes=yes
            > > -o smtpd_error_sleep_time=0
            > > -o smtpd_soft_error_limit=1001
            > > -o smtpd_hard_error_limit=1000
            > > -o receive_override_options=no_header_body_checks
            > >
            > >
            >
            >for some reason, this one doesn't work.
            >

            Do you (or your script) maybe reload Postfix after you send it the batch?

            amavisd:

            } elsif ($err =~ /^Can't connect/) {
            $smtp_response = sprintf("450 4.4.1 %s, MTA(%s), id=%s",
            $err, $mta_id, am_id());

            Gary V

            _________________________________________________________________
            Is your PC infected? Get a FREE online computer virus scan from McAfee�
            Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963
          • Gary V
            ... I don t feel I did you a favor. Wouldn t it be better to find out why amavisd-new at times can t connect to Postfix on 127.0.0.1:10025? I was just
            Message 5 of 9 , Dec 30, 2005
            • 0 Attachment
              >Thank you so much Gary :)
              >I did a workaround in amavisd-new script, line 4193 connects to postfix
              >smtpd and for some reason if it can not connect, it gives that error. I
              >simply put connection in a while loop :)
              > while(!defined($smtp_handle)) {
              > $smtp_handle = Net::SMTP->new($relayhost, Port => $relayhost_port,
              > ($localaddr eq '' ? () : (LocalAddr => $localaddr)),
              > ($heloname eq '' ? () : (Hello => $heloname)),
              > ExactAddresses => 1,
              > # Timeout => max(60, min(5 * 60, $remaining_time)), # for each
              >operation
              > Timeout => 0, # no timeouts, disable nonblocking mode on socket
              > #Debug => debug_oneshot(),
              > );
              > sleep(3);
              > }
              >
              >

              I don't feel I did you a favor. Wouldn't it be better to find out why
              amavisd-new at times can't connect to Postfix on 127.0.0.1:10025? I was just
              wondering if the reason was you were stopping and restarting Postfix shortly
              after your script had submitted the batch of 15 messages (or maybe your
              script did this). It was a question geared toward eliminating that as a
              possible cause.

              Gary V

              _________________________________________________________________
              Express yourself instantly with MSN Messenger! Download today - it's FREE!
              http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
            • mouss
              ... [snip] Don t do that. you are keeping one smtp and one amavisd just doing nothing but waiting. Note that the error you showed was temporary, so the mail is
              Message 6 of 9 , Dec 30, 2005
              • 0 Attachment
                Yusuf TAMBAG a écrit :
                > Thank you so much Gary :)
                > I did a workaround in amavisd-new script, line 4193 connects to postfix
                > smtpd and for some reason if it can not connect, it gives that error. I
                > simply put connection in a while loop :)
                [snip]

                Don't do that. you are keeping one smtp and one amavisd just doing
                nothing but waiting. Note that the error you showed was temporary, so
                the mail is still queued by postfix and will be retried later (so there
                is no need to hack amavisd).

                Instead, find out why the problem occured. If that only happens few
                times, then it was probably because postfix was restarted (as Gary
                said). If so, there is nothing to worry about.
              • Yusuf TAMBAG
                ... thank you mouss, when i get that error, postfix defers the message and puts the message in its deferred queue. Of course, it eventually sends the message,
                Message 7 of 9 , Dec 31, 2005
                • 0 Attachment
                  mouss wrote:
                  > Yusuf TAMBAG a écrit :
                  >
                  >> Thank you so much Gary :)
                  >> I did a workaround in amavisd-new script, line 4193 connects to postfix
                  >> smtpd and for some reason if it can not connect, it gives that error. I
                  >> simply put connection in a while loop :)
                  >>
                  > [snip]
                  >
                  > Don't do that. you are keeping one smtp and one amavisd just doing
                  > nothing but waiting. Note that the error you showed was temporary, so
                  > the mail is still queued by postfix and will be retried later (so there
                  > is no need to hack amavisd).
                  >
                  thank you mouss,
                  when i get that error, postfix defers the message and puts the message
                  in its deferred queue. Of course, it eventually sends the message, but
                  message is delayed :(. I'll investigate the source of the problem, but
                  putting in while loop may be acceptable because i don't think it will
                  take more than 3-4 retries to successfully connect to smtp. I don't
                  reload or restart postfix while sending mails. The problem may sometimes
                  occur even sending a single e-mail.
                  > Instead, find out why the problem occured. If that only happens few
                  > times, then it was probably because postfix was restarted (as Gary
                  > said). If so, there is nothing to worry about.
                  >
                • mouss
                  ... Then try to find the source of the problem. amavisd should have no problem connecting to the next smtpd. check all postfix logs for possible errors. If
                  Message 8 of 9 , Jan 1, 2006
                  • 0 Attachment
                    Yusuf TAMBAG a écrit :
                    > thank you mouss,
                    > when i get that error, postfix defers the message and puts the message
                    > in its deferred queue. Of course, it eventually sends the message, but
                    > message is delayed :(. I'll investigate the source of the problem, but
                    > putting in while loop may be acceptable because i don't think it will
                    > take more than 3-4 retries to successfully connect to smtp. I don't
                    > reload or restart postfix while sending mails. The problem may sometimes
                    > occur even sending a single e-mail.

                    Then try to find the source of the problem. amavisd should have no
                    problem connecting to the "next" smtpd. check all postfix logs for
                    possible errors. If you have too much mail, make sure your "last" smtpd
                    (after the filter) doesn't run too few processes compared to what you
                    receive. It is possible that your before-the-filter smtpd and amavisd
                    are too fast for the after-the-filter smtpd. This is rare, and if so,
                    you should find a real solution instead of a hack.

                    If you get more infos on what is happening, please post it.
                  • Yusuf TAMBAG
                    Hi All, I installed postfix-2.3-20060112 and linked /opt/csw/lib/i386/libsasl2.so.2 to /usr/local/lib/libsasl2.so and problem disappeared. I don t know which
                    Message 9 of 9 , Feb 1 11:58 PM
                    • 0 Attachment
                      Hi All,

                      I installed postfix-2.3-20060112 and linked
                      /opt/csw/lib/i386/libsasl2.so.2 to /usr/local/lib/libsasl2.so and
                      problem disappeared. I don't know which one did the trick.

                      mouss wrote:
                      > Yusuf TAMBAG a écrit :
                      >
                      >> thank you mouss,
                      >> when i get that error, postfix defers the message and puts the message
                      >> in its deferred queue. Of course, it eventually sends the message, but
                      >> message is delayed :(. I'll investigate the source of the problem, but
                      >> putting in while loop may be acceptable because i don't think it will
                      >> take more than 3-4 retries to successfully connect to smtp. I don't
                      >> reload or restart postfix while sending mails. The problem may sometimes
                      >> occur even sending a single e-mail.
                      >>
                      >
                      > Then try to find the source of the problem. amavisd should have no
                      > problem connecting to the "next" smtpd. check all postfix logs for
                      > possible errors. If you have too much mail, make sure your "last" smtpd
                      > (after the filter) doesn't run too few processes compared to what you
                      > receive. It is possible that your before-the-filter smtpd and amavisd
                      > are too fast for the after-the-filter smtpd. This is rare, and if so,
                      > you should find a real solution instead of a hack.
                      >
                      > If you get more infos on what is happening, please post it.
                      >
                      >
                    Your message has been successfully submitted and would be delivered to recipients shortly.