PDA

View Full Version : Centos 5.1 Virtual Mail Server Issues


tmaleshafske
18th February 2008, 20:56
Hello everyone.. I just got done following Virtual Users And Domains With Postfix, Courier And MySQL (CentOS 5.1)

everything seems to be working but i can't login to download emails with Thunderbird.

when I look in the log files i get the following error message:
Feb 18 12:05:15 maleshafske pop3d: LOGIN FAILED, user=test@maleshafske.com, ip=[::ffff:192.168.1.22]

I also notice a chain of more error messages related to amavis:
Feb 18 12:21:46 maleshafske amavis[4654]: (04654-01) (!)connect_to_sql: unable to connect to DSN 'DBI:mysql:database=mail;host=127.0.0.1;port=3306' : Access denied for user 'mail_admin'@'localhost' (using password: YES)
Feb 18 12:21:46 maleshafske amavis[4654]: (04654-01) (!!)TROUBLE in process_request: connect_to_sql: unable to connect to any dataset at (eval 76) line 244, <GEN9> line 5.
Feb 18 12:21:46 maleshafske amavis[4654]: (04654-01) (!)Requesting process rundown after fatal error
Feb 18 12:21:46 maleshafske amavis[4762]: (04762-01) (!)connect_to_sql: unable to connect to DSN 'DBI:mysql:database=mail;host=127.0.0.1;port=3306' : Access denied for user 'mail_admin'@'localhost' (using password: YES)
Feb 18 12:21:46 maleshafske amavis[4762]: (04762-01) (!!)TROUBLE in process_request: connect_to_sql: unable to connect to any dataset at (eval 76) line 244, <GEN9> line 5.
Feb 18 12:21:46 maleshafske amavis[4762]: (04762-01) (!)Requesting process rundown after fatal error


here is my output from postconf -n
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
broken_sasl_auth_clients = yes
command_directory = /usr/sbin
config_directory = /etc/postfix
content_filter = amavis:[127.0.0.1]:10024
daemon_directory = /usr/libexec/postfix
debug_peer_level = 2
html_directory = no
inet_interfaces = all
mail_owner = postfix
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
mydestination = males001.maleshafske.com, localhost, localhost.localdomain
myhostname = males001.maleshafske.com
mynetworks = 127.0.0.0/8
newaliases_path = /usr/bin/newaliases.postfix
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
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/postfix-2.3.3/README_FILES
receive_override_options = no_address_mappings
sample_directory = /usr/share/doc/postfix-2.3.3/samples
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
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_use_tls = yes
transport_maps = proxy:mysql:/etc/postfix/mysql-virtual_transports.cf
unknown_local_recipient_reject_code = 550
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



Anyone have any ideas?

topdog
18th February 2008, 21:23
postfix is unable to access the database, that is why. Please double check your account details for the mail_admin user.

tmaleshafske
18th February 2008, 21:30
I have no issues with logging in to the database using the username mail_admin via php so I don't believe it is a rights issue. I have reverified all created .cf and all are pointed towards mail_admin with the correct password.

how do I check with SQL commands to verify...I am new to linux and to SQL

tmaleshafske
18th February 2008, 21:38
well I think I found the problem, just not sure how to fix it.

When I looked a little closer in phpmyadmin, I noticed that mail_admin is actually mail_admin@localhost
Everything in postfix points to 127.0.0.1

Could this be the cause?
If so how do I go about fixing it.

tmaleshafske
19th February 2008, 03:27
So I scrapped the install and started over:
Got everything loaded up. but still have issues. here is an excerpt from my maillog file

Feb 18 19:10:58 adsl-75-18-14-103 authdaemond: failed to connect to mysql server (server=localhost, userid=mail_admin): Access denied for user 'mail_admin'@'localhost' (using password: YES)
Feb 18 19:10:58 adsl-75-18-14-103 pop3d: LOGIN FAILED, user=test@maleshafske.com, ip=[::ffff:75.18.14.103]
Feb 18 19:10:58 adsl-75-18-14-103 pop3d: authentication error: Input/output error


I looked at /etc/authlib/authdaemonrc it looks like this:

##NAME: authmodulelist:2

authmodulelist="authmysql"
#authmodulelist="authuserdb authpam authpgsql authldap authmysql authcustom authpipe"

##NAME: authmodulelistorig:3
authmodulelistorig="authuserdb authpam authpgsql authldap authmysql authcustom authpipe"

##NAME: daemons:0
daemons=5

##NAME: authdaemonvar:2
authdaemonvar=/var/spool/authdaemon

##NAME: DEBUG_LOGIN:0

DEBUG_LOGIN=0

##NAME: DEFAULTOPTIONS:0

DEFAULTOPTIONS=""

##NAME: LOGGEROPTS:0

LOGGEROPTS=""

I also included /etc/authlib/authmysqlrc:
MYSQL_SERVER localhost
MYSQL_USERNAME mail_admin
MYSQL_PASSWORD ########
MYSQL_PORT 0
MYSQL_DATABASE mail
MYSQL_USER_TABLE users
MYSQL_CRYPT_PWFIELD password
#MYSQL_CLEAR_PWFIELD password
MYSQL_UID_FIELD 5000
MYSQL_GID_FIELD 5000
MYSQL_LOGIN_FIELD email
MYSQL_HOME_FIELD "/home/vmail"
MYSQL_MAILDIR_FIELD CONCAT(SUBSTRING_INDEX(email,'@',-1),'/',SUBSTRING_INDEX(email,'@',1),'/')
#MYSQL_NAME_FIELD
MYSQL_QUOTA_FIELD quota

So stumped again. I am going to go back and look at the different postfix files and make sure that it isn't any of those.

tmaleshafske
19th February 2008, 04:20
Now its a rights issues. I can no way log in to the sql server with mail_admin.

How do I fix it?

tmaleshafske
19th February 2008, 05:44
The rights issue is fixed...not the ideal way either, but fixed. I still need to know how to update the rights of mail_admin.

Now I'm having two additional errors:

1. user can't connect to mail box maillog shows the following error:
Feb 18 21:39:12 males001 pop3d: Connection, ip=[::ffff:75.18.14.103]
Feb 18 21:39:18 males001 pop3d: chdir maleshafske.com/test/: No such file or directory
Feb 18 21:39:23 males001 postfix/qmgr[2820]: warning: connect to transport males001.maleshafske.com: No such file or directory
Feb 18 21:40:23 males001 postfix/qmgr[2820]: warning: connect to transport males001.maleshafske.com: No such file or directory

2. incoming mail doesn't get to vmail directory it just gets tied up at my dns host that I have as a relay. Here is the maillog report for an email i sent to test@maleshafske.com from yahoo:

Feb 18 21:23:03 males001 postfix/smtpd[3712]: connect from mhfr-03-bos.mailhop.org[63.208.196.167]
Feb 18 21:23:04 males001 postfix/smtpd[3712]: 16E44C3580DE: client=mhfr-03-bos.mailhop.org[63.208.196.167]
Feb 18 21:23:04 males001 postfix/smtpd[3712]: disconnect from mhfr-03-bos.mailhop.org[63.208.196.167]
Feb 18 21:23:13 males001 postfix/smtpd[3712]: connect from mhfr-03-bos.mailhop.org[63.208.196.167]
Feb 18 21:23:14 males001 postfix/smtpd[3712]: 14C09C3580DE: client=mhfr-03-bos.mailhop.org[63.208.196.167]
Feb 18 21:23:14 males001 postfix/cleanup[3720]: 14C09C3580DE: message-id=<49169.5071.qm@web82007.mail.mud.yahoo.com>
Feb 18 21:23:14 males001 postfix/qmgr[2820]: 14C09C3580DE: from=<staring_up_at_the_stars_in_war21@yahoo.com>, size=2108, nrcpt=1 (queue active)
Feb 18 21:23:14 males001 postfix/smtpd[3712]: disconnect from mhfr-03-bos.mailhop.org[63.208.196.167]
Feb 18 21:23:23 males001 postfix/qmgr[2820]: warning: connect to transport males001.maleshafske.com: No such file or directory
Feb 18 21:23:29 males001 postfix/smtpd[3729]: connect from unknown[127.0.0.1]
Feb 19 03:23:29 males001 postfix/smtpd[3729]: 6122DC3580E1: client=unknown[127.0.0.1]
Feb 18 21:23:29 males001 postfix/cleanup[3720]: 6122DC3580E1: message-id=<49169.5071.qm@web82007.mail.mud.yahoo.com>
Feb 18 21:23:29 males001 postfix/qmgr[2820]: 6122DC3580E1: from=<staring_up_at_the_stars_in_war21@yahoo.com>, size=2557, nrcpt=1 (queue active)
Feb 19 03:23:29 males001 postfix/smtpd[3729]: disconnect from unknown[127.0.0.1]
Feb 18 21:23:29 males001 amavis[2971]: (02971-01) Passed CLEAN, [63.208.196.167] [75.18.14.103] <staring_up_at_the_stars_in_war21@yahoo.com> -> <test1@maleshafske.com>, Message-ID: <49169.5071.qm@web82007.mail.mud.yahoo.com>, mail_id: DmKzMI4f0bri, Hits: 1.25, size: 2107, queued_as: 6122DC3580E1, 15239 ms
Feb 18 21:23:29 males001 postfix/smtp[3721]: 14C09C3580DE: to=<test1@maleshafske.com>, relay=127.0.0.1[127.0.0.1]:10024, delay=15, delays=0.09/0.01/0.01/15, dsn=2.0.0, status=sent (250 2.0.0 Ok: queued as 6122DC3580E1)
Feb 18 21:23:29 males001 postfix/qmgr[2820]: 6122DC3580E1: to=<test1@maleshafske.com>, relay=none, delay=0.05, delays=0.01/0.04/0/0, dsn=4.3.0, status=deferred (mail transport unavailable)
Feb 18 21:23:29 males001 postfix/qmgr[2820]: 14C09C3580DE: removed
Feb 18 21:24:23 males001 postfix/qmgr[2820]: warning: connect to transport males001.maleshafske.com: No such file or directory
Feb 18 21:25:23 males001 postfix/qmgr[2820]: warning: connect to transport males001.maleshafske.com: No such file or directory


Both instances point to an issue with postfix, also when i look /home/vmail/ there are no directories or mail box.

further up is my postconf.cf

tmaleshafske
19th February 2008, 06:34
Well I am a dumb ass....to all you newbies out there don't make the same mistake I did.

In my mail database I had an entry in transport that was equal to the transport in postfix i.e.
males001.maleshafske.com which were looping back or canceling each other out however you want to look at it.

As far as the other problem with the mailboxes another reboot resolved the issue.

It is working great now.