Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > Server Operation

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 22nd December 2011, 00:18
AhmadElGendi AhmadElGendi is offline
Junior Member
 
Join Date: Dec 2011
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Unhappy Postfix with Virtual Users And Domains

Hello !

I followed :
http://www.howtoforge.com/virtual-us...tos-6.0-x86_64

Except:
Page4:12 Install Amavisd-new, SpamAssassin And ClamAV
Page 5:13 Install Razor, Pyzor And DCC And Configure SpamAssassin

Which I dont want them for the moment


My problem that I am unable to connect to server via POP or IMAP client as it keep asking me for the password.

------------------------------------------------------------------------------
even through SquirrelMail I receive:
ERROR: Connection dropped by IMAP server.

reviewing : /var/log/messages
I noticed:
Dec 21 22:40:57 MyDomainName authdaemond: failed to connect to mysql server (server=localhost, userid=mail_admin): Access denied for user 'mail_admin'@'localhost' (using password: YES)
Dec 21 22:40:57 MyDomainName postfix/smtpd[23400]: warning: SASL authentication failure: could not verify password

------------------------------------------------------------------------------
Also when I try to send to it the get this delivery Error:

Mail Delivery System MAILER-DAEMON@mail.MyDomain.Com to me

show details 1:23 AM (0 minutes ago)

This is the mail system at host mail.MyDomain.Com.

I'm sorry to have to inform you that your message could not
be delivered to one or more recipients. It's attached below.

For further assistance, please send mail to postmaster.

If you do so, please include this problem report. You can
delete your own text from the attached returned message.

The mail system

<ahmad@MyDomain.Com>: mail for mail.MyDomain.Com loops back to myself

Final-Recipient: rfc822; ahmad@MyDomain.Com
Original-Recipient: rfc822;ahmad@MyDomain.Com
Action: failed
Status: 5.4.6
Diagnostic-Code: X-Postfix; mail for mail.MyDomain.Com loops back to myself
--------------------------

----------------------------------------------------
I did the telnet test
telnet localhost 25
as per: http://www.howtoforge.com/virtual-us...-6.0-x86_64-p5
((


If you see the lines

250-STARTTLS

and

250-AUTH LOGIN PLAIN

everything is fine.
))
----------------------------------------------------
But it is not fine

could any one assist me please ?

Last edited by AhmadElGendi; 22nd December 2011 at 00:30.
Reply With Quote
Sponsored Links
  #2  
Old 22nd December 2011, 17:13
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,748 Times in 2,579 Posts
Default

Quote:
Originally Posted by AhmadElGendi View Post
<ahmad@MyDomain.Com>: mail for mail.MyDomain.Com loops back to myself
Please add mail.MyDomain.Com to the mydestination line in /etc/postfix/main.cf and restart Postfix.

Quote:
Dec 21 22:40:57 MyDomainName authdaemond: failed to connect to mysql server (server=localhost, userid=mail_admin): Access denied for user 'mail_admin'@'localhost' (using password: YES)
Do you use the correct password? Make sure there's no whitespace at the end of the MYSQL_USERNAME and MYSQL_PASSWORD lines.
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #3  
Old 22nd December 2011, 20:06
AhmadElGendi AhmadElGendi is offline
Junior Member
 
Join Date: Dec 2011
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

First I appreciate your valuable time to answer me.

Quote:
Originally Posted by falko View Post
Please add mail.MyDomain.Com to the mydestination line in /etc/postfix/main.cf and restart Postfix.
I verified , my line looks like this:

[root@mail ~]# hostname -a
mail.MyDomain.Com

mydestination = mail.MyDomain.Com, localhost, localhost.localdomain


------------------------------------

Do you use the correct password? Make sure there's no whitespace at the end of the MYSQL_USERNAME and MYSQL_PASSWORD lines.
Yes , the password was correct as I was able to log on MySql using MySql Query browser and remotely it was successfully logged on.
also the files I made sure of the password:

nano /etc/postfix/mysql-virtual_domains.cf

user = mail_admin
password = @XYZ99
dbname = mail
query = SELECT domain AS virtual FROM domains WHERE domain='%s'
hosts = 127.0.0.1



nano /etc/postfix/mysql-virtual_forwardings.cf
user = mail_admin
password = @XYZ99
dbname = mail
query = SELECT destination FROM forwardings WHERE source='%s'
hosts = 127.0.0.1


nano /etc/postfix/mysql-virtual_mailboxes.cf
user = mail_admin
password = @XYZ99
dbname = mail
query = SELECT CONCAT(SUBSTRING_INDEX(email,'@',-1),'/',SUBSTRING_INDEX(email,'@',1),'/') FROM users WHERE email='%s'
hosts = 127.0.0.1



nano /etc/postfix/mysql-virtual_email2email.cf
user = mail_admin
password = @XYZ99
dbname = mail
query = SELECT email FROM users WHERE email='%s'
hosts = 127.0.0.1

/etc/postfix/mysql-virtual_transports.cf
user = mail_admin
password = @XYZ99
dbname = mail
query = SELECT transport FROM transport WHERE domain='%s'
hosts = 127.0.0.1



/etc/postfix/mysql-virtual_mailbox_limit_maps.cf

user = mail_admin
password = @XYZ99
dbname = mail
query = SELECT quota FROM users WHERE email='%s'
hosts = 127.0.0.1


nano /etc/authlib/authmysqlrc
MYSQL_SERVER localhost
MYSQL_USERNAME mail_admin
MYSQL_PASSWORD @XYZ99
-------------
Is the problem as my password starts with '@ ' ?
or because of the space aster the '='

Vielen Dank
Reply With Quote
  #4  
Old 23rd December 2011, 12:59
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,748 Times in 2,579 Posts
Default

Quote:
Originally Posted by AhmadElGendi View Post
Is the problem as my password starts with '@ ' ?
Yes, that might be the problem. Maybe you have to escape it with a backslash (or use another password).
Quote:
Originally Posted by AhmadElGendi View Post
or because of the space aster the '='
No, I don't think so.
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #5  
Old 23rd December 2011, 18:56
AhmadElGendi AhmadElGendi is offline
Junior Member
 
Join Date: Dec 2011
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hello Falko

I changed the password so it starts with a letter

in: /var/log/maillog
When I try to connect via OutlookExpress or Squirrel Mail I get the below log:
============================
Dec 23 17:19:20 MyDomain imapd: Connection, ip=[::ffff:127.0.0.1]
Dec 23 17:19:20 MyDomain authdaemond: failed to connect to mysql server (server=localhost, userid=mail_admin): Access denied for user 'mail_admin'@'localhost' (using password: YES)
Dec 23 17:19:20 MyDomain imapd: LOGIN FAILED, user=ahmed@MyDomain.com, ip=[::ffff:127.0.0.1]
Dec 23 17:19:20 MyDomain imapd: authentication error: Input/output error
Dec 23 17:20:45 MyDomain pop3d: Connection, ip=[::ffff:109.161.165.113]
Dec 23 17:20:45 MyDomain authdaemond: failed to connect to mysql server (server=localhost, userid=mail_admin): Access denied for user 'mail_admin'@'localhost' (using password: YES)
Dec 23 17:20:45 MyDomain pop3d: LOGIN FAILED, user=ahmed@MyDomain.com, ip=[::ffff:109.151.145.213]
Dec 23 17:20:45 MyDomain pop3d: authentication error: Input/output error
Dec 23 17:21:18 MyDomain imapd: Connection, ip=[::ffff:127.0.0.1]
Dec 23 17:21:18 MyDomain authdaemond: failed to connect to mysql server (server=localhost, userid=mail_admin): Access denied for user 'mail_admin'@'localhost' (using password: YES)
Dec 23 17:21:18 MyDomain imapd: LOGIN FAILED, user=ahmed@MyDomain.com, ip=[::ffff:127.0.0.1]
Dec 23 17:21:18 MyDomain imapd: authentication error: Input/output error
==============================

**I believe that problem it uses: authdaemond that is not installed !
service authdaemond restart
authdaemond: unrecognized service
but my Imap is using /etc/init.d/courier-authlib

** I feel that I imapd is unable to authenticate against mysql !!

** I have stopped iptables as well but sounds like there is something stopping SMTP for remote telnet !!

** using mailx to Send A Welcome Email For Creating Maildir, I noted that no mail directories are created under /home/vmail !!
Any Idea ?

Last edited by AhmadElGendi; 23rd December 2011 at 19:44.
Reply With Quote
  #6  
Old 24th December 2011, 12:41
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,748 Times in 2,579 Posts
Default

Can you log into MySQL like this?
Code:
mysql -u mail_admin -p
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #7  
Old 24th December 2011, 19:14
AhmadElGendi AhmadElGendi is offline
Junior Member
 
Join Date: Dec 2011
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

---> mysql -u mail_admin -p
Yes I was able to locally and remotely login with the mail_admin password.

----------------------------------------------
For squirrel I see the change_sqlpass plugin is there but I believe it is not working although I did follow the article but it looks not working as expected

Plugins
Installed Plugins
1. delete_move_next
2. squirrelspell
3. newmail
4. compatibility
5. change_sqlpass

=========================
SquirrelMail configtest

This script will try to check some aspects of your SquirrelMail configuration and point you to errors whereever it can find them. You need to go run conf.pl in the config/ directory first before you run this script.

SquirrelMail version: 1.4.22-2.el6
Config file version: 1.4.0
Config file last modified: 24 December 2011 08:31:29
Checking PHP configuration...
PHP version 5.3.3 OK.
Running as N/A(N/A) / N/A(N/A)
display_errors:
error_reporting: 22527
variables_order OK: GPCS.
PHP extensions OK. Dynamic loading is disabled.

ERROR: You have configured PHP not to allow short tags (short_open_tag=off). This shouldn't be a problem with SquirrelMail or any plugin coded coded according to the SquirrelMail Coding Guidelines, but if you experience problems with PHP code being displayed in some of the pages and changing setting to "on" solves the problem, please file a bug report against the failing plugin. The correct contact information is most likely to be found in the plugin documentation.
Checking paths...
Data dir OK.
Attachment dir OK.
Plugins OK.
Themes OK.
Default language OK.
Base URL detected as: https://86.143.157.79/webmail/src (location base autodetected)
Checking outgoing mail service....
sendmail OK
Checking IMAP service....
IMAP server ready (* OK [CAPABILITY IMAP4rev1 UIDPLUS CHILDREN NAMESPACE THREAD=ORDEREDSUBJECT THREAD=REFERENCES SORT QUOTA IDLE ACL ACL2=UNION STARTTLS] Courier-IMAP ready. Copyright 1998-2011 Double Precision, Inc. See COPYING for distribution information.)
Capabilities: * CAPABILITY IMAP4rev1 UIDPLUS CHILDREN NAMESPACE THREAD=ORDEREDSUBJECT THREAD=REFERENCES SORT QUOTA IDLE ACL ACL2=UNION STARTTLS
Checking internationalization (i18n) settings...
gettext - Gettext functions are available. On some systems you must have appropriate system locales compiled.
mbstring - Mbstring functions are available.
recode - Recode functions are unavailable.
iconv - Iconv functions are available.
timezone - Webmail users can change their time zone settings.
Checking database functions...
not using database functionality.
=========================


see the config above , it can not detect the DB funstionality functionality, thats why I get:

ERROR: Connection dropped by IMAP server.


Falko can I send you logins in private message ?

Last edited by AhmadElGendi; 24th December 2011 at 19:19.
Reply With Quote
  #8  
Old 25th December 2011, 10:02
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,748 Times in 2,579 Posts
Default

My guess is that you left out important parts of the tutorial, but it's hard for me to tell where the error is. If you follow the tutorial from beginning to end, everything should be fine (it's working for me).
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #9  
Old 26th December 2011, 03:35
White White is offline
Member
 
Join Date: Apr 2008
Posts: 65
Thanks: 0
Thanked 0 Times in 0 Posts
 
Default

have you set your router to allow traffic to the ports 110 and 25 also 10025
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Getting Email Working ISPConfig3 Squirrelmail and Courier etc Ian Wilson Installation/Configuration 17 19th June 2013 23:58
Postfix/courier/Centos 6 cant send email to external email servers maxtorzito Installation/Configuration 14 7th October 2011 11:56
Virtual Users And Domains With Postfix, Courier, MySQL And SquirrelMail-Problema jz_ HOWTO-Related Questions 9 14th September 2011 14:31
Postfix SMTP Auth to Dovecot Not Working -- HELP! Scratchpad Server Operation 6 12th April 2011 14:29
localhost postfix/master: fatal: bind 127.0.0.1 port 125: Permission denied g18c Installation/Configuration 4 24th March 2009 18:39


All times are GMT +2. The time now is 02:45.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.