About mail delivery

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

  1. satimis

    satimis Member

    Hi folks,


    I follow;
    Virtual Users And Domains With Postfix, Courier And MySQL (Debian Etch)
    http://www.howtoforge.com/virtual_users_and_domains_with_postfix_debian_etch


    building this mail server running as domU (guest) on a Xen box witn Debian Etch as Host. I have completed all steps except "13 Populate The Database And Test";
    http://www.howtoforge.com/virtual_users_and_domains_with_postfix_debian_etch_p6


    Some minor problem encountered during installation which I'm not prepared mentioning here.


    1)
    The mail server can send mails via telnet and receive mails addressed to [email protected] and [email protected] and deliver the same on /var/mail/satimis file. All incoming mails are added continuously here. Please advise how to get incoming mails delivered to /home/vmail/ as separate mails, not being added on a file.


    2)
    Mail client, Evolution, running on Host can't login to send/receive mails. No password can satisfy on login.


    # tail /var/log/mail.log
    Code:
    Oct 22 21:48:31 xen02 postfix/smtpd[2005]: connect from unknown[220.232.213.178]
    Oct 22 21:48:43 xen02 courierpop3login: LOGIN FAILED, user=satimis, ip=[::ffff:220.232.213.178]
    Oct 22 21:48:51 xen02 postfix/smtpd[2008]: connect from 118-167-137-80.dynamic.hinet.net[118.167.137.80]
    Oct 22 21:48:53 xen02 postfix/smtpd[2005]: warning: unknown[220.232.213.178]: SASL LOGIN authentication failed: authentication failure
    Oct 22 21:48:53 xen02 postfix/smtpd[2008]: NOQUEUE: reject: RCPT from 118-167-137-80.dynamic.hinet.net[118.167.137.80]: 554 5.7.1 <[email protected]>: Relay access denied; from=<[email protected]> to=<[email protected]> proto=SMTP helo=<220.232.213.178>
    Oct 22 21:48:53 xen02 postfix/smtpd[2008]: lost connection after RCPT from 118-167-137-80.dynamic.hinet.net[118.167.137.80]
    Oct 22 21:48:53 xen02 postfix/smtpd[2008]: disconnect from 118-167-137-80.dynamic.hinet.net[118.167.137.80]
    Oct 22 21:48:54 xen02 postfix/anvil[1857]: statistics: max connection rate 1/60s for (smtp:118.167.137.80) at Oct 22 21:39:18
    Oct 22 21:48:54 xen02 postfix/anvil[1857]: statistics: max connection count 1 for (smtp:118.167.137.80) at Oct 22 21:39:18
    Oct 22 21:48:54 xen02 postfix/anvil[1857]: statistics: max cache size 2 at Oct 22 21:48:52
    

    # cat /etc/default/saslauthd
    Code:
    START=yes
    
    MECHANISMS="pam"
    
    MECH_OPTIONS=""
    
    THREADS=5
    
    OPTIONS="-c -m /var/spool/postfix/var/run/saslauthd -r"
    

    Please advise how to fix the problem. TIA


    B.R.
    satimis
     
  2. falko

    falko Super Moderator Howtoforge Staff

    It seems you have an error somewhere in your configuration files. Please compare them again with the ones from the tutorial.
     
  3. satimis

    satimis Member

    Hi falko,


    Rechecked notes taken on installation again your howto. Still failed.


    1)
    Incoming mails to [email protected] still delivered/added to /var/mail/satimis file


    2)
    Evolution running on Host of the Xen box still can't login

    # tail /var/log/mail.log
    Code:
    Oct 24 19:26:15 xen02 courierpop3login: Connection, ip=[::ffff:192.168.0.110]
    Oct 24 19:26:31 xen02 courierpop3login: LOGIN FAILED, user=satimis, ip=[::ffff:192.168.0.110]
    Oct 24 19:26:46 xen02 courierpop3login: LOGIN FAILED, user=satimis, ip=[::ffff:192.168.0.110]
    Oct 24 19:28:02 xen02 courierpop3login: LOGOUT, ip=[::ffff:192.168.0.110]
    Oct 24 19:28:02 xen02 courierpop3login: Disconnected, ip=[::ffff:192.168.0.110]
    Oct 24 19:29:02 xen02 courierpop3login: Connection, ip=[::ffff:192.168.0.110]
    Oct 24 19:29:02 xen02 postfix/smtpd[1916]: connect from xen0.satimis.com[192.168.0.110]
    Oct 24 19:29:21 xen02 courierpop3login: LOGIN FAILED, user=satimis, ip=[::ffff:192.168.0.110]
    Oct 24 19:29:35 xen02 postfix/smtpd[1916]: warning: SASL authentication failure: cannot connect to saslauthd server: Connection refused
    Oct 24 19:29:35 xen02 postfix/smtpd[1916]: warning: xen0.satimis.com[192.168.0.110]: SASL LOGIN authentication failed: generic failure
    
    satimis is the system user. It is not on mysql user table. Does it matter? Shall I add it to mysql user table? If YES please advise how to make it? TIA


    Discovery found during rechecking;

    According to the notes, I did run following commands;
    Code:
    postconf -e 'virtual_create_maildirsize = yes'
    postconf -e 'virtual_mailbox_extended = yes'
    postconf -e 'virtual_mailbox_limit_maps = proxy:mysql:/etc/postfix/mysql-virtual_mailbox_limit_maps.cf'
    postconf -e 'virtual_mailbox_limit_override = yes'
    postconf -e 'virtual_maildir_limit_message = "The user you are trying to reach is over quota."'
    postconf -e 'virtual_overquota_bounce = yes'
    
    However on running;
    Code:
    # postconf -n
    they are NOT displayed. They are on /etc/postfix/main.cf


    # 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
    content_filter = amavis:[127.0.0.1]:10024
    inet_interfaces = all
    mailbox_size_limit = 0
    		mydestination = xen02.satimis.com, localhost, localhost.localdomain $mydomain
    myhostname = xen02.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
    
    receive_override_options = no_address_mappings
    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_gid_maps = static:5000
    		virtual_mailbox_base = /home/vmail
    		virtual_mailbox_domains = proxy:mysql:/etc/postfix/mysql-virtual_domains.cf
    		virtual_mailbox_maps = proxy:mysql:/etc/postfix/mysql-virtual_mailboxes.cf
    		virtual_uid_maps = static:5000
    
    Those lines indented are required by the Howto. Those lines without indent came after installing postfix.


    Shall I comment them out?


    Edit:

    On etc/spamassassin/local.cf only having following entry
    Code:
    #pyzor
    use_pyzor 1
    pyzor_path /usr/bin/pyzor
    pyzor_add_header 1
    
    #razor
    use_razor2 1
    razor_config /etc/razor/razor-agent.conf
    
    #bayes
    use_bayes 1
    use_bayes_rules 1
    bayes_auto_learn 1
    
    because dcc-client NOT available on repo


    B.R.
    satimis
     
    Last edited: Oct 24, 2008
  4. falko

    falko Super Moderator Howtoforge Staff

    Yes, that is the problem. You can delete that system user and create it as a virtual user.

    Please run
    Code:
    adduser postfix sasl
    /etc/init.d/postfix restart
    /etc/init.d/saslauthd start
     
  5. satimis

    satimis Member

    But I need to retain it for other system work. Is there any solution? If NO then I'll create a virtual user "satimis2" running;

    $ mysql -u root -p
    Code:
    mysql> USE mail;
    mysql> GRANT ALL PRIVILEGES ON `mail`.* TO satimis2 IDENTIFIED BY 'satimis2_password';
    mysql> FLUSH PRIVILEGES;
    mysql> quit;
    

    postfix is already on sasl group

    # grep sasl /etc/group
    Code:
    sasl:x:45:postfix
    

    B.R.
    satimis
     
  6. falko

    falko Super Moderator Howtoforge Staff

    You don't have to create a user satimis2 in the mysql.user table, but you must create a new email address in the mail database.
     
  7. satimis

    satimis Member

    Thanks


    A)
    Still fail. Incoming mails delivered to /var/mail/satimis file accumlated.


    Performed following tests;


    mysql> Use mysql/mail

    1)
    mysql> GRANT all privileges on mail.* TO satimis@localhost IDENTIFIED BY 'mypassword';
    Query OK, 0 rows affected (0.00 sec)

    mysql> GRANT all privileges on mail.* TO [email protected] IDENTIFIED BY 'mypassword';
    Query OK, 0 rows affected (0.00 sec)


    2)
    mysql> USE mysql;
    mysql> INSERT INTO `users` (`email`, `password`) VALUES ('[email protected]', ENCRYPT('mypassword'));
    Code:
    ERROR 1146 (42S02): Table 'mysql.users' doesn't exist
    
    mysql> USE mail
    mysql> INSERT INTO `users` (`email`, `password`) VALUES ('[email protected]', ENCRYPT('mypassword'));
    Query OK, 1 row affected (0.00 sec)


    mysql> FLUSH PRIVILEGES;


    reload mysql and postfix including reboot the guest.


    mysql> USE mysql;
    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> USE mail
    mysql> show tables;
    Code:
    +----------------+
    | Tables_in_mail |
    +----------------+
    | domains        |
    | forwardings    |
    | transport      |
    | users          |
    +----------------+
    4 rows in set (0.00 sec)

    mysql> SELECT * from users;
    Code:
    +---------------------+---------------+----------+
    | email               | password      | quota    |
    +---------------------+---------------+----------+
    | [email protected] | hTxpq8Ul9h7o2 | 10485760 |
    +---------------------+---------------+----------+
    1 row in set (0.06 sec)
    

    B)
    Mail client 'Evolution' running on HOST unables to login to send/receive mails. It can send/receive mails via another guest on the Xen box without problem after forwarding all ports to the said guest.


    B.R.
    satimis
     
  8. falko

    falko Super Moderator Howtoforge Staff

    You will have the same problem as before because satimis is already a system user... [email protected] should work, for example.
     
  9. satimis

    satimis Member

    Performed following steps;


    # mysql -u root -p
    Enter password:

    mysql> USE mail;

    mysql> INSERT INTO `users` (`email`, `password`) VALUES ('[email protected]', ENCRYPT('mypassword'));
    Query OK, 1 row affected (0.04 sec)

    mysql> FLUSH PRIVILEGES;
    Query OK, 0 rows affected (0.01 sec)


    mysql> show tables
    Code:
        -> ;
    +----------------+
    | Tables_in_mail |
    +----------------+
    | domains        |
    | forwardings    |
    | transport      |
    | users          |
    +----------------+
    4 rows in set (0.00 sec)
    

    mysql> SELECT * from users;
    Code:
    +----------------------+---------------+----------+
    | email                | password      | quota    |
    +----------------------+---------------+----------+
    | [email protected]  | hTxpq8Ul9h7o2 | 10485760 |
    | [email protected] | 38/J4Au1brfIo | 10485760 |
    +----------------------+---------------+----------+
    2 rows in set (0.00 sec)
    
    reload postfix and mysql as well


    mails sent to [email protected] on Yahoo and Gmail all rejected.


    Continued;

    # mysql -u root -p

    mysql> USE mysql;

    mysql> GRANT all privileges on mail.* TO satimis2@localhost IDENTIFIED BY 'mypassword';
    Query OK, 0 rows affected (0.00 sec)

    mysql> GRANT all privileges on mail.* TO [email protected] IDENTIFIED BY 'mypassword';
    Query OK, 0 rows affected (0.00 sec)

    mysql> FLUSH PRIVILEGES;
    Query OK, 0 rows affected (0.00 sec)


    Reload postfix and mysql.


    Problem remains, all mails rejected.


    # tail /var/log/mail.log
    Code:
    Oct 30 20:10:35 xen02 postfix/qmgr[1876]: 653F73C1EE: from=<>, size=4035, nrcpt=1 (queue active)
    Oct 30 20:10:35 xen02 postfix/qmgr[1876]: 2662A3C1E5: removed
    Oct 30 20:10:35 xen02 postfix/smtp[1934]: 063693C1E4: to=<[email protected]>, relay=127.0.0.1[127.0.0.1]:10024, delay=19, delays=0.17/0.01/0.39/18, dsn=2.6.0, status=sent (250 2.6.0 Ok, id=01421-04, from MTA([127.0.0.1]:10025): 250 2.0.0 Ok: queued as 2662A3C1E5)
    Oct 30 20:10:35 xen02 postfix/qmgr[1876]: 063693C1E4: removed
    Oct 30 20:10:36 xen02 postfix/smtp[1940]: 653F73C1EE: to=<[email protected]>, relay=gmail-smtp-in.l.google.com[209.85.143.114]:25, delay=1.2, delays=0.13/0.05/0.31/0.7, dsn=2.0.0, status=sent (250 2.0.0 OK 1225368437 i6si2890163tid.5)
    Oct 30 20:10:36 xen02 postfix/qmgr[1876]: 653F73C1EE: removed
    Oct 30 20:10:40 xen02 postfix/smtp[1918]: 888883C1EC: conversation with c.mx.mail.yahoo.com[216.39.53.2] timed out while receiving the initial server greeting
    Oct 30 20:10:41 xen02 postfix/smtp[1918]: 888883C1EC: host f.mx.mail.yahoo.com[209.191.88.247] refused to talk to me: 421 Message from (220.232.213.178) temporarily deferred - 4.16.50. Please refer to http://help.yahoo.com/help/us/mail/defer/defer-06.html
    Oct 30 20:10:41 xen02 postfix/smtp[1918]: 888883C1EC: to=<[email protected]>, relay=f.mx.mail.yahoo.com[68.142.202.247]:25, delay=335, delays=0/0.02/335/0, dsn=4.0.0, status=deferred (host f.mx.mail.yahoo.com[68.142.202.247] refused to talk to me: 421 Message from (220.232.213.178) temporarily deferred - 4.16.50. Please refer to http://help.yahoo.com/help/us/mail/defer/defer-06.html)
    Oct 30 20:10:47 xen02 postfix/smtpd[1929]: disconnect from ti-out-0910.google.com[209.85.142.184]
    

    satimis
     
  10. falko

    falko Super Moderator Howtoforge Staff

  11. satimis

    satimis Member

    Have check the external IP.


    All items are OK except follows;
    Code:
    HILLI	Listed	TIMEOUT	Return codes were: ERROR, Reponse code=2 	0	0
    INFORMATIONWAVE	Listed	TIMEOUT	 	0	0
    NJABLDYNA	Listed	TIMEOUT	 	0	0
    SNARK	Listed	TIMEOUT	Return codes were: ERROR, Reponse code=2 	0	0
    SOLID	Listed	TIMEOUT	Return codes were: ERROR, Reponse code=2 	0	0
    US	Listed	TIMEOUT	 	0	0
    
    I have another domU running postfix. The mail server can send/receive mails without problem. Only those domU running postfix virtual have problem.


    satimis
     
  12. falko

    falko Super Moderator Howtoforge Staff

    You can try to contact the list maintainers to get de-listed.

    IS it using a different IP? Is that IP blacklisted?
     
  13. satimis

    satimis Member

    Hi falko,


    No, same IP, absolutely sure, on the same Xen box.


    Just tested it. Incoming mails delivered to /home/user/Maildir/new/

    Telnet mails to yahoo and gmail. All mails received immediately without problem.

    Mail client running on HOST can send/receive mails via this server. Login without problem.


    B.R.
    satimis
     
  14. falko

    falko Super Moderator Howtoforge Staff

    According to http://help.yahoo.com/help/us/mail/defer/defer-06.html your mails are blocked because your IP is blacklisted, so I don't know why emails from your other VM (with exactly the same IP address) are not blocked. Are you sure that both VMs are using exactly the same IP?
     
  15. satimis

    satimis Member

    Yes, 100% sure, same external IP. I have only one external IP for testing.


    Connection:
    Xen box --> router --> ISP


    xen4.satimis.com - a working mail server
    local IP : 192.168.0.114

    xen02.satimis.com - the problem mail server
    local IP : 192.168.0.202


    Internet Webmail servers used for this testing
    Yahoo
    Gmail
    ISP


    I only switch/forward ports to the server under testing.


    satimis
     

Share This Page