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

Re: Problem sending emails to virtual users

Expand Messages
  • SONNY LASKAR
    In addition to this, *I am attaching the output of select queries from db:* mysql use postfix; Reading table information for completion of table and column
    Message 1 of 8 , May 27, 2013
    • 0 Attachment
      In addition to this,
      I am attaching the output of select queries from db:
      mysql> use postfix;
      Reading table information for completion of table and column names
      You can turn off this feature to get a quicker startup with -A

      Database changed
      mysql> show tables;
      +-----------------------+
      | Tables_in_postfix     |
      +-----------------------+
      | admin                 |
      | alias                 |
      | alias_domain          |
      | config                |
      | domain                |
      | domain_admins         |
      | fetchmail             |
      | log                   |
      | mailbox               |
      | quota                 |
      | quota2                |
      | vacation              |
      | vacation_notification |
      +-----------------------+
      13 rows in set (0.00 sec)

      mysql> select * from alias;
      +---------------------------+---------------------------+-------------------+---------------------+---------------------+--------+
      | address                   | goto                      | domain            | created             | modified            | active |
      +---------------------------+---------------------------+-------------------+---------------------+---------------------+--------+
      | ticket@...  | ticket@...  | example.com | 2013-05-27 21:42:19 | 2013-05-27 21:42:19 |      1 |
      +---------------------------+---------------------------+-------------------+---------------------+---------------------+--------+
      2 rows in set (0.00 sec)

      mysql> select * from domain;
      +-------------------+-------------+---------+-----------+----------+-------+-----------+----------+---------------------+---------------------+--------+
      | domain            | description | aliases | mailboxes | maxquota | quota | transport | backupmx | created             | modified            | active |
      +-------------------+-------------+---------+-----------+----------+-------+-----------+----------+---------------------+---------------------+--------+
      | ALL               | ALL         |       0 |         0 |        0 |     0 | ALL       |        0 | 0000-00-00 00:00:00 | 0000-00-00 00:00:00 |      1 |
      | example.com | Example |       0 |         0 |       10 |     0 | virtual   |        0 | 2013-05-27 21:41:11 | 2013-05-27 21:41:11 |      1 |
      +-------------------+-------------+---------+-----------+----------+-------+-----------+----------+---------------------+---------------------+--------+
      2 rows in set (0.00 sec)

      mysql> select * from mailbox;
      +---------------------------+------------------------------------+--------------------+----------------------------+-------+------------+-------------------+---------------------+---------------------+--------+
      | username                  | password                           | name               | maildir                    | quota | local_part | domain            | created             | modified            | active |
      +---------------------------+------------------------------------+--------------------+----------------------------+-------+------------+-------------------+---------------------+---------------------+--------+
      | ticket@...  | $1$ed6d59f5$tVNBlCkRaitmOezgL0z.g0 | Example Ticket | ticket@.../  |     0 | ticket     | example.com | 2013-05-27 21:42:19 | 2013-05-27 21:42:19 |      1 |
      +---------------------------+------------------------------------+--------------------+----------------------------+-------+------------+-------------------+---------------------+---------------------+--------+
      2 rows in set (0.00 sec)

      mysql> select * from config;
      +----+---------+-------+
      | id | name    | value |
      +----+---------+-------+
      |  1 | version | 740   |
      +----+---------+-------+
      1 row in set (0.00 sec)

      The error in mailog is:
      May 27 21:57:38 server1 postfix/smtpd[2161]: connect from localhost.localdomain[127.0.0.1]
      May 27 21:57:41 server1 postfix/smtpd[2161]: lost connection after CONNECT from localhost.localdomain[127.0.0.1]
      May 27 21:57:41 server1 postfix/smtpd[2161]: disconnect from localhost.localdomain[127.0.0.1]
      May 27 21:57:45 server1 postfix/smtpd[2161]: connect from localhost.localdomain[127.0.0.1]
      May 27 21:58:05 server1 postfix/smtpd[2161]: 3214C35A4C8F: client=localhost.localdomain[127.0.0.1]
      May 27 21:58:10 server1 postfix/cleanup[2167]: 3214C35A4C8F: message-id=<20130527175805.3214C35A4C8F@...>
      May 27 21:58:10 server1 dkim-filter[27618]: 3214C35A4C8F "DKIM-Signature" header added
      May 27 21:58:10 server1 postfix/qmgr[2157]: 3214C35A4C8F: from=<root@...>, size=424, nrcpt=1 (queue active)
      May 27 21:58:10 server1 postfix/pipe[2168]: 3214C35A4C8F: to=<ticket@...>, relay=dovecot, delay=12, delays=12/0.01/0/0.03, dsn=5.1.1, status=bounced (user unknown)
      May 27 21:58:10 server1 postfix/cleanup[2167]: 5B0C335A4C96: message-id=<20130527175810.5B0C335A4C96@...>
      May 27 21:58:10 server1 postfix/bounce[2170]: 3214C35A4C8F: sender non-delivery notification: 5B0C335A4C96
      May 27 21:58:10 server1 postfix/qmgr[2157]: 5B0C335A4C96: from=<>, size=2673, nrcpt=1 (queue active)
      May 27 21:58:10 server1 postfix/qmgr[2157]: 3214C35A4C8F: removed
      May 27 21:58:10 server1 postfix/pipe[2168]: 5B0C335A4C96: to=<root@...>, relay=dovecot, delay=0.02, delays=0/0/0/0.01, dsn=5.1.1, status=bounced (user unknown)
      May 27 21:58:10 server1 postfix/qmgr[2157]: 5B0C335A4C96: removed





      On Mon, May 27, 2013 at 11:32 PM, SONNY LASKAR <sonnylaskar@...> wrote:
      Dear All,

      I installed latest versioin of postfix and postfixadmin on Centos VPS .
      I created virtual mailbox from postfixadmin but whenever I send email to virtual users it gets bounce back.

      Let me give more details:

      Virtual User Files:
      [root@server1 ~]# cat /etc/postfix/mysql_virtual_domains_maps.cf
      user            = postfix
      password        = <password>
      hosts           = localhost
      dbname          = postfix
      #query          = SELECT domain FROM domain WHERE domain='%s'
      #optional query to use when relaying for backup MX
      query           = SELECT domain FROM domain WHERE domain='%s' AND backupmx = '0' AND active = '1'
      [root@server1 ~]# cat /etc/postfix/mysql_virtual_mailbox_maps.cf
      user            = postfix
      password        = <password>
      hosts           = localhost
      dbname          = postfix
      #query           = SELECT CONCAT(domain,'/',maildir) FROM mailbox WHERE username='%s' AND active = '1'
      query           = SELECT maildir FROM mailbox WHERE username='%s' AND active = '1'
      [root@server1 ~]# cat /etc/postfix/mysql_virtual_alias_maps.cf
      user            = postfix
      password        = <password>
      hosts           = localhost
      dbname          = postfix
      query           = SELECT goto FROM alias WHERE address='%s' AND active = '1'
      [root@server1 ~]# cat /etc/postfix/mysql_virtual_mailbox_limit_maps.cf
      user            = postfix
      password        = <password>
      hosts           = localhost
      dbname          = postfix
      query           = SELECT quota FROM mailbox WHERE username='%s' AND active = '1'

      Select query output from mysql:
      My main.cf file:
      queue_directory = /var/spool/postfix
      command_directory = /usr/sbin
      daemon_directory = /usr/libexec/postfix
      data_directory = /var/lib/postfix
      mail_owner = postfix
      myhostname = server1.example.com
      mydomain = example.com
      myorigin = $mydomain
      inet_interfaces = all
      inet_protocols = ipv4
      mydestination = $myhostname, localhost.$mydomain, localhost
      unknown_local_recipient_reject_code = 550
      mynetworks = 127.0.0.1
      alias_maps = hash:/etc/aliases
      alias_database = hash:/etc/aliases
      home_mailbox = Maildir/


      debug_peer_level = 2
      debugger_command =
               PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
               ddd $daemon_directory/$process_name $process_id & sleep 5
      sendmail_path = /usr/sbin/sendmail ;
      newaliases_path = /usr/bin/newaliases.postfix
      mailq_path = /usr/bin/mailq.postfix
      setgid_group = postdrop
      html_directory = no
      manpage_directory = /usr/share/man
      sample_directory = /usr/share/doc/postfix-2.6.6/samples
      readme_directory = /usr/share/doc/postfix-2.6.6/README_FILES
      virtual_mailbox_domains = mysql:/etc/postfix/mysql_virtual_domains_maps.cf
      virtual_mailbox_base = /var/vmail
      virtual_mailbox_maps = mysql:/etc/postfix/mysql_virtual_mailbox_maps.cf
      virtual_alias_maps = mysql:/etc/postfix/mysql_virtual_alias_maps.cf
      virtual_mailbox_limit_maps = mysql:/etc/postfix/mysql_virtual_mailbox_limit_maps.cf
      virtual_minimum_uid = 501
      virtual_uid_maps = static:501
      virtual_gid_maps = static:12
      virtual_transport = dovecot
      dovecot_destination_recipient_limit = 1
      smtpd_helo_required             = yes
      disable_vrfy_command            = yes
      non_fqdn_reject_code            = 450
      invalid_hostname_reject_code    = 450
      maps_rbl_reject_code            = 450
      smtpd_recipient_restrictions =
              permit_sasl_authenticated
              permit_mynetworks
              reject_unauth_destination
              reject_invalid_helo_hostname
              warn_if_reject reject_non_fqdn_helo_hostname
              warn_if_reject reject_unknown_helo_hostname
              warn_if_reject reject_unknown_client
              reject_non_fqdn_sender
              reject_non_fqdn_recipient
              reject_unknown_sender_domain
              reject_unknown_recipient_domain
              reject_rbl_client zen.spamhaus.org
              reject_rbl_client bl.spamcop.net
              reject_rbl_client dnsbl.sorbs.net=127.0.0.2
              reject_rbl_client dnsbl.sorbs.net=127.0.0.3
              reject_rbl_client dnsbl.sorbs.net=127.0.0.4
              reject_rbl_client dnsbl.sorbs.net=127.0.0.5
              reject_rbl_client dnsbl.sorbs.net=127.0.0.7
              reject_rbl_client dnsbl.sorbs.net=127.0.0.9
              reject_rbl_client dnsbl.sorbs.net=127.0.0.11
              reject_rbl_client dnsbl.sorbs.net=127.0.0.12
              warn_if_reject reject_rhsbl_sender dsn.rfc-ignorant.org
              warn_if_reject reject_rhsbl_sender abuse.rfc-ignorant.org
              warn_if_reject reject_rhsbl_sender whois.rfc-ignorant.org
              warn_if_reject reject_rhsbl_sender bogusmx.rfc-ignorant.org
              warn_if_reject reject_rhsbl_sender postmaster.rfc-ignorant.org
              permit
      smtpd_data_restrictions =
              reject_unauth_pipelining,
              reject_multi_recipient_bounce,
              permit
      milter_default_action = accept
      milter_protocol = 6
      smtpd_milters = inet:localhost:12345
      non_smtpd_milters = inet:localhost:12345
       

      --
      Regards
      Sonny



      --
      Regards
      Sonny
    • Benny Pedersen
      ... do you have squid installed ? CONNECT is not an smtp command if you have squid installed please secure it to not accept CONNECT from any ip ! try: telnet
      Message 2 of 8 , May 27, 2013
      • 0 Attachment
        SONNY LASKAR skrev den 2013-05-27 20:05:
        > May 27 21:57:38 server1 postfix/smtpd[2161]: connect from
        > localhost.localdomain[127.0.0.1]
        > May 27 21:57:41 server1 postfix/smtpd[2161]: lost connection after
        > CONNECT from localhost.localdomain[127.0.0.1]
        > May 27 21:57:41 server1 postfix/smtpd[2161]: disconnect from
        > localhost.localdomain[127.0.0.1]

        do you have squid installed ?

        CONNECT is not an smtp command

        if you have squid installed please secure it to not accept CONNECT from
        any ip !

        try:

        telnet 127.0.0.1 25
        CONNECT foo

        see logs

        --
        senders that put my email into body content will deliver it to my own
        trashcan, so if you like to get reply, dont do it
      • /dev/rob0
        ... In the context above, CONNECT means that the client had initiated the TCP connection, but had not yet given any commands. Non-SMTP commands given by a
        Message 3 of 8 , May 27, 2013
        • 0 Attachment
          On Tue, May 28, 2013 at 12:05:13AM +0200, Benny Pedersen wrote:
          > SONNY LASKAR skrev den 2013-05-27 20:05:
          > >May 27 21:57:38 server1 postfix/smtpd[2161]: connect from
          > >localhost.localdomain[127.0.0.1]
          > >May 27 21:57:41 server1 postfix/smtpd[2161]: lost connection
          > >after CONNECT from localhost.localdomain[127.0.0.1]
          > >May 27 21:57:41 server1 postfix/smtpd[2161]: disconnect from
          > >localhost.localdomain[127.0.0.1]
          >
          > do you have squid installed ?
          >
          > CONNECT is not an smtp command

          In the context above, CONNECT means that the client had initiated
          the TCP connection, but had not yet given any commands. Non-SMTP
          commands given by a client are specifically logged as such.
          --
          http://rob0.nodns4.us/ -- system administration and consulting
          Offlist GMX mail is seen only if "/dev/rob0" is in the Subject:
        • SONNY LASKAR
          Hello, *Output of telnet command:* [root@server1 ~]# telnet 127.0.0.1 25 Trying 127.0.0.1... Connected to 127.0.0.1. Escape character is ^] . 220
          Message 4 of 8 , May 27, 2013
          • 0 Attachment
            Hello,
            Output of telnet command:
            [root@server1 ~]# telnet 127.0.0.1 25
            Trying 127.0.0.1...
            Connected to 127.0.0.1.
            Escape character is '^]'.
            220 server1.example.com ESMTP Postfix
            CONNECT foo
            221 2.7.0 Error: I can break rules, too. Goodbye.
            Connection closed by foreign host.

            Output from logs:
            May 28 06:22:00 server1 postfix/smtpd[4588]: connect from localhost.localdomain[                                                                                        127.0.0.1]
            May 28 06:22:30 server1 postfix/smtpd[4588]: warning: non-SMTP command from localhost.localdomain[127.0.0.1]: CONNECT foo
            May 28 06:22:30 server1 postfix/smtpd[4588]: disconnect from localhost.localdomain[127.0.0.1]


            My problem is with sending emails to virtual users. It always says "unknown user".
            Please assist



            On Tue, May 28, 2013 at 4:07 AM, /dev/rob0 <rob0@...> wrote:
            On Tue, May 28, 2013 at 12:05:13AM +0200, Benny Pedersen wrote:
            > SONNY LASKAR skrev den 2013-05-27 20:05:
            > >May 27 21:57:38 server1 postfix/smtpd[2161]: connect from
            > >localhost.localdomain[127.0.0.1]
            > >May 27 21:57:41 server1 postfix/smtpd[2161]: lost connection
            > >after CONNECT from localhost.localdomain[127.0.0.1]
            > >May 27 21:57:41 server1 postfix/smtpd[2161]: disconnect from
            > >localhost.localdomain[127.0.0.1]
            >
            > do you have squid installed ?
            >
            > CONNECT is not an smtp command

            In the context above, CONNECT means that the client had initiated
            the TCP connection, but had not yet given any commands. Non-SMTP
            commands given by a client are specifically logged as such.
            --
              http://rob0.nodns4.us/ -- system administration and consulting
              Offlist GMX mail is seen only if "/dev/rob0" is in the Subject:



            --
            Regards
            Sonny
          • Noel Jones
            ... Welcome to postfix. For assistance please see: http://www.postfix.org/DEBUG_README.html#mail When posting to this list, use plain text only, no html. Do
            Message 5 of 8 , May 28, 2013
            • 0 Attachment
              On 5/27/2013 9:27 PM, SONNY LASKAR wrote:
              >
              > *My problem is with sending emails to virtual users. It always says
              > "unknown user".*
              > Please assist
              >


              Welcome to postfix. For assistance please see:
              http://www.postfix.org/DEBUG_README.html#mail

              When posting to this list, use plain text only, no html.
              Do not top-post.
            • SONNY LASKAR
              I had enabled debug for all queries on mysql but only the following relevant lines were seen: 130528 10:24:07 1924 Connect postfix@localhost on postfix 1924
              Message 6 of 8 , May 28, 2013
              • 0 Attachment
                I had enabled debug for all queries on mysql but only the following
                relevant lines were seen:
                130528 10:24:07 1924 Connect postfix@localhost on postfix
                1924 Query SELECT goto FROM alias WHERE
                address='support@...' AND active = '1'
                1924 Query SELECT goto FROM alias WHERE
                address='support@...' AND active = '1'
                130528 10:24:13 1924 Query SELECT goto FROM alias WHERE
                address='example.com' AND active = '1'
                1925 Connect postfix@localhost on postfix
                1925 Query SELECT domain FROM domain WHERE
                domain='example.com' AND backupmx = '0' AND active = '1'
                1924 Query SELECT goto FROM alias WHERE
                address='ticket@...' AND active = '1'
                1924 Query SELECT goto FROM alias WHERE
                address='example.com' AND active = '1'
                1925 Query SELECT domain FROM domain WHERE
                domain='example.com' AND backupmx = '0' AND active = '1'
                130528 10:24:24 1923 Query SET GLOBAL general_log = 0


                I am not able to figure out why it says unknown user
              • SONNY LASKAR
                I am still not able to figure out how to solve this issue. Please let me know if anyone needs any additional data.
                Message 7 of 8 , May 29, 2013
                • 0 Attachment
                  I am still not able to figure out how to solve this issue.
                  Please let me know if anyone needs any additional data.
                Your message has been successfully submitted and would be delivered to recipients shortly.