LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-27-2009, 01:29 PM   #1
avandenbroeck
LQ Newbie
 
Registered: May 2008
Posts: 8

Rep: Reputation: 1
postfix,mysql,dovecot squirelmail


After struggling with the postix mysql and dovecot configuration, and thanks to several how to's, I was able to get mail working properly.

But now I am confronted with the implementation and configuration of squirrelmail, and setting the configuation parameters so it can use the mysql database already set up for postfix and dovecot. any suggestions ?
 
Old 09-27-2009, 05:59 PM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,516

Rep: Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501
Hi and welcome to LQ

If postfix-dovecot-mysql are working together OK, then you have to do almost nothing to configure squirrelmail.
Run the conf.pl script and on "Server Settings" menu specify your domain (option 1), select SMTP (option 3), give your servers's name (opition 4), define dovecot as server software (option 8) and you're done. Of course you can take a look at all the other options and maybe change some of them to better fit your needs.

Regards

Last edited by bathory; 09-28-2009 at 12:53 AM.
 
Old 09-30-2009, 03:20 PM   #3
avandenbroeck
LQ Newbie
 
Registered: May 2008
Posts: 8

Original Poster
Rep: Reputation: 1
Quote:
Originally Posted by bathory View Post
Hi and welcome to LQ

If postfix-dovecot-mysql are working together OK, then you have to do almost nothing to configure squirrelmail.
Run the conf.pl script and on "Server Settings" menu specify your domain (option 1), select SMTP (option 3), give your servers's name (opition 4), define dovecot as server software (option 8) and you're done. Of course you can take a look at all the other options and maybe change some of them to better fit your needs.

Regards
Thanks, after playing with the /var/lib/squirrelmail directory and the data and prefs directories I can login with no problem.

The poblem now is that I can not read the mail via the folders in squirrelmail. I can login into squirrel mail and compose a mail message, and read it at the system level.

But how do I point squirrelmail to read the directories under /var/vmail/'domain'/'user' were is where all emails go to?
 
Old 09-30-2009, 05:57 PM   #4
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,516

Rep: Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501
Squirrelmail depends on dovecot to retrieve mail. If your postfix-mysql-dovecot setup works, then squirrelmail should work too. Have you done any tests to see if you can get mail using an imap client like Thunderbid?
Anyway, according to this howto, that does the same setup as yours, you have to use
Code:
mail_location = maildir:/var/vmail/%d/%u
in dovecot.conf.
 
Old 10-03-2009, 01:08 PM   #5
avandenbroeck
LQ Newbie
 
Registered: May 2008
Posts: 8

Original Poster
Rep: Reputation: 1
Quote:
Originally Posted by bathory View Post
Squirrelmail depends on dovecot to retrieve mail. If your postfix-mysql-dovecot setup works, then squirrelmail should work too. Have you done any tests to see if you can get mail using an imap client like Thunderbid?
Anyway, according to this howto, that does the same setup as yours, you have to use
Code:
mail_location = maildir:/var/vmail/%d/%u
in dovecot.conf.
Thanks again for input. The how to you send was pertinent to a new version of dovecot, but configuration wise was very similar, just minor differences in the commands. I did massage the dovecot.conf and the dovecot-mysql.conf, but nothing I can still login into squirrelmail and send messages but can not read messages. In any event here is my configuration if anyone can see something obvious that I am might be overlooking.

main.cf

############## Postfix###############
smtpd_banner = $myhostname
biff = no
append_dot_mydomain = no
relayhost =
mynetworks = 127.0.0.0/8
inet_interfaces = all
mailbox_size_limit = 0
recipient_delimiter = +
alias_database = hash:/etc/postfix/aliases
alias_maps = $alias_database
myhostname = hermanos.hispanicguide.net
mydomain = hispanicguide.net
myorigin = $myhostname
mydestination = $myhostname, localhost.$mydomain, $transport_maps
mail_spool_directory = /var/spool/mail
debug_peer_level = 2
debugger_command = PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin xxgdb $daemon_directory/$process_name $process_id & sleep 5
disable_vrfy_command = no
readme_directory = /usr/share/doc/postfix-2.2.10/README_FILES
sample_directory = /usr/share/doc/postfix-2.2.10/samples
sendmail_path = /usr/sbin/sendmail.postfix
html_directory = no
setgid_group = postdrop
command_directory = /usr/sbin
manpage_directory = /usr/share/man
daemon_directory = /usr/libexec/postfix
newaliases_path = /usr/bin/newaliases.postfix
mailq_path = /usr/bin/mailq
queue_directory = /var/spool/postfix
mail_owner = postfix
unknown_local_recipient_reject_code = 450
####################postfix section ends here############### mains Users and mailboxes###############
virtual_mailbox_domains = proxy:mysql:/etc/postfix/mysql_virtual_domains_maps.cf
virtual_mailbox_base = /vmail/vmail
virtual_mailbox_maps = proxy:mysql:/etc/postfix/mysql_virtual_mailbox_maps.cf
virtual_mailbox_limit =51200000
virtual_alias_maps = proxy:mysql:/etc/postfix/mysql_virtual_alias_maps.cf
virtual_minimum_uid = 150
virtual_uid_maps = static:150
virtual_gid_maps = static:12
virtual_maildir_limit_message= Sorry, the user maildir is over quota, please try again later.
##############################Virtual section of main.cf ends##############
#################### SASL/TLS Authentication########################### ######SASL PART#########
smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
broken_sasl_auth_clients = yes
smtpd_sasl_local_domain =
smtpd_recipient_restrictions = permit_sasl_authenticated, permit_mynetworks, reject_unauth_destination######TLS PART###########
smtpd_tls_cert_file = /etc/ssl/hispanicguide/mailserver/smtpd.crt
smtpd_tls_key_file = /etc/ssl/hispanicguide/mailserver/smtpd.key
smtpd_tls_CAfile = /etc/ssl/hispanicguide/mailserver/cacert.pem
smtpd_tls_auth_only = no
smtpd_use_tls = yes
smtp_use_tls = yes
smtpd_tls_received_header = no
smtp_tls_note_starttls_offer = yes
smtpd_tls_loglevel = 1
tls_random_source = dev:/dev/urandom
smtpd_tls_session_cache_timeout = 3600s
smtpd_tls_received_header = yes
###########################SASL/TLS Authentication ends here#############

dovecot.conf

base_dir = /var/run/dovecot/
protocols = imap pop3 imaps pop3s
imap_listen = [::]
pop3_listen = [::]
login_dir = /var/run/dovecot-login
login = imap
login = pop3
default_mail_env = maildir:/vmail/vmail/%d/%u
mbox_locks = fcntl
log_timestamp = "%Y-%m-%d %H:%M:%S "
log_path = /var/log/maillog
mail_extra_groups = mail
first_valid_uid = 150
last_valid_uid = 150
maildir_copy_with_hardlinks = yes
auth = mysql_auth
auth_userdb = mysql /etc/dovecot-mysql.conf
auth_passdb = mysql /etc/dovecot-mysql.conf

dovecot-mysql.conf

######dove-mysql.conf should look like this##########
db_host = 127.0.0.1
db_port = 3306
db = mail
db_user = user
db_passwd = XXXXXXXX
db_client_flags = 0
default_pass_scheme = PLAIN
password_query = SELECT password FROM mailbox WHERE username = '%u'
user_query = SELECT '/vmail/vmail/%d/%n' as home, 'maildir:/vmail/vmail/%d/%n' as mail, 150 AS uid, 12 AS gid, concat('dirsize:storage=',quota) AS quota FROM mailbox WHERE username ='%u' AND active ='1'
 
Old 10-03-2009, 03:20 PM   #6
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,516

Rep: Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501
You can use telnet to troubleshoot dovecot.
To see how to do this, take a look here

Regards
 
Old 10-04-2009, 09:34 AM   #7
avandenbroeck
LQ Newbie
 
Registered: May 2008
Posts: 8

Original Poster
Rep: Reputation: 1
Smile

Quote:
Originally Posted by bathory View Post
You can use telnet to troubleshoot dovecot.
To see how to do this, take a look here

Regards
Well I'm happy to say that I solved my original problem.

The problem was not dovecot, nor postfix actually as like in most intances a short-circuit between the chair and the keyboard.

The problem was in mysql and the field "maildir" in the mailbox table.

Postfix was writing the e-mails to /var/vmail/domain instead of /var/vmail/domain/userdir/ (hence why I could read them at the system level but not via squirrelmail) this was because the field maildir in the table was defined as "userdir" instead of "userdir/", yes the forward slash was the difference.

Now I can poceed to figure out why a different user with a different domainname can receive mail but not send.

Thanks you for your support

Last edited by avandenbroeck; 10-04-2009 at 09:41 AM.
 
Old 10-04-2009, 11:25 AM   #8
avandenbroeck
LQ Newbie
 
Registered: May 2008
Posts: 8

Original Poster
Rep: Reputation: 1
Smile

Quote:
Originally Posted by avandenbroeck View Post
Well I'm happy to say that I solved my original problem.

The problem was not dovecot, nor postfix actually as like in most intances a short-circuit between the chair and the keyboard.

The problem was in mysql and the field "maildir" in the mailbox table.

Postfix was writing the e-mails to /var/vmail/domain instead of /var/vmail/domain/userdir/ (hence why I could read them at the system level but not via squirrelmail) this was because the field maildir in the table was defined as "userdir" instead of "userdir/", yes the forward slash was the difference.

Now I can poceed to figure out why a different user with a different domainname can receive mail but not send.

Thanks you for your support
Okay guys my last problem is solved, the fact that I could read e-mails via squirrel mail but no send them was because /usr/lib/sasl2/smptp.conf could not properly ID the user and password so I change the smtpd.conf from:

pwcheck_method: saslauthd
mech_list: PLAIN LOGIN

to

log_level: 3
pwcheck_method: auxprop
mech_list: PLAIN LOGIN CRAM-MD5 DIGEST-MD5
auxprop_plugin: sql
sql_engine: mysql
sql_hostnames: localhost
sql_database: mail
sql_user: xxxxxx
sql_passwd: xxxxxx
sql_select: SELECT password FROM mailbox where username ='%u@%r' AND active ='1'
sql_usessl: no


Once again thanks for the support
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
postfix mysql dovecot csdhiman Linux - Server 2 10-03-2009 01:26 PM
Guide for postfix/dovecot/mysql authentication gnetcon Linux - Software 2 10-30-2006 09:11 AM
Etch Horde Postfix Dovecot MySQL grant-skywalker Debian 0 08-05-2006 03:04 PM
Automated postfix and dovecot with mysql installation webserverdude General 0 06-26-2006 05:10 PM
mysql, postfix, dovecot & spamassassin dadams Fedora 1 10-18-2004 09:40 PM


All times are GMT -5. The time now is 06:48 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration