Trying to setup mail server: SMTP, IMAP and Fetchmail plus synch from old server

For a number of years, I’ve been running a linksys nslu2 with the unslung firmware to provide me with one set of services: Have a consistent view of / easy accessibility to my ISP email accounts to various in-house clients (I use different devices, dual boot, etc.) without depending on the ISP’s email server. On the nslu2, I used Postfix, Cyrus and fetchmail. There was a step by step guide on how to get it working initially and when my ISP clamped down on unencrypted connections, I was able to tweak the existing config to meet the new requirements with reasonable effort. That solution has stopped working (fetchmail has stopped pulling mails) and I don’t want to put much effort into it (the hardware is old and the package support is pretty much non existant) and would like to setup a new environment.

I stood up an OpenSuse 13.2 virtual machine and figured that, years later, with Yast graphical support and all of these products having been around “forever”, this would be pretty much a point and click affair and I’d be done in a few hours. I was wrong (not the first time). lol

A good 10 hours or so of effort into this, I don’t see the light at the end of the tunnel (currently trying to figure out why I can’t login to my cyrus admin account using cyradm). In short, I find that every little step requires extensive reading and research and, by now, I wonder if I’ve messaged it up beyond repair and am willing to start from scratch (I took a snapshot of the VM after the initial OS install and update, so reverting and starting fresh is quick and easy).

Here are my parameters:

  • I have no preference towards a specific product, but have to have the SMTP and IMAP protocol support as well as fetchmail to pull the messages from the outside
  • Small environment (5 accounts) with relatively little traffic but a lot of historic emails I want to retain (estimate the total volume at about 15K messages)
  • Ease of setup and occasional maintainance (I’m not a sysadmin; lol) as well as stability (I just want the thing to run and not be broken / require attention when updates come down the pipe) are high on my wish list
  • I would like to retain my historic emails (one time synch the mailbox content from the existing imap server to the new one - I did this at some point in the past when I moved from the UW Imap server to Cyrus and, while I recall it was painless, can’t recall which of the various available tools I used)
  • while I love OpenSuse I’m open to using a different distro just for this purpose (if there’s a good reason for it)

With that in mind, here are my questions:

  • Is there a step-by-step guide on how to set this up (the “Mail server setup for dummies on OpenSuse 13.2” guide)?
  • In the absence of a step-by-step guide, any other suggestions on how I get to where I want to go while being subjected to minimal pain and suffering?

Thank you in advance for your help.

Recommend:

First, choose an email server app. There are many to choose from, from bare bones to fully installed and working with various features.
So, that’s where I’d advise you to start… Understanding your personal capabilities (it’s OK to be anywhere from expert to experience running a mailserver but no idea what’s happening underneath). you also need to list the features and capabilities you want/need. You need to know whether you might be comfortable learning CLI or if you need a GUI for administration. You may need to list any client software that may need to be supported.

Choosing a mailserver app is not too different than finding and choosing any other app except that it’s a lot more complex. But, choosing the right mailserver app to suit your requirements is critical to eventual success, so you not only might be able to install something functional but also configure and continue to maintain.

Don’t restrict yourself to what is available by default in the OSS, Google for features, descriptions anbd reviews.
But, if you do install the basic mailserver available in the OSS, be aware that you can install the YAST applets to configure your mailserver, so you might have a pretty good solution there… A proven, reliable mailserver from your existing repository and a GUI to setup and maintain. Besides YAST, I remember that many newbie mail admins have used PHPMyAdmin to manage their mailservers… installed on whatever Linux including openSUSE.

You might also find that someone has built a supported virtual appliance, ie a portable virtual machine with everything pre-installed and ready for your customization. Just download and “add water.”

Your listed requirements looks pretty basic but can probably be implemented an infinite number of ways.
Just don’t get discouraged and if you have a specific problem, just post (with details… What you tried, what happened instead)

TSU

Thank you for your reply.

I think my frustration is that I came from a CLI interface only solution (the NSLU2 I referred to) for which there was a complete walkthrough on how to get the exact setup I described (functionally) up and running and, about 10 years later, I find that getting there is harder, despite the overall advances in the industry.

Your statement that “Your listed requirements looks pretty basic but can probably be implemented an infinite number of ways.” hits the nail on the head. This is NOT a complex or unusual setup and yes, there are many ways to go about it. I came here looking for advise on how to get to where I want to go with minimal effort. I honestly don’t want to dig through the various choices to select the products, then spend countless hours trying to get the individual components setup and working. Instead, I’d like to leverage the expertise of people who have been through this selection process, understand the pros and cons and can provide recommendations and assistance to minimize my implementation effort.

Anyone?

For whatever reason, I found it difficult to find a definitive list of mail apps supported by YAST, but I assume that the very basic imapd is supported. I installed into a test machine, and the YAST applet didn’t complain although I didn’t complete the entire configuration.

So, IMO the following <should> work(Not completely tested!)…

Install the imap mail server, postfix and fetchmail plus the YAST applet with the following command…

zypper in imap postfix fetchmail yast2-mail

After that completes, you should have the basic components for what you want.
You should now be able to open YAST and see an applet “Mail Server” in the Network Services category.
Use that to configure your mail server, if necessary

There also appears to be an SDB for setting up mail using the YAST2 applet, but I don’t know how necessary it is if you already have some familiarity with what you need (YAST is usually self-explanatory)
https://tr.opensuse.org/SDB:Configuring_E-Mail_with_YaST2

If you still want to attempt to configure manually from the command line, there appears to be an old “HOW-TO” that might work, to my eye I don’t see anything that would be a problem today
https://tr.opensuse.org/Mail_server_HOWTO

In general,
The two above guides are old and reference old ways to stop/start apps and services.
Nowadays, you should stop/start/restart services using systemd’s systemctl, for instance

systemctl stop|start|restart|status fetchmail
systemctl stop|start|restart|status postfix

You can also enable a service so that it starts automatically on boot, for example

systemctl enable fetchmail

Note that if you want to doublecheck where the executablle and configuration files are for any service, you can run the above systemctl commands with “status” to display the paths to those files, this might be necessary for instance if you’re following or reading the guides I referenced and files aren’t where they’re expected.

Curiously, I’m not sure if there is an imapd service… I don’t see a systemd Unit file and it’s not listed in the YAST Services manager, so it might be that it can only be started by manually invoking

/usr/sbin/imapd

HTH,
TSU

Thank you for your reply, there are a number of good pointers in it. Yesterday evening I reset my virtual machine to a prior snapshot (OS loaded and updates applied) and started from scratch. After some reading, I decided that I would give the Dovecot imap/email server a try. What motivated me to do that were comments that it is easier to setup than the Cyrus server I had tried prior.

I figured I would use Dovecot (for IMAP), Postfix (pre-installed, for SMTP) and Fetchmail (to pull messages from ISP to local mailstore); install all products in one shot, configure them in the listed sequence.

Dovecot has a nice “QuickStart Guide” and between that and some of the links it points to, I think I’ve made reasonable progress. I’ve hit a couple of minor roadbloacks that aren’t part of the guide (e.g. service must be manually enabled and started initially - I used the Services Manager in YAST, thx for the command line tip, speeds things up; firewall configuration needs to be changed to allow remote [as in over the network] connections to the server) but with my existing knowledge of both interpreting the symtpoms and what to do in OpenSuse, was able to quickly resolve them. I’m taking notes as I go along and, in the end, once things are working, will reset the system and re-do it in an “optimized” manner (e.g. take out or resequence steps that created the need for troubleshooting) until it works and I have a concise set of instructions.

I’m a lot more confident now that I’ll be able to work my way through this without getting hung up to long on individual issues. For one, I found that the Dovecot documentation has been very helpful in that it contains ways to easily validate specific configuration steps. Also, I’ve run into one snag and the error message thrown by the administration tool was very informative and to the point, so I know exactly where to look.

That being said, I might come back here and ask for further help, in case I get stuck.

After that, I’d like to share what I learned in a way that it can be “maintained/updated and corrected”. I think that, from here to getting the system fully functional, I might spend another 6-8 hours (really just a guess at this point), for something that, with the right cookbook, would take less than one hour, perhaps 2 when inclined to do some extra reading, start to finish. Is there a Wiki that I could use for that?

Thank you for your help.

On 2015-04-06 08:36, tsu2 wrote:
>
> For whatever reason, I found it difficult to find a definitive list of
> mail apps supported by YAST, but I assume that the very basic imapd is
> supported.

I doubt that. Time ago, imapd meant the UW imapd implementation, but
this one, if still available, is not maintained.

YaST mail module in openSUSE doesn’t install/configure any imap/pop3
service, AFAIK. SLES might do this better.

I would install dovecot. It is very powerful, but YaST doesn’t set it up.

> Curiously, I’m not sure if there is an imapd service… I don’t see a
> systemd Unit file and it’s not listed in the YAST Services manager, so
> it might be that it can only be started by manually invoking

It worked via xinet, IIRC.


Cheers / Saludos,

Carlos E. R.

(from 13.1 x86_64 “Bottle” (Minas Tirith))

On 2015-04-04 21:06, Robbo wrote:

> - I would like to retain my historic emails (one time synch the mailbox
> content from the existing imap server to the new one - I did this at
> some point in the past when I moved from the UW Imap server to Cyrus
> and, while I recall it was painless, can’t recall which of the various
> available tools I used)

I use “imapsync” for this. I think there is a repo that contains it, I’m
unsure this instant. It’s documentation is scarce, but it does the job
properly, and is maintained.

http://www.howtoforge.com/how-to-migrate-mailboxes-between-imap-servers-with-imapsync

Zimbra: Guide to imapsync
http://wiki.zimbra.com/wiki/Guide_to_imapsync

Ah, you need perl-Mail-Box…rpm en from OBS_devel_languages_perl and
OBS_server_mail for the main thing.


Cheers / Saludos,

Carlos E. R.

(from 13.1 x86_64 “Bottle” (Minas Tirith))

Yes, I’ve been looking at IMAPSYNC as it sounds very promising however, it doesn’t appear to be free. Both the official homepage and the site at github contain references to purchasing the product. It doesn’t come up in the standard OpenSuse repository BUT, there are one click installs in the OpenSuse software library (unstable). I’ll give that a try once I got the rest working.

Quick update: I got Dovecot working (with SSL encryption) using nothing but their installation guide. Postfix is next and I started gathering notes on what I need to do there. During the week, I can only spend very little time on this.

On 2015-04-08 07:06, Robbo wrote:

> Yes, I’ve been looking at IMAPSYNC as it sounds very promising however,
> it doesn’t appear to be free.

There is a pay version, and of course the site wants you to get it. Or
pay for support, I don’t remember which now (I have it installed on
another machine, not this one). But you can install it from the repo I
mentioned, and that is free. I think the program is the same one.

> Quick update: I got Dovecot working (with SSL encryption) using nothing
> but their installation guide. Postfix is next and I started gathering
> notes on what I need to do there. During the week, I can only spend very
> little time on this.

Postfix can be easily configured via YaST, mail module. If I recall
correctly, there is a question at the start about using the simple or
complex method, or advanced, or something of the sort. Choose the simple
one. The other one also setups ldap, and things get quite complicated
(overkill fro 5 accounts, IMO).


Cheers / Saludos,

Carlos E. R.

(from 13.1 x86_64 “Bottle” (Minas Tirith))

I’m already part way down the postfix part by hand editing the configuration. I think I will need to go there anyway due to the specific setup requirements (that I think the YAST module can’t handle).

However, I’ve run into a snag:

Symptom:

  1. From the virtual server that postfix is running on, I can connect to port 25 on “localhost” but not on the IP address assigned to the virtual network interface (I do run that in bridged mode, btw, so that it gets an IP address on the same address as the rest of the “physical” systems)
  2. I can’t find the mail logs in /var/log/

For #1 I have

  • disabled the server’s firewall and validated that it’s not running
/sbin/rcSuSEfirewall2 status 
SuSEfirewall2.service - SuSEfirewall2 phase 2
   Loaded: loaded (/usr/lib/systemd/system/SuSEfirewall2.service; enabled)
   Active: inactive (dead) since Wed 2015-04-08 23:35:21 EDT; 57min ago
  Process: 9420 ExecStop=/usr/sbin/SuSEfirewall2 systemd_stop (code=exited, status=0/SUCCESS)
  Process: 9152 ExecStart=/usr/sbin/SuSEfirewall2 boot_setup (code=exited, status=0/SUCCESS)
 Main PID: 9152 (code=exited, status=0/SUCCESS)
  • gone over what I think the relevant parameters in main.cf are; here are my settings:
inet_interfaces = all
mynetworks_style = subnet
  • validated that there aren’t duplicate entries of the above directives in the main.cf
  • done “postfix reload” as well as full server restarts to make sure I don’t have any configuration changes that weren’t applied
  • tried netstat to validate that Postfix is actually listening

netstat -nap | grep :25
(Not all processes could be identified, non-owned process info
 will not be shown, you would have to be root to see it all.)
tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN      -                   
tcp        0      0 ::1:25                  :::*                    LISTEN      -
  • done an nmap scan on the local machine with the following results
Nmap scan report for localhost (127.0.0.1)
Host is up (0.00043s latency).
Not shown: 996 closed ports
PORT    STATE SERVICE
25/tcp  open  smtp
143/tcp open  imap
631/tcp open  ipp
993/tcp open  imaps
Nmap scan report for mymail01 (192.168.65.81)
Host is up (0.00051s latency).
Not shown: 998 closed ports
PORT    STATE SERVICE
143/tcp open  imap
993/tcp open  imaps

  • figured I’d take a look at the logs to see if they offer any help, but I can’t find them

As usual, there’s probably a very easy fix for this, I just can’t seem to find it and would appreciate a hand.

On 2015-04-09 06:46, Robbo wrote:
>
> I’m already part way down the postfix part by hand editing the
> configuration. I think I will need to go there anyway due to the
> specific setup requirements (that I think the YAST module can’t handle).

What I do is first setup mail with yast, so that the basics work, then I
modify postfix manually and never use yast mail module again. It just
makes a sensible starting point.

>
> However, I’ve run into a snag:
>

Look at the “mynetworks” setting in main.cf.
Mine:


mynetworks = 127.0.0.0/8 ::1/128] 192.168.1.0/28 192.168.0.0/28


Cheers / Saludos,

Carlos E. R.

(from 13.1 x86_64 “Bottle” (Minas Tirith))