LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 10-06-2018, 10:38 AM   #1
slac-in-the-box
Member
 
Registered: Mar 2010
Location: oregon
Distribution: slackware64-14.2
Posts: 268

Rep: Reputation: 109Reputation: 109
best virtual mail tutorial ever


The tutorial at docs.slackware.com/howtos:network_servicesostfix_dovecot_mysql is pure awesomeness. Mail servers are so daunting with their plethora of configuration options, and their ability to relay you wide open. But that tutorial's got Slack!

With that much configuring, I made a couple of typing mistakes, and the logs revealed where they were at; once my typos were gone, everything worked except one thing, and it was at one of the points where my setup deviated from tutorial: a database on a separate host, with local ip, 10.11.12.13.

In the file /etc/postfix/mysql-virtual-mailbox-maps.cf and in the other two like it, for domains, and aliases, I had to make change from
Code:
host = localhost
to
Code:
hosts = 10.11.12.13
I noticed some online examples said host, and others said hosts; when I tried it with the hosts, the database connected. It was the only rough spot. It probably defaults to localhost on an error, and so for everybody using localhost, it doesn't matter. But to get it to connect to remote hosts, it had to be plural.

There are lots of steps and components, and they all have to be right. The tutorial was clean. Thanks Astrogeek and any other contributors.
 
Old 10-07-2018, 07:07 PM   #2
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 5,531

Rep: Reputation: 3280Reputation: 3280Reputation: 3280Reputation: 3280Reputation: 3280Reputation: 3280Reputation: 3280Reputation: 3280Reputation: 3280Reputation: 3280Reputation: 3280
It's great to have this documented! Thanks!

But, I'm not finding that file in the postfix package from SBo (for 14.2) and the package from -current. Is it one you created? I don't see any reference to it in the SlackDocs article you linked. Was this just a hodgepodge of things from other websites or is it part of the package (and/or tutorial) and I just totally missed it?

If it is part of the tutorial, we should definitely change it. If it isn't part of the tutorial, maybe you could add a section about connecting postfix to an external database.
 
Old 10-07-2018, 07:42 PM   #3
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=14, FreeBSD_10{.0|.1|.2}
Posts: 4,844
Blog Entries: 6

Rep: Reputation: 2674Reputation: 2674Reputation: 2674Reputation: 2674Reputation: 2674Reputation: 2674Reputation: 2674Reputation: 2674Reputation: 2674Reputation: 2674Reputation: 2674
First, thanks for the kind words! Always appreciated!

And I am glad to see that it is still useful after so long a time with few updates!

Honestly, it has been a while since I wrote that so I'll have to take a refresher look at it later today. I have multiple instances running based on that setup and have never encountered a problem with the host name such as you describe, all of mine are host = localhost I think, but I am not aware of anything that would require 'hosts' in that parameter.

Could you post a link to one of the tutorials that suggests 'hosts' to geve me a starting point to look into it, please?

I have had a to-do on my list to update that doc for... well too long! Perhaps as the weather cools and I settle in for the winter... your comments are terrific incentive!
 
Old 10-07-2018, 07:53 PM   #4
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 5,531

Rep: Reputation: 3280Reputation: 3280Reputation: 3280Reputation: 3280Reputation: 3280Reputation: 3280Reputation: 3280Reputation: 3280Reputation: 3280Reputation: 3280Reputation: 3280
Oops, I didn't realize there were multiple articles linked there...

Quote:
Originally Posted by astrogeek View Post
Could you post a link to one of the tutorials that suggests 'hosts' to geve me a starting point to look into it, please?
Here's one I found when I was searching for that filename.

https://workaround.org/ispmail/wheez...o-the-database
 
1 members found this post helpful.
Old 10-07-2018, 08:02 PM   #5
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=14, FreeBSD_10{.0|.1|.2}
Posts: 4,844
Blog Entries: 6

Rep: Reputation: 2674Reputation: 2674Reputation: 2674Reputation: 2674Reputation: 2674Reputation: 2674Reputation: 2674Reputation: 2674Reputation: 2674Reputation: 2674Reputation: 2674
I did some quick look around and was on that page when you posted the link, but thanks!

Indeed, I am seeing a lot of 'hosts' usage. Slac-in-the-box may be correct that it defaults to localhost on error, but I just restarted one configured with 'host = localhost' and see no actual error message.

It is the first time I have seen any mysql connector use 'hosts' - it is 'host' the world around in my (possibly limited) experience. As it is processed by postfix code, I guess it must be a postfix thing but will try to get to the bottom of it now that I see it...

Thanks for pointing it out!
 
Old 10-07-2018, 08:21 PM   #6
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=14, FreeBSD_10{.0|.1|.2}
Posts: 4,844
Blog Entries: 6

Rep: Reputation: 2674Reputation: 2674Reputation: 2674Reputation: 2674Reputation: 2674Reputation: 2674Reputation: 2674Reputation: 2674Reputation: 2674Reputation: 2674Reputation: 2674
This would seem to be the definitive last word...

man mysql_table from the postfix package:

From my local man mysql_table which may be different than above link..

Code:
      hosts  The  hosts  that  Postfix  will  try to connect to and query from.  Specify unix: for UNIX domain
              sockets, inet: for TCP connections (default).  Example:
                  hosts = host1.some.domain host2.some.domain:port
                  hosts = unix:/file/name

              The hosts are tried in random order, with all connections over UNIX domain  sockets  being  tried
              before  those  over  TCP.   The connections are automatically closed after being idle for about 1
              minute, and are re-opened as necessary. Postfix versions 2.0 and earlier  do  not  randomize  the
              host order.

              NOTE:  if you specify localhost as a hostname (even if you prefix it with inet:), MySQL will con‐
              nect to the default UNIX domain socket.  In order to instruct MySQL to connect to localhost  over
              TCP you have to specify
                  hosts = 127.0.0.1
Although it does not say so, my guess is that it simply does not recognize 'host', or 'zebra' for that matter, uses the unix socket by default, and does not complain about unrecognized parameter names.

When you have no local mysql instance that can be connected to by default, you see the error.

I'll fix that later this evening, and thanks for the heads up!

*** EDIT: Should be all fixed now, and includes a note about the appropriate man page to reference for those details. - Thanks again to all!

Last edited by astrogeek; 10-07-2018 at 10:22 PM. Reason: Fixed
 
2 members found this post helpful.
Old 10-08-2018, 03:07 PM   #7
slac-in-the-box
Member
 
Registered: Mar 2010
Location: oregon
Distribution: slackware64-14.2
Posts: 268

Original Poster
Rep: Reputation: 109Reputation: 109
I got so excited about imapd and smptd working on slackware cloud instance, (and it's now had 60 hours uptime without any unwanted connections) that I kept the momentum by reading ncurses man page again, and trying to make ncurses based front end for managing the mysql mailserver database... got so distracted that I didn't even notice the replies yesterday. Looks like everyone answered themselves! I'm so used to things not working in my trial and error linux hacking, that when all the pieces finally fit and something works, I get kind of giddy. Slackware has great documentation! Thanks. The next round's on me.

BTW, if there already is a ncurses front end to mysql, please save me.
 
Old 10-08-2018, 03:44 PM   #8
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=14, FreeBSD_10{.0|.1|.2}
Posts: 4,844
Blog Entries: 6

Rep: Reputation: 2674Reputation: 2674Reputation: 2674Reputation: 2674Reputation: 2674Reputation: 2674Reputation: 2674Reputation: 2674Reputation: 2674Reputation: 2674Reputation: 2674
I am not aware of an ncurses front end for mysql for general queries (but I haven't really looked either). I am not aware of an ncurses front end for managing the vmail tables either.

I wrote a shell script which I use for managing my own, but I also have a more {complete|complex} schema structure which would make it not generally useful.

When I get around to updating the docs page I'll try to include a simple shell script for managing the basic schema. In the mean time, give it a try yourself - you obviously have a good handle on it already!
 
Old 10-08-2018, 06:51 PM   #9
tramtrist
LQ Newbie
 
Registered: Jul 2018
Location: Detroit, MI / Nagoya JP
Distribution: Slackware, Debian Buster
Posts: 12

Rep: Reputation: Disabled
I'm also using this article as it is very good. Any way to get postfixadmin added to it? Thanks!
 
  


Reply

Tags
dovecot, mysql, postfix, virtual mail


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
PHP Mail (using automatically a mail from the virtual domian) erosbk Linux - Server 1 04-25-2011 01:35 PM
Solid Simple e-mail server tutorial 67comet Linux - Server 1 05-26-2010 03:44 AM
Video Tutorial: How to Setup a Virtual Supercomputer Center or HPC Cluster using Xen Teo En Ming Linux - Virtualization and Cloud 0 10-31-2009 08:05 AM
LXer: Tutorial: How the Linux Kernel Manages Virtual Memory LXer Syndicated Linux News 0 11-22-2008 06:50 AM
Mail server - setup virtual mail boxes satimis Linux - Server 1 02-10-2007 11:40 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 12: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