How to install Postfix on FreeBSD 8.1 with MySQL?

Abriel said:
It looks, like you have something missconfigured. I don't have postfix with mysql. I think you should first try setup postfx without mysql, and after everything will be alright add configuration to mysql.

And here is setup for mysql http://www.purplehat.org/?page_id=11

I think your right. I just restarted my computer/server and now see errors in my mailog log.

it shows this:

Code:
Oct 12 00:00:00 hostname newsyslog[72979]: logfile turned over
Oct 12 00:00:04 hostname postfix/proxymap[70318]: warning: mysql query failed: Table 'Mail.domain' doesn't exist
Oct 12 00:00:04 hostname postfix/trivial-rewrite[72996]: fatal: proxy:mysql:/usr/local/etc/postfix/mysql_relay_domains_maps.cf(0,lock|fold_fix): table lookup problem
Oct 12 00:00:05 hostname postfix/qmgr[72218]: warning: problem talking to service rewrite: Unknown error: 0
Oct 12 00:00:05 hostname postfix/master[1123]: warning: process /usr/local/libexec/postfix/trivial-rewrite pid 72996 exit status 1
Oct 12 00:00:05 hostname postfix/master[1123]: warning: /usr/local/libexec/postfix/trivial-rewrite: bad command startup -- throttling
Oct 12 00:01:05 hostname postfix/proxymap[70318]: warning: mysql query failed: Table 'Mail.domain' doesn't exist
Oct 12 00:01:05 hostname postfix/trivial-rewrite[73050]: fatal: proxy:mysql:/usr/local/etc/postfix/mysql_relay_domains_maps.cf(0,lock|fold_fix): table lookup problem
Oct 12 00:01:06 hostname postfix/qmgr[72218]: warning: problem talking to service rewrite: Unknown error: 0
Oct 12 00:01:06 hostname postfix/master[1123]: warning: process /usr/local/libexec/postfix/trivial-rewrite pid 73050 exit status 1
Oct 12 00:01:06 hostname postfix/master[1123]: warning: /usr/local/libexec/postfix/trivial-rewrite: bad command startup -- throttling
Oct 12 00:02:06 hostname postfix/proxymap[70318]: warning: mysql query failed: Table 'Mail.domain' doesn't exist
Oct 12 00:02:06 hostname postfix/trivial-rewrite[73102]: fatal: proxy:mysql:/usr/local/etc/postfix/mysql_relay_domains_maps.cf(0,lock|fold_fix): table lookup problem
Oct 12 00:02:07 hostname postfix/qmgr[72218]: warning: problem talking to service rewrite: Unknown error: 0
Oct 12 00:02:07 hostname postfix/master[1123]: warning: process /usr/local/libexec/postfix/trivial-rewrite pid 73102 exit status 1
Oct 12 00:02:07 hostname postfix/master[1123]: warning: /usr/local/libexec/postfix/trivial-rewrite: bad command startup -- throttling
Oct 12 00:03:07 hostname postfix/proxymap[70318]: warning: mysql query failed: Table 'Mail.domain' doesn't exist
Oct 12 00:03:07 hostname postfix/trivial-rewrite[73153]: fatal: proxy:mysql:/usr/local/etc/postfix/mysql_relay_domains_maps.cf(0,lock|fold_fix): table lookup problem
Oct 12 00:03:08 hostname postfix/qmgr[72218]: warning: problem talking to service rewrite: Unknown error: 0
Oct 12 00:03:08 hostname postfix/master[1123]: warning: process /usr/local/libexec/postfix/trivial-rewrite pid 73153 exit status 1
Oct 12 00:03:08 hostname postfix/master[1123]: warning: /usr/local/libexec/postfix/trivial-rewrite: bad command startup -- throttling
Oct 12 00:03:28 hostname postfix/qmgr[72218]: fatal: watchdog timeout
Oct 12 00:03:29 hostname postfix/master[1123]: warning: process /usr/local/libexec/postfix/qmgr pid 72218 exit status 1
Oct 12 00:03:29 hostname postfix/qmgr[73171]: 83FD3F0102C: from=<root@localhost.localhost>, size=3297, nrcpt=1 (queue active)
Oct 12 00:04:08 hostname postfix/proxymap[70318]: warning: mysql query failed: Table 'Mail.domain' doesn't exist
Oct 12 00:04:08 hostname postfix/trivial-rewrite[73204]: fatal: proxy:mysql:/usr/local/etc/postfix/mysql_relay_domains_maps.cf(0,lock|fold_fix): table lookup problem

the weird thing is that I can actually see the database and the fields and they do exist.
 
I found out the problem one mysql map used domain as the table when it should be domains.

seems like everything works now. I sent a test e-mail to an aol account but I now get an aol error 421 which I looked up shows that I failed to have a reverse dns record. How do I make a reverse DNS record?

It looks like that my mysql tables has the wrong information inside them.
 
I tested the e-mail. I can send e-mails to my AOL e-mail account but when I reply I can't received the e-mails to my postfix system. I get some error saying my e-mail system is refusing to deliver the mail.
 
Abriel said:
What do you have in logs?

right now this is what I have in the logs. seems like the mail from my aol account got denied to send the e-mail to my posftfix mail server due to ssl. maybe it needed to login in order for the mail to be sent or something...???

here is what is inside the logs currently the maillog file:

Code:
Oct 14 00:00:00 dpserver1 newsyslog[5253]: logfile turned over
Oct 14 00:38:33 dpserver1 postfix/smtpd[5432]: connect from imr-da03.mx.aol.com[205.188.105.145]
Oct 14 00:39:33 dpserver1 postfix/smtpd[5432]: SSL_accept error from imr-da03.mx.aol.com[205.188.105.145]: -1
Oct 14 00:39:33 dpserver1 postfix/smtpd[5432]: lost connection after CONNECT from imr-da03.mx.aol.com[205.188.105.145]
Oct 14 00:39:33 dpserver1 postfix/smtpd[5432]: disconnect from imr-da03.mx.aol.com[205.188.105.145]
Oct 14 00:44:38 dpserver1 postfix/smtpd[5454]: connect from imr-da03.mx.aol.com[205.188.105.145]
Oct 14 00:45:38 dpserver1 postfix/smtpd[5454]: SSL_accept error from imr-da03.mx.aol.com[205.188.105.145]: -1
Oct 14 00:45:38 dpserver1 postfix/smtpd[5454]: lost connection after CONNECT from imr-da03.mx.aol.com[205.188.105.145]
Oct 14 00:45:38 dpserver1 postfix/smtpd[5454]: disconnect from imr-da03.mx.aol.com[205.188.105.145]
Oct 14 00:50:48 dpserver1 postfix/smtpd[5467]: connect from imr-da03.mx.aol.com[205.188.105.145]
Oct 14 00:51:48 dpserver1 postfix/smtpd[5467]: SSL_accept error from imr-da03.mx.aol.com[205.188.105.145]: -1
Oct 14 00:51:48 dpserver1 postfix/smtpd[5467]: lost connection after CONNECT from imr-da03.mx.aol.com[205.188.105.145]
Oct 14 00:51:48 dpserver1 postfix/smtpd[5467]: disconnect from imr-da03.mx.aol.com[205.188.105.145]
Oct 14 00:56:53 dpserver1 postfix/smtpd[5489]: connect from imr-da03.mx.aol.com[205.188.105.145]
Oct 14 00:57:53 dpserver1 postfix/smtpd[5489]: SSL_accept error from imr-da03.mx.aol.com[205.188.105.145]: -1
Oct 14 00:57:53 dpserver1 postfix/smtpd[5489]: lost connection after CONNECT from imr-da03.mx.aol.com[205.188.105.145]
Oct 14 00:57:53 dpserver1 postfix/smtpd[5489]: disconnect from imr-da03.mx.aol.com[205.188.105.145]
Oct 14 01:02:53 dpserver1 postfix/smtpd[5516]: connect from imr-da03.mx.aol.com[205.188.105.145]
Oct 14 01:03:53 dpserver1 postfix/smtpd[5516]: SSL_accept error from imr-da03.mx.aol.com[205.188.105.145]: -1
Oct 14 01:03:53 dpserver1 postfix/smtpd[5516]: lost connection after CONNECT from imr-da03.mx.aol.com[205.188.105.145]
Oct 14 01:03:53 dpserver1 postfix/smtpd[5516]: disconnect from imr-da03.mx.aol.com[205.188.105.145]
Oct 14 01:08:53 dpserver1 postfix/smtpd[5526]: connect from imr-da03.mx.aol.com[205.188.105.145]
Oct 14 01:09:53 dpserver1 postfix/smtpd[5526]: SSL_accept error from imr-da03.mx.aol.com[205.188.105.145]: -1
Oct 14 01:09:53 dpserver1 postfix/smtpd[5526]: lost connection after CONNECT from imr-da03.mx.aol.com[205.188.105.145]
Oct 14 01:09:53 dpserver1 postfix/smtpd[5526]: disconnect from imr-da03.mx.aol.com[205.188.105.145]
Oct 14 01:14:58 dpserver1 postfix/smtpd[5548]: connect from imr-da03.mx.aol.com[205.188.105.145]

what does the errors mean?
 
I am still getting the same errors. I am trying to send e-mail from my aol account to my e-mail address on my server. it's failing due to ssl errors. I don't understand what is wrong? I can send e-mails perfectly from my server to aol's server. There is no problem anymore before it used to be refused by AOL due to error 443 which was that the reverse domain name didn't match or something. The mail still dosen't get sent quickly. It still does get refused but after 2 hours the e-mail gets accepted or sent to the aol mail account. I then reply to that e-mail and so far getting errors. I can't send a response back to the e-mail address.

I am trying to use myql for the data lookup tables. I am using webmin to send the e-mails. webmin still shows the default mail accounts that was already made with postfix by default which are the mail users of each group or user created my on linux system. so like www, postfix, root, etc all these users including my own user that I use to login to my freebsd 8.1 computer/server have a mailbox. yet, I config and setup postfix to use ssl, and mysql for the lookup tables. I think the data I put in the lookup tables are not correct. so, I need some tutorials to explain what needs to be inside the mysql tables?

like for me I have mydomain.com and a mx record with it as mail.mydomain.com I have it in that way. so in mysql I put domain as mail.mydomain.com. my host name is domainserver1.mydomain.com that is my computers hostname. for some reason when I send the e-mail out from my server it automatically uses the domainserver1.mydomain.com type address. I do have the domainserver1.mydomain.com as an A record for mydomian.com

I want to know how I can make my e-mails look like this: user@mydomain.com. I don't want it like: user@mail.mydomain.com or user@domainserver1.mydomain.com. I want it like: user@mydomain.com. how to get it like that?

I seen the tutorials posted on here so far. I made the mysql tables following the tutorials and also just reading the postfix-mysql mappings sql code. I would create the tables and fields based off the sql code. now I am clueless as to what should be stored in those tables. I never found any tutorials that gave good examples and explanation as to what is the purpose of those tables and what is needed. This is my first postfix setup. I been trying to set one up in the past 3 years. I always failed. If I used the default settings using the postfix maps. I would have a working mail server. I was able to send and receive e-mails. but, I don't want it like that. I want to use mysql. I want to eventually make my own web mail interface like an e-mail service.

I know php so I thought if I can get the maps using mysql. I can easily make a web interface to delete e-mails etc as long I know where each users mailbox is located and php has access to those mail boxes.
 
Abriel said:
Paste
Code:
cat /usr/local/etc/postfix/main.cf
and
Code:
postconf
But as said, i have only postfix without mysql.

ok, I did those code. It gives me a list of variables and their values assigned to them.

do you want me to post them here?
 
Abriel said:
Would be nice.

OK, here is what it prints out to screen: Click here for the printout variables

It was too long for this website had to paste the printout to some other website. What could be the problem? I can send e-mail to an aol account but can't receive an e-mail from the aol user. Looks like an SSL error. Something where password and user weren't matched or something like that.

How to fix those errors?
 
Show me /usr/local/etc/postfix/main.cf and /usr/local/etc/postfix/master.cf and
[cmd=]openssl s_client -connect yourdomain:465[/cmd]
Setup in /usr/local/etc/postfix/main.cf
[CMD=]smtpd_tls_loglevel = 2[/CMD]
 
Abriel said:
Show me /usr/local/etc/postfix/main.cf and /usr/local/etc/postfix/master.cf and
[cmd=]openssl s_client -connect yourdomain:465[/cmd]
Setup in /usr/local/etc/postfix/main.cf
[CMD=]smtpd_tls_loglevel = 2[/CMD]

ok, I will pm you that information. Well I will post it to another website but will give you the links. Hold up let me get that information.
 
hockey97 said:
How do I make a reverse DNS record?

Usually you have to ask your ISP to do that for you unless they've delegated the IP addresses you're assigning to you. Then you can just create a reverse/PTR record matching the hostname in the responsible DNS server.
 
ph0enix said:
Usually you have to ask your ISP to do that for you unless they've delegated the IP addresses you're assigning to you. Then you can just create a reverse/PTR record matching the hostname in the responsible DNS server.

I pay $5 extra to have a static Ip address. however the people there aren't very technical because it took me 10 days to have then understand what a static ip address. I had to explain it to them and they had to figure out if they offer it.

So I hope when I ask they actually understand what I am asking for.
 
On a side note, why don't you use Google App for email service? They do everything for you for free. I can't see any advantages to setup own email server over Google App.
 
hurricane_sh said:
On a side note, why don't you use Google App for email service? They do everything for you for free. I can't see any advantages to setup own email server over Google App.

I might as well take windows 7 look at the sources of it. take out all the artwork and replace it with mine and call it my own OS.

What your suggesting to me is illegal. I am trying to use it for commercial purposes and for me to use google I would have to pay a fee for it plus no one will use my services if they know I am using Google services why would others use mine if they can go directly to the source and use Google services.
 
I see, just wanted to let you know about Google App in cased you weren't aware of it, no offense intended. Obviously you are a pro and know what you are doing. I'm just a newbie and always try to avoid configuring a service if I could.
 
Back
Top