LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 02-16-2010, 07:37 AM   #1
Electro-X
LQ Newbie
 
Registered: Feb 2010
Posts: 1

Rep: Reputation: 0
How to configure postfix with mysql?


Hi
have want to create a mail server with postfix and mysql.
When i try to send mail with telnet i receive a error message :
Code:
telnet serveur2 25
Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.
220 serveur2.MYDOMAIN.fr ESMTP Postfix
HELO ser
250 serveur2.MYDOMAIN.fr
MAIL FROM: <root@MYDOMAIN.fr>
250 2.1.0 Ok
RCPT TO: <elec@MYDOMAIN.fr>
550 5.1.1 <elec@MYDOMAIN.fr>: Recipient address rejected: User unknown in local recipient table
421 4.4.2 serveur2.MYDOMAIN.fr Error: timeout exceeded
Connection closed by foreign host.
This is my main.cf
Code:
queue_directory = /var/spool/postfix
command_directory = /usr/sbin
daemon_directory = /usr/libexec/postfix
mail_owner = postfix
inet_interfaces = all
myhostname = serveur2.MYDOMAIN.fr
mydomain = MYDOMAIN.fr
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
unknown_local_recipient_reject_code = 550
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
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
sendmail_path = /usr/sbin/sendmail.postfix
newaliases_path = /usr/bin/newaliases.postfix
mailq_path = /usr/bin/mailq.postfix
setgid_group = postdrop
html_directory = no
manpage_directory = /usr/share/man
sample_directory = /usr/share/doc/postfix-2.3.3/samples
readme_directory = /usr/share/doc/postfix-2.3.3/README_FILES
virtual_alias_maps = mysql:/etc/postfix/mysql_virtual
virtual_mailbox_domains = $mydomain
virtual_mailbox_maps = mysql:/etc/postfix/mysql_virtual_mailbox
virtual_mailbox_base = /home/vmail/
virtual_uid_maps = static:5000
virtual_gid_maps = static:5000
virtual_transport = virtual
in my database i have this user "elec@MYDOMAIN.fr"

Someone have a solution for my problem??

EDIT : my server use CentOS 5.4 with postfix in CentosPlus (compil with mysql and postgres support)

Sorry for my english, i'm french.

Last edited by Electro-X; 02-16-2010 at 07:46 AM.
 
Old 02-16-2010, 01:42 PM   #2
spampig
Member
 
Registered: Feb 2010
Location: /Earth/UK/England/Hampshire
Distribution: Debian, Ubuntu, CentOS, Slackware
Posts: 262
Blog Entries: 2

Rep: Reputation: 56
I am not sure if this is OK 'virtual_mailbox_domains = $mydomain' ?

Does:

postmap -q "elec@MYDOMAIN.fr" mysql:/etc/postfix/mysql_virtual_mailbox

work?

Is mysql getting the query?
TIP: Enable query logging in my.cnf

What are the contents of the file mysql_virtual_mailbox?
 
Old 02-17-2010, 05:11 AM   #3
Noway2
Senior Member
 
Registered: Jul 2007
Distribution: Gentoo
Posts: 2,125

Rep: Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781
Looking at my postfix configuration, which uses mysql, I see a few differences: virtual_mailbox_maps = proxy:mysql:$config_directory/mysql_virtual_mailbox_maps.cf and virtual_mailbox_domains = proxy:mysql:$config_directory/mysql_virtual_domains_maps.cf

The other thing you need to look VERY closely at is what is in the .cf files, especially if you copied from a how to document. Two things I had trouble with are ` versus ' which wordpress mixes up and trailing blank spaces at the line ends.
 
  


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: How to configure postfix to process mail from another host m1ckey78 Linux - Server 3 10-15-2008 10:59 AM
Postfix: help required to configure postfix to redirect email. Wheddod Linux - Software 3 08-20-2008 07:55 AM
Configure postfix, please help! snickie Linux - Server 10 02-28-2007 10:59 AM
MySQL setup stops at command "./configure --prefix=/usr/local/mysql" k41184 Linux - Software 1 05-20-2004 02:44 PM
configure avmailgate + postfix rafalek Linux - Networking 0 10-13-2003 05:54 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 04:42 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
Open Source Consulting | Domain Registration