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

Alternate SMTP port number in alias file

Expand Messages
  • Jim Balo
    Hi, I need to redirect a few accounts on my Postfix server to a different SMTP server, but this server is using port 2525 instead of 25. I have tried this in
    Message 1 of 10 , Nov 1, 2008
    • 0 Attachment
      Hi,

      I need to redirect a few accounts on my Postfix server to a different SMTP server, but this server is using port 2525 instead of 25. I have tried this in my /etc/alias file:

      "joedoe: joedoe@...:2525"
      and
      "joedoe: joedoe@... 2525"

      The above does not work. How can I accomplish this?

      Thanks,
      JB
    • Sahil Tandon
      ... Don t do this in the /etc/alias file; instead, use transport maps: http://www.postfix.org/transport.5.html ... See the link posted above and pay close
      Message 2 of 10 , Nov 2, 2008
      • 0 Attachment
        Jim Balo <jimbalo22@...> wrote:

        > I need to redirect a few accounts on my Postfix server to a different
        > SMTP server, but this server is using port 2525 instead of 25. I have
        > tried this in my /etc/alias file:

        Don't do this in the /etc/alias file; instead, use transport maps:

        http://www.postfix.org/transport.5.html

        > "joedoe: joedoe@...:2525"
        > and
        > "joedoe: joedoe@... 2525"
        >
        > The above does not work. How can I accomplish this?

        See the link posted above and pay close attention to transport map
        syntax.

        --
        Sahil Tandon <sahil@...>
      • Jim Balo
        ... I tried this, but did not get it to work. Here is what I added to /etc/postfix/transport: joedoe@acme.com
        Message 3 of 10 , Nov 2, 2008
        • 0 Attachment
          > > I need to redirect a few accounts on my Postfix server
          > to a different
          > > SMTP server, but this server is using port 2525
          > instead of 25. I have
          > > tried this in my /etc/alias file:
          >
          > Don't do this in the /etc/alias file; instead, use
          > transport maps:
          >
          > http://www.postfix.org/transport.5.html
          >
          > > "joedoe:
          > joedoe@...:2525"
          > > and
          > > "joedoe: joedoe@...
          > 2525"
          > >
          > > The above does not work. How can I accomplish this?
          >
          > See the link posted above and pay close attention to
          > transport map syntax.

          I tried this, but did not get it to work. Here is what I added to /etc/postfix/transport:
          joedoe@... smtp:joedoe@...:2525

          My test mail wound up locally - not recirected. Maybe I have something backwards.

          I am not very familiar with this, but what I am trying to do is to setup a redirect for a handful of mail accounts in order to try out an outsourced email solution. Adding aliases to /etc/alias file would probably work perfectly since the redirect happens before any processing by Amavis, etc. takes place. The only problem to overcome is to make it use port 2525 when redirecting.

          Thanks,
          JB
        • Wietse Venema
          ... If something does not work as expected, this mailing list expects that you provide the following information: postconf -n command output. logging. You
          Message 4 of 10 , Nov 2, 2008
          • 0 Attachment
            Jim Balo:
            > I tried this, but did not get it to work. Here is what I added to /etc/postfix/transport:
            > joedoe@... smtp:joedoe@...:2525
            >
            > My test mail wound up locally - not recirected. Maybe I have something backwards.

            If something does not work as expected, this mailing list expects
            that you provide the following information:

            "postconf -n" command output.

            logging.

            You can't keep ignoring the mailing list instructions. I'll
            repeat them below the signature.

            Wietse

            TO REPORT A PROBLEM see http://www.postfix.org/DEBUG_README.html#mail

            TO (UN)SUBSCRIBE see http://www.postfix.org/lists.html

            Thank you for using Postfix.
          • mouss
            ... Sahil said pay close attention to the transport map syntax . joedoe@example.com smtp:[other.example.net]:2525 ... stop trying random things. postfix is
            Message 5 of 10 , Nov 2, 2008
            • 0 Attachment
              Jim Balo wrote:
              >>> I need to redirect a few accounts on my Postfix server
              >> to a different
              >>> SMTP server, but this server is using port 2525
              >> instead of 25. I have
              >>> tried this in my /etc/alias file:
              >> Don't do this in the /etc/alias file; instead, use
              >> transport maps:
              >>
              >> http://www.postfix.org/transport.5.html
              >>
              >>> "joedoe:
              >> joedoe@...:2525"
              >>> and
              >>> "joedoe: joedoe@...
              >> 2525"
              >>> The above does not work. How can I accomplish this?
              >> See the link posted above and pay close attention to
              >> transport map syntax.
              >
              > I tried this, but did not get it to work. Here is what I added to /etc/postfix/transport:
              > joedoe@... smtp:joedoe@...:2525
              >

              Sahil said "pay close attention to the transport map syntax".

              joedoe@... smtp:[other.example.net]:2525



              > My test mail wound up locally - not recirected. Maybe I have something backwards.
              >

              stop trying random things. postfix is not a robot. you can't train it to
              learn new grammar. you'll get better results by training yourself to
              learn postfix grammar.

              > I am not very familiar with this, but what I am trying to do is to setup a redirect for a handful of mail accounts in order to try out an outsourced email solution. Adding aliases to /etc/alias file would probably work perfectly since the redirect happens before any processing by Amavis, etc. takes place. The only problem to overcome is to make it use port 2525 when redirecting.
              >
              > Thanks,
              > JB
              >
              >
              >
              >
              >
              >
            • Jim Balo
              ... Sorry - I did not read it properly. I tried again using what I believe is the proper syntax, but the redirect is still not taking effect. I have posted
              Message 6 of 10 , Nov 2, 2008
              • 0 Attachment
                > Sahil said "pay close attention to the transport map
                > syntax".
                >
                > joedoe@... smtp:[other.example.net]:2525

                Sorry - I did not read it properly. I tried again using what I believe is the proper syntax, but the redirect is still not taking effect. I have posted details after signature.

                Thanks,
                JB

                ---- /etc/postfix/transport
                joedoe@... smtp:othersmtpserver.com:2525
                Note: I also tried with brackets:
                joedoe@... smtp:[othersmtpserver.com]:2525

                ---- postmap -q "joedoe@..." /etc/postfix/transport
                smtp:[othersmtpserver.com]:2525

                ---- maillog entries:
                Nov 2 18:54:14 server01 postfix/local[804]: B1A4FC7CA1: to=<joedoe@...>, relay=local, delay=0.03, delays=0.01/0.01/0/0.01, dsn=2.0.0, status=sent (delivered to maildir)
                Nov 2 18:54:14 server01 amavis[706]: (00706-01) Passed CLEAN, [xx.xx.xx.xx] [xx.xx.xx.xx] <someguy@...> -> <joedoe@...>, Message-ID: <838198.21522.qm@...>, mail_id: OUOPLWQArfz8, Hits: -0.774, size:3173, queued_as: B1A4FC7CA1, 13340 ms
                Nov 2 18:54:14 server01 postfix/lmtp[786]: 32099C7C95: to=<joedoe@...>, relay=127.0.0.1[127.0.0.1]:10024, delay=14, delays=0.36/0.01/0.02/13, dsn=2.0.0, status=sent (250 2.0.0 Ok: queued as B1A4FC7CA1)

                ---- postconf -n
                broken_sasl_auth_clients = yes
                command_directory = /usr/sbin
                config_directory = /etc/postfix
                content_filter = amavisfeed:[127.0.0.1]:10024
                daemon_directory = /usr/libexec/postfix
                debug_peer_level = 2
                default_destination_concurrency_limit = 100
                delay_warning_time = 1h
                home_mailbox = Maildir/
                html_directory = no
                inet_interfaces = all
                local_destination_concurrency_limit = 100
                local_destination_recipient_limit = 5
                local_recipient_maps = unix:passwd.byname $alias_maps
                mail_owner = postfix
                mailq_path = /usr/bin/mailq
                manpage_directory = /usr/local/man
                message_size_limit = 18000000
                mydestination = $mydomain, $myhostname, localhost, localhost.$mydomain
                mynetworks = xx.xx.xx.xx/xx, 127.0.0.0/8
                myorigin = $mydomain
                newaliases_path = /usr/bin/newaliases
                proxy_interfaces = xx.xx.xx.xx
                queue_directory = /var/spool/postfix
                readme_directory = no
                relay_domains = $mydestination
                sample_directory = /etc/postfix
                sendmail_path = /usr/sbin/sendmail
                setgid_group = postdrop
                smtpd_client_restrictions = reject_unauth_pipelining, permit_mynetworks, reject_rbl_client bl.spamcop.net, reject_rbl_client dnsbl.njabl.org
                smtpd_helo_restrictions = reject_unauth_pipelining, reject_invalid_hostname
                smtpd_recipient_limit = 5000
                smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unlisted_recipient, reject_unauth_destination
                smtpd_sasl_auth_enable = yes
                smtpd_sasl_path = private/auth
                smtpd_sasl_type = dovecot
                smtpd_sender_restrictions = reject_unknown_recipient_domain, reject_non_fqdn_recipient
                unknown_local_recipient_reject_code = 550
              • Daniel V. Reinhardt
                ________________________________ From: Jim Balo To: mouss Cc: postfix-users@postfix.org
                Message 7 of 10 , Nov 2, 2008
                • 0 Attachment

                   


                  From: Jim Balo <jimbalo22@...>
                  To: mouss <mouss@...>
                  Cc: "postfix-users@..." <postfix-users@...>
                  Sent: Monday, November 3, 2008 3:37:41 AM
                  Subject: Re: Alternate SMTP port number in alias file

                  > Sahil said "pay close attention to the transport map
                  > syntax".
                  >
                  > joedoe@...    smtp:[other.example.net]:2525

                  Sorry - I did not read it properly.  I tried again using what I believe is the proper syntax, but the redirect is still not taking effect.  I have posted details after signature.

                  Thanks,
                  JB

                  ---- /etc/postfix/transport
                  joedoe@...      smtp:othersmtpserver.com:2525
                  Note: I also tried with brackets:
                  joedoe@...      smtp:[othersmtpserver.com]:2525

                  ---- postmap -q "joedoe@..." /etc/postfix/transport
                  smtp:[othersmtpserver.com]:2525

                  ---- maillog entries:
                  Nov  2 18:54:14 server01 postfix/local[804]: B1A4FC7CA1: to=<joedoe@...>, relay=local, delay=0.03, delays=0.01/0.01/0/0.01, dsn=2.0.0, status=sent (delivered to maildir)
                  Nov  2 18:54:14 server01 amavis[706]: (00706-01) Passed CLEAN, [xx.xx.xx.xx] [xx.xx.xx.xx] <someguy@...> -> <joedoe@...>, Message-ID: <838198.21522.qm@...>, mail_id: OUOPLWQArfz8, Hits: -0.774, size:3173, queued_as: B1A4FC7CA1, 13340 ms
                  Nov  2 18:54:14 server01 postfix/lmtp[786]: 32099C7C95: to=<joedoe@...>, relay=127.0.0.1[127.0.0.1]:10024, delay=14, delays=0.36/0.01/0.02/13, dsn=2.0.0, status=sent (250 2.0.0 Ok: queued as B1A4FC7CA1)

                  ---- postconf -n
                  broken_sasl_auth_clients = yes
                  command_directory = /usr/sbin
                  config_directory = /etc/postfix
                  content_filter = amavisfeed:[127.0.0.1]:10024
                  daemon_directory = /usr/libexec/postfix
                  debug_peer_level = 2
                  default_destination_concurrency_limit = 100
                  delay_warning_time = 1h
                  home_mailbox = Maildir/
                  html_directory = no
                  inet_interfaces = all
                  local_destination_concurrency_limit = 100
                  local_destination_recipient_limit = 5
                  local_recipient_maps = unix:passwd.byname $alias_maps
                  mail_owner = postfix
                  mailq_path = /usr/bin/mailq
                  manpage_directory = /usr/local/man
                  message_size_limit = 18000000
                  mydestination = $mydomain, $myhostname, localhost, localhost.$mydomain
                  mynetworks = xx.xx.xx.xx/xx, 127.0.0.0/8
                  myorigin = $mydomain
                  newaliases_path = /usr/bin/newaliases
                  proxy_interfaces = xx.xx.xx.xx
                  queue_directory = /var/spool/postfix
                  readme_directory = no
                  relay_domains = $mydestination
                  sample_directory = /etc/postfix
                  sendmail_path = /usr/sbin/sendmail
                  setgid_group = postdrop
                  smtpd_client_restrictions = reject_unauth_pipelining, permit_mynetworks,  reject_rbl_client bl.spamcop.net, reject_rbl_client dnsbl.njabl.org
                  smtpd_helo_restrictions = reject_unauth_pipelining, reject_invalid_hostname
                  smtpd_recipient_limit = 5000
                  smtpd_recipient_restrictions = permit_mynetworks,  permit_sasl_authenticated, reject_unlisted_recipient, reject_unauth_destination
                  smtpd_sasl_auth_enable = yes
                  smtpd_sasl_path = private/auth
                  smtpd_sasl_type = dovecot
                  smtpd_sender_restrictions = reject_unknown_recipient_domain, reject_non_fqdn_recipient
                  unknown_local_recipient_reject_code = 550



                  Could you please keep your log entries and your postconf -a clean and without any edits.  The edits only make it harder to diagnose your issues.

                  Thanks,

                  Daniel Reinhardt
                  Website: www.cryptodan.com
                  Email: cryptodan@...
                  Junior Network Security Engineer


                       

                • Sahil Tandon
                  ... Don t edit or obfuscate file contents; it is prone to typos that complicate troubleshooting. ... [...] ... [...] In your postconf output, I did not see any
                  Message 8 of 10 , Nov 2, 2008
                  • 0 Attachment
                    Jim Balo <jimbalo22@...> wrote:

                    > > Sahil said "pay close attention to the transport map
                    > > syntax".
                    > >
                    > > joedoe@... smtp:[other.example.net]:2525
                    >
                    > Sorry - I did not read it properly. I tried again using what I
                    > believe is the proper syntax, but the redirect is still not taking
                    > effect. I have posted details after signature.
                    >
                    > ---- /etc/postfix/transport
                    > joedoe@... smtp:othersmtpserver.com:2525
                    > Note: I also tried with brackets:
                    > joedoe@... smtp:[othersmtpserver.com]:2525

                    Don't edit or obfuscate file contents; it is prone to typos that
                    complicate troubleshooting.

                    > ---- postmap -q "joedoe@..." /etc/postfix/transport
                    > smtp:[othersmtpserver.com]:2525
                    >
                    > ---- maillog entries:

                    [...]

                    > ---- postconf -n

                    [...]

                    In your postconf output, I did not see any declaration of
                    transport_maps. You need something like:

                    transport_maps = maptype:/etc/postfix/transport

                    where 'maptype' is probably 'hash' in your case, but see postconf(1) and
                    postmap(1) for more details.

                    --
                    Sahil Tandon <sahil@...>
                  • Jim Balo
                    Daniel, ... The logs are santized for security reasons (posting your public IPs and email addresses together with your configuration details is not safe).
                    Message 9 of 10 , Nov 2, 2008
                    • 0 Attachment
                      Daniel,

                      > Could you please keep your log entries and your postconf -a
                      > clean and without any edits. The edits only make it harder
                      > to diagnose your issues.

                      The logs are santized for security reasons (posting your public IPs and email addresses together with your configuration details is not safe). Hopefully the problem can still be diagnosed.

                      JB
                    • Jim Balo
                      Sahil, ... That was it! Thanks a bunch! JB
                      Message 10 of 10 , Nov 2, 2008
                      • 0 Attachment
                        Sahil,

                        > In your postconf output, I did not see any declaration of
                        > transport_maps. You need something like:
                        >
                        > transport_maps = maptype:/etc/postfix/transport

                        That was it! Thanks a bunch!

                        JB
                      Your message has been successfully submitted and would be delivered to recipients shortly.