LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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, 09:38 AM   #1
slac-in-the-box
Member
 
Registered: Mar 2010
Location: oregon
Distribution: slackware64-15.0 / slarm64-current
Posts: 780
Blog Entries: 1

Rep: Reputation: 432Reputation: 432Reputation: 432Reputation: 432Reputation: 432
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, 06:07 PM   #2
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 8,792

Rep: Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656
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, 06:42 PM   #3
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,264
Blog Entries: 24

Rep: Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194
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, 06:53 PM   #4
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 8,792

Rep: Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656
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, 07:02 PM   #5
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,264
Blog Entries: 24

Rep: Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194
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, 07:21 PM   #6
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,264
Blog Entries: 24

Rep: Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194
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 09:22 PM. Reason: Fixed
 
2 members found this post helpful.
Old 10-08-2018, 02:07 PM   #7
slac-in-the-box
Member
 
Registered: Mar 2010
Location: oregon
Distribution: slackware64-15.0 / slarm64-current
Posts: 780

Original Poster
Blog Entries: 1

Rep: Reputation: 432Reputation: 432Reputation: 432Reputation: 432Reputation: 432
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, 02:44 PM   #8
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,264
Blog Entries: 24

Rep: Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194
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, 05:51 PM   #9
tramtrist
Member
 
Registered: Jul 2018
Location: Cincinnati USA
Distribution: Slackware
Posts: 535

Rep: Reputation: 327Reputation: 327Reputation: 327Reputation: 327
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



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 12:35 PM
Solid Simple e-mail server tutorial 67comet Linux - Server 1 05-26-2010 02: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 07:05 AM
LXer: Tutorial: How the Linux Kernel Manages Virtual Memory LXer Syndicated Linux News 0 11-22-2008 05:50 AM
Mail server - setup virtual mail boxes satimis Linux - Server 1 02-10-2007 10:40 AM

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

All times are GMT -5. The time now is 02:50 AM.

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