Question on adding user to user table

Discussion in 'Server Operation' started by satimis, Oct 10, 2008.

  1. satimis

    satimis Member

    Hi folks,


    Virtual MailBox
    Postfix
    MySQL
    Courier


    mysql> show tables;
    Code:
    +---------------------------+
    | Tables_in_mysql           |
    +---------------------------+
    | columns_priv              |
    | db                        |
    | func                      |
    | help_category             |
    | help_keyword              |
    | help_relation             |
    | help_topic                |
    | host                      |
    | proc                      |
    | procs_priv                |
    | tables_priv               |
    | time_zone                 |
    | time_zone_leap_second     |
    | time_zone_name            |
    | time_zone_transition      |
    | time_zone_transition_type |
    | user                      |
    +---------------------------+
    17 rows in set (0.00 sec)
    

    mysql> select user,host from user;
    Code:
    +------------------+-----------------------+
    | user             | host                  |
    +------------------+-----------------------+
    | debian-sys-maint | localhost             |
    | mail_admin       | localhost             |
    | root             | localhost             |
    | mail_admin       | localhost.localdomain |
    | root             | xen6.satimis.com      |
    +------------------+-----------------------+
    5 rows in set (0.00 sec)
    

    To add user 'satimis' to user table, whether run following commands;


    mysql -u root -p

    GRANT SELECT, INSERT, UPDATE, DELETE ON mail.* TO
    'satimis'@'satimis.com' IDENTIFIED BY 'satimis_password';
    GRANT SELECT, INSERT, UPDATE, DELETE ON mail.* TO 'satimis'@'localhost'
    IDENTIFIED BY 'satimis_password';
    GRANT SELECT, INSERT, UPDATE, DELETE ON mail.* TO
    'satimis'@'localhost.localdomain' IDENTIFIED BY 'satimis_password';
    FLUSH PRIVILEGES;


    # grep mydestination /etc/postfix/main.cf
    Code:
    mydestination = xen6.satimis.com, localhost, localhost.localdomain
    

    Do I need to add "satimis.com" on the line?

    TIA


    B.R.
    satimis
     
  2. satimis

    satimis Member

    Hi marpada,


    satimis.com is domain. xen6.satimis.com is hostname. Thanks


    satimis
     
  3. falko

    falko Super Moderator Howtoforge Staff

    If you want to receive mails for satimis.com, then you must add satimis.com to the mydestination line.
     
  4. satimis

    satimis Member

    Hi falko,


    I'm running virtual domain here. Adding satimis.com to mydestination did not help. I tried. The mail server can neither send nor receive mails. Performed following test;


    1)
    telnet localhost 25
    Code:
    .....
    RCPT TO: [email protected]
    451 4.3.0 <[email protected]>: Temporary lookup failure
    ...
    

    # tail /var/log/mail.log
    Code:
    Oct 12 08:30:39 xen6 postfix/cleanup[1655]: 2D6803D810: message-id=<[email protected]>
    Oct 12 08:30:39 xen6 postfix/proxymap[1656]: warning: mysql query failed: Unknown column 'destination' in 'field list'
    Oct 12 08:30:39 xen6 postfix/cleanup[1655]: warning: 2D6803D810: virtual_alias_maps map lookup problem for [email protected]
    Oct 12 08:31:39 xen6 postfix/pickup[1653]: 2D6853D810: uid=0 from=<root>
    Oct 12 08:31:39 xen6 postfix/cleanup[1655]: 2D6853D810: message-id=<[email protected]>
    Oct 12 08:31:39 xen6 postfix/cleanup[1655]: warning: 2D6853D810: virtual_alias_maps map lookup problem for [email protected]
    Oct 12 08:32:39 xen6 postfix/pickup[1653]: 4842B3D810: uid=0 from=<root>
    Oct 12 08:32:39 xen6 postfix/cleanup[1655]: 4842B3D810: message-id=<[email protected]>
    Oct 12 08:32:39 xen6 postfix/proxymap[1656]: warning: mysql query failed: Unknown column 'destination' in 'field list'
    Oct 12 08:32:39 xen6 postfix/cleanup[1655]: warning: 4842B3D810: virtual_alias_maps map lookup problem for [email protected]

    # postconf -n
    Code:
    alias_database = hash:/etc/aliases
    alias_maps = hash:/etc/aliases
    append_dot_mydomain = no
    biff = no
    broken_sasl_auth_clients = yes
    config_directory = /etc/postfix
    inet_interfaces = all
    mailbox_size_limit = 0
    mydestination = xen6.satimis.com, satimis.com, localhost, localhost.localdomain
    myhostname = xen6.satimis.com
    mynetworks = 127.0.0.0/8
    myorigin = /etc/mailname
    proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $virtual_mailbox_maps $virtual_mailbox_domains $relay_recipient_maps $relay_domains $canonical_maps $sender_canonical_maps $recipient_canonical_maps $relocated_maps $transport_maps $mynetworks $virtual_mailbox_limit_maps
    recipient_delimiter = +
    relayhost =
    smtp_tls_session_cache_database = btree:${queue_directory}/smtp_scache
    smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
    smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination
    smtpd_sasl_auth_enable = yes
    smtpd_tls_cert_file = /etc/postfix/smtpd.cert
    smtpd_tls_key_file = /etc/postfix/smtpd.key
    smtpd_tls_session_cache_database = btree:${queue_directory}/smtpd_scache
    smtpd_use_tls = yes
    transport_maps = proxy:mysql:/etc/postfix/mysql-virtual_transports.cf
    virtual_alias_domains =
    virtual_alias_maps = proxy:mysql:/etc/postfix/mysql-virtual_forwardings.cf, mysql:/etc/postfix/mysql-virtual_email2email.cf
    virtual_create_maildirsize = yes
    virtual_gid_maps = static:5000
    virtual_mailbox_base = /home/vmail
    virtual_mailbox_domains = proxy:mysql:/etc/postfix/mysql-virtual_domains.cf
    virtual_mailbox_limit_maps = proxy:mysql:/etc/postfix/mysql-virtual_mailbox_limit_maps.cf
    virtual_mailbox_limit_override = yes
    virtual_mailbox_maps = proxy:mysql:/etc/postfix/mysql-virtual_mailboxes.cf
    virtual_maildir_limit_message = "The user you are trying to reach is over quota."
    virtual_overquota_bounce = yes
    virtual_uid_maps = static:5000

    2)
    Send a mail to [email protected]


    Mail can't arrive.


    # tail /var/log/mail.log
    Code:
    Oct 12 08:35:39 xen6 postfix/cleanup[1655]: warning: 4842F3D810: virtual_alias_maps map lookup problem for [email protected]
    Oct 12 08:36:22 xen6 postfix/smtpd[1661]: connect from ti-out-0910.google.com[209.85.142.189]
    Oct 12 08:36:22 xen6 postfix/trivial-rewrite[1657]: warning: do not list domain satimis.com in BOTH mydestination and virtual_mailbox_domains
    Oct 12 08:36:22 xen6 postfix/proxymap[1656]: warning: mysql query failed: Unknown column 'destination' in 'field list'
    Oct 12 08:36:22 xen6 postfix/smtpd[1661]: NOQUEUE: reject: RCPT from ti-out-0910.google.com[209.85.142.189]: 451 4.3.0 <[email protected]>: Temporary lookup failure; from=<[email protected]> to=<[email protected]> proto=ESMTP helo=<ti-out-0910.google.com>
    Oct 12 08:36:22 xen6 postfix/cleanup[1655]: warning: CB03B3D810: virtual_alias_maps map lookup problem for [email protected]
    Oct 12 08:36:22 xen6 postfix/smtpd[1661]: disconnect from ti-out-0910.google.com[209.85.142.189]
    Oct 12 08:36:39 xen6 postfix/pickup[1653]: C9A593D810: uid=0 from=<root>
    Oct 12 08:36:39 xen6 postfix/cleanup[1655]: C9A593D810: message-id=<[email protected]>
    Oct 12 08:36:39 xen6 postfix/cleanup[1655]: warning: C9A593D810: virtual_alias_maps map lookup problem for [email protected]
    

    Edit:

    # postmap -q [email protected] mysql:/etc/postfix/mysql-virtual_mailboxes.cf
    No printout

    # postmap -q [email protected] mysql:/etc/postfix/mysql-virtual_mailboxes.cf
    Code:
    satimis.com/satimis/
    


    satimis
     
    Last edited: Oct 12, 2008
  5. falko

    falko Super Moderator Howtoforge Staff

    In this case satimis.com must be in the domains table only, but not in mydestination.

    What's in /etc/resolv.conf?


    Please make sure that the MySQL queries are correct in your Postfix configuration and that the table structure is correct.
     

Share This Page