Package Details: courier-mta 1.1.10-1

Git Clone URL: (read-only, click to copy)
Package Base: courier-mta
Description: IMAP(s)/POP3(s) and SMTP Server with ML-manager, webmail and webconfig
Upstream URL:
Licenses: GPL2
Conflicts: courier-imap, courier-maildrop, imap-server, smtp-forwarder, smtp-server, ucspi-tcp
Provides: courier-imap, courier-maildrop, imap-server, pop3-server, smtp-forwarder, smtp-server
Submitter: Svenstaro
Maintainer: vario
Last Packager: vario
Votes: 12
Popularity: 0.000046
First Submitted: 2012-10-13 09:56 (UTC)
Last Updated: 2022-07-10 06:29 (UTC)

Required by (1397)

Sources (14)

Latest Comments

vario commented on 2022-07-10 06:31 (UTC)

Versions keep appearing with nothing on the courier-announce list

vario commented on 2022-01-16 20:11 (UTC)

New version coming soon - just waiting on a fix for compile glitch in courier-1.1.6 package.

opensorcerer commented on 2021-12-28 13:32 (UTC)

@vario Right, sorry.

vario commented on 2021-12-27 16:34 (UTC)

@opensorcerer make is part of the base-devel group, which is a prerequisite of AUR use. See Getting started

opensorcerer commented on 2021-12-27 16:13 (UTC)

In all courier-* packages make seems to be missing from makedepends. I at least had to separately install it on a clean Arch machine to not run into an error involving makefiles (which does not tell one that make is missing).

vario commented on 2021-08-21 07:26 (UTC)

I've just added a new package for courier-pythonfilter if anyone would like to use it.

vario commented on 2021-08-06 14:17 (UTC) (edited on 2021-08-07 04:24 (UTC) by vario)

Added "restart" option to systemd unit files (patch to imapd-ssl included).

vario commented on 2021-08-06 13:24 (UTC)

@andrej - looks like a typo on unless I'm mistaken?

andrej commented on 2021-08-06 12:48 (UTC)

@vario Sam has just added restart into imapd-ssl, so it will probably appear in the next minor release.

vario commented on 2021-08-06 10:10 (UTC) (edited on 2021-08-06 10:11 (UTC) by vario)

@andrej - no problem, seems reasonable to have all options reflected in the unit files. I'll wait on an outcome for your imapd-ssl issue before implementing, though since imapd-ssl just runs the imapd binary with different options I don't see why the restart option can't be added.

andrej commented on 2021-08-06 09:06 (UTC) (edited on 2021-08-06 09:06 (UTC) by andrej)

It looks like most Courier’s startup scripts (with a surprising exception of imapd-ssl) have a restart command, which (by its semantics of sending a SIGHUP) corresponds to systemd’s reload command. However, the unit files in this package don’t support it.

I’ve added that using config drop-ins like these:


ExecReload=/usr/sbin/esmtpd restart


ExecReload=/usr/sbin/esmtpd-ssl restart


ExecReload=/usr/sbin/imapd restart


ExecReload=/usr/sbin/courier restart

It might be helpful to have this^^^ in the mainstream unit files.

vario commented on 2021-04-13 11:14 (UTC)

That's not what pkgrel is for. You have to look out for your locally built package dependencies. You'll be aware next time! Also look out for authlib update just released...

andrej commented on 2021-04-12 23:07 (UTC) (edited on 2021-04-12 23:08 (UTC) by andrej)

My courier.service didn’t start after a recent update to courier-unicode.

systemd[1]: Starting Courier Daemon...
courier[9751]: /usr/sbin/courier: error while loading shared libraries: cannot open shared object file: No such file or directory
systemd[1]: courier.service: Control process exited, code=exited, status=127/n/a
systemd[1]: courier.service: Failed with result 'exit-code'.
systemd[1]: Failed to start Courier Daemon.

This needs a pkgrel increase to force a rebuild. Rebuilding helped on my system.

vario commented on 2021-03-09 12:11 (UTC)

@andrej - my only thought is that you have modified one of the config files maintained by sysconftool in a way it doesn't like. These files all have a line near the top saying "created from <something>.dist by sysconftool". More than that I can't guess, but I have tried to follow the Courier installation process as closely as I can within the constraints of also conforming to Arch packaging guidelines.

andrej commented on 2021-03-07 00:16 (UTC)

@vario Yes, my comments are unhelpful, but so is a configuration broken by an update (with a mail server down and/or insecure). :-)

Point taken, next time I'll try to describe how I fixed my configuration instead of ranting about what exactly got broken.

vario commented on 2021-02-16 09:18 (UTC) (edited on 2021-02-17 10:53 (UTC) by vario)

@andrej - perhaps instead of leaving unhelpful and inaccurate comments which probably have more to do with your peculiar setup you should ask on the courier-users list for help with your problems. I have tried to get this package operating as specified in the Courier install instructions and nothing in the install method has changed since version 0.78. The package is working as expected and to spec.

andrej commented on 2021-02-13 18:36 (UTC) (edited on 2021-02-13 18:58 (UTC) by andrej)

The latest version is utterly broken, esmtp doesn't work. Prints out unlimited and exits.

EDIT: Oh, alright, that's because it wiped out my configuration. Great. (To the point that the port number was missing on couriertcpd's command line, which is why it failed to start.)

EDIT2: Heck, this is dangerously broken. The automatic configuration update (why does it touch my configuration in the first place?) transfers some options, but silently discards other options. Discarded options:

  • PORT (causes it to fail to start)
  • TLS_CIPHER_LIST (potentially risky if removed)
  • TARPIT (!)

Not good.

insanityOS commented on 2021-01-11 01:14 (UTC)

requires wget for build

vario commented on 2020-06-20 05:25 (UTC)

Version 1.0.14 - requires authlib 0.71.0

vario commented on 2020-04-21 06:41 (UTC) (edited on 2020-04-21 06:44 (UTC) by vario)

Version 1.0.12 released. Fail2ban users please note revised error format in logs includes a port number so you'll need to tweak the filter prefregex to include it.

vario commented on 2019-12-20 13:09 (UTC)

Perhaps you need to raise these issues on the courier-users list. I continue to use courier-mta without problems.

markc commented on 2019-12-20 00:19 (UTC)

Sadly indeed. I used the full Courier suite, including sqwebmail, with a hosting company for about 20 years. The *buntu deb packages stopped being updated 3 or 4 years ago but that server remained in action up until August of this year when I finally swapped it all out for postfix/dovecot. It was a stellar mail server suite remembered with much fondness. RIP Courier.

andrej commented on 2019-12-19 22:54 (UTC) (edited on 2019-12-19 22:55 (UTC) by andrej)

Sadly enough, this thing is slowly getting broken beyond repair. :-( (Not the package, but the upstream.)

Things like smtpaccess/default (followed by makesmtpaccess) stopped working completely and have no effect whatsoever. This may be either dangerous or annoying, depending on whether you try to ban or whitelist something. None of my whitelisted (i.e., troublesome, but important) fellow mail servers could send mail to my server any more. After a lot of investigation, I found out that the only way to allow them again is to set BOFHCHECKDNS=0 globally (in esmtpd).

I'm sorry to say that, because courier-mta has served me very well for way more than a decade, but ... this thing is terminally broken and most likely dangerous. I'll be migrating away from it ASAP. I'm not sure about the "Possible" part of ASAP yet, but will try my best.

vario commented on 2018-12-07 11:14 (UTC)

All done, or at least I hope so. Guess not many people use Courier webmail - I use roundcube for mine.

deep_thought commented on 2018-12-07 10:16 (UTC) (edited on 2018-12-07 10:16 (UTC) by deep_thought)

thanks! yet another thing:

systemctl start webmaild

times out (but the daemon process is started), because it's looking for the wrong pid file: it looks for /run/courier/, but the daemon creates /run/courier/ I'm not sure, from where it takes that information, but as I just installed courier-mta, I guess it's the default config. Can you please adopt the PIDFile-option in /usr/lib/systemd/system/webmaild.service ?

cheers, deep_thought

vario commented on 2018-12-03 18:02 (UTC)

I've added it to the depends list.

deep_thought commented on 2018-12-02 14:33 (UTC)

The build fails during configure with:

... configure: error: libidn not found ==> ERROR: A failure occurred in build().

On a similar host, where libidn is installed (as a dependency of another package), the build succeeds. I guess, you need to add libidn as a depends=() (or possibly only a makedepends?)

vario commented on 2018-10-13 20:42 (UTC)

The development version has made it to a stable release.

vario commented on 2018-10-08 10:59 (UTC) (edited on 2018-10-09 07:05 (UTC) by vario)

As a temporary workaround I have put up the development version which I have been running with no problems. It generates a "placeholder" message when the client fails to negotiate a fetch of Unicode email, and will get around various email clients failing to handle the error. I can also recommend either that latest Evolution, or emClient for Unicode email handling!

andrej commented on 2018-10-08 04:16 (UTC)

It would be great to have a temporary workaround. The UTF-8 bug is (only) annoying in Thunderbird, but it probably causes other clients (e.g. R2Mail2) to silently fail and ignore new messages.

vario commented on 2018-10-01 16:37 (UTC) (edited on 2018-10-01 16:42 (UTC) by vario)

There is an issue with UTF-8 messages not being displayed by various email readers. I'm currently running a development version which has a workaround and will happily put it up here if anyone else thinks it a good idea.

vario commented on 2018-09-21 16:35 (UTC) (edited on 2018-10-01 14:21 (UTC) by vario)

Enjoy Courier 1.0 - but don't forget to check your maildir names.

vario commented on 2018-08-03 06:56 (UTC) (edited on 2018-08-06 07:52 (UTC) by vario)

For the new Courier package version, I have changed the service files to directly reference "/run" rather than the "/var/run" symlink. This has stopped the PIDFILE problems (I think because the "/var" pathname element is not used) and courier is also reconfigured to use /run for PID files. I have also removed the ExecStartPre lines from the service files, as the "/run/courier" folder is created on installation.

andrej commented on 2018-02-10 09:19 (UTC) (edited on 2018-02-10 09:21 (UTC) by andrej)

Thanks for maintaining this package.

At the moment there’s an urgent problem: courier-imapd will not start due to this systemd bug:

courier-imapd.service: Permission denied while opening PID file or unsafe symlink chain: /var/run/courier/

I’m not sure what the best solution would be, so I’m just dropping a note here, to make troubleshooting easier for others. The only workaround seems to be to start the Courier stuff manually until systemd gets fixed. This affects also authdaemond. courier-courierfilter works fine though.

vario commented on 2017-12-13 12:40 (UTC) (edited on 2017-12-13 13:16 (UTC) by vario)

@andrej - I have modified the PKGBUILD to avoid overwriting config files not managed by sysconftool. Sorry for your trouble, I had misunderstood pacman upgrades and because I have not changed my aliases and smtpaccess files didn't notice the overwrite.

vario commented on 2017-12-13 06:59 (UTC) (edited on 2017-12-13 11:27 (UTC) by vario)

@andrej - sorry you're having problems. I am running a live installation of this package without problems. Upgrades work fine. I have tried to be careful with my changes to the PKGBUILD and .install file so will explain my reasons.

I have made use of sysconfigtool as recommended by the standard Courier install process (see as this removes the need to manually compare .pacnew and .pacsave files.

There are many files that get modified as part of a normal Courier installation - not just those few listed in the old PKGBUILD "backup" option of the package as I took over it which are taken care of by sysconfigtool anyway now. The "_backup trick" you mention is no longer used - I removed that from the .install in favour of a complete copy of /etc/courier on package removal.

I will look at the aliases/system file and others you mention. I may have misunderstood pacman's handling of files on upgrade.

You use a symlink instead of an imapd-ssl file - that is not a standard install method so you may well get problems.

I will try and understand your issues - is something like this what you are looking for?

andrej commented on 2017-12-13 01:14 (UTC)

Phew. I finally tracked this down to a nasty bug (yet another one) in the installation / PKGBUILD configuration.

An update copies imapd-ssl to imapd-ssl.bak and overwrites it with the defaults. (That shouldn't be happening; that's what the .dist files are for.) In my setup, imapd-ssl is a symlink to imapd. I only allow STARTTLS and nothing else, so it makes sense to have only one set of variables and avoid confusion.

Replacing imapd-ssl in effect overwrote the TLS-related variables (which are bundled in my imapd file) with defaults from the new imapd-ssl. Consequently, courier-imapd couldn't access its certificate file and failed.

How I debugged this: Surprisingly, one can't diagnose this with openssl s_client. Yet telnet helps:

$ telnet localhost 143
Trying ::1...
Connected to localhost.
Escape character is '^]'.
help NO Error in IMAP command received by server.
STARTTLS OK Begin SSL/TLS negotiation now.
STARTTLS NO STARTTLS failed: couriertls: /usr/share/imapd.pem: error:02001002:system library:fopen:No such file or directory
* NO Error in IMAP command received by server.

Here^^^ I basically sent it a STARTTLS command manually and was expecting only the negotiation message. But the answer says it loud and clear: /usr/share/imapd.pem was indeed missing. That was the incorrect value from the overwritten imapd-ssl file.

Restoring the imapd-ssl -> imapdsymlink restored law and order.

andrej commented on 2017-12-13 00:08 (UTC) (edited on 2017-12-13 01:04 (UTC) by andrej)

EDIT: The problem below is not a library compatibility issue. (See above.)

Just a warning: IMAP currently doesn't work at all. I can see similar symptoms as described in this comment, but this time it's not the same problem. The symptoms persist

  • with both OpenSSL and GnuTLS (--with-gnutls), although GnuTLS doesn't show the error.
  • even after a downgrade from 0.78.2-1 to 0.78.1-1.

Basically the IMAP server is closing incoming connections immediately. There doesn't seem to be a misnamed binary this time. Nothing interesting appears in the logs, just a connection and a disconnection.

It looks like some shared libraries became incompatible with Courier-IMAP.

$ openssl s_client -starttls imap -connect [::1]:143
140648751691328:error:1408F10B:SSL routines:ssl3_get_record:wrong version number:ssl/record/ssl3_record.c:252:
no peer certificate available
No client certificate CA names sent
SSL handshake has read 534 bytes and written 202 bytes
Verification: OK
New, (NONE), Cipher is (NONE)
Secure Renegotiation IS NOT supported
Compression: NONE
Expansion: NONE
No ALPN negotiated
    Protocol  : TLSv1.2
    Cipher    : 0000
    PSK identity: None
    PSK identity hint: None
    SRP username: None
    Start Time: 1513116697
    Timeout   : 7200 (sec)
    Verify return code: 0 (ok)
    Extended master secret: no

Surprisingly, ESMTP (with TLS) works perfectly fine, so this is an IMAP-specific problem.

andrej commented on 2017-12-10 08:12 (UTC)

The "/etc/courier/_backup" trick (whatever it's supposed to do) doesn't work. It overwrites some of the configuration files from which the .dat files are generated, pretty much without warning. Only one file appears in "_backup", which should contain a copy of smtpaccess/default, yet the copy is in fact lost and the file has the default contents in it.

Can the relevant files be listed in the PKGBUILD so that pacman can't overwrite them? There used to be some obscure historical reasons not to do so, but those may not be relevant any more. The following files are affected:

aliases/system [overwritten, backup completely lost] esmtpacceptmailfor.dir/esmtpacceptmailfor [not touched, no pacsave/pacnew] hosteddomains/hosteddomains [not touched, no pacsave/pacnew] imapaccess/default [not touched, no pacsave/pacnew] smtpaccess/default [overwritten, no backup attempted]

vario commented on 2017-10-06 17:46 (UTC) (edited on 2017-10-07 08:54 (UTC) by vario)

Update to courier-mta 0.78.1 - but during makepkg got "error: command failed to execute correctly" immediately after "Processing package changes". I don't know what caused this and the upgraded package is OK so I have pushed the PKGBUILD anyway.

vario commented on 2017-08-19 17:15 (UTC) (edited on 2017-08-19 17:19 (UTC) by vario)

Sorry, my fault for not testing the quoted variables. I have updated to 0.78.0 and properly tested (i.e it is actually running on my server).

andrej commented on 2017-08-18 01:56 (UTC)

This doesn't build on my system: sed: can't read /tmp/yaourt-tmp-andrej/aur-courier-mta/pkg/courier-mta/etc/courier/*.authpam: No such file or directory

vario commented on 2017-08-14 13:04 (UTC)

Thanks for the tips midgard, I am new to PKGBUILD. I have incremented the release number to show these changes (and my minor change to the .install file)

midgard commented on 2017-08-13 13:00 (UTC)

Hi, in PKGBUILD you should quote variables that may contain spaces, in particular ${srcdir} and ${pkgdir} on lines 53, 78, 80, 83, 86, 89, 91, 111 and 119-121. You should prefix vars you introduce (pamfile on line 89) with an underscore, to avoid interference with makepkg internals. Alternatively, since the var is only used inside package(), you may use a local variable instead: local pamfile for pamfile in ...

vario commented on 2017-08-13 09:56 (UTC)

I updated the package install process - tidied up the code and tried to bring the process more into line with a standard Courier install. Hope everyone is OK with my changes!

vario commented on 2017-07-31 20:25 (UTC) (edited on 2017-08-01 08:26 (UTC) by vario)

I can't compile this package after updating my courier-authlib to 0.68.0: rfc2047.c:379:30: error: unknown type name 'unicode_char' static int encode_word(const unicode_char *uc, Need to update to courier-mta-0.77.0

JesusMcCloud commented on 2016-04-17 11:08 (UTC)

My bad! Should be fixed now

markc commented on 2016-04-12 04:38 (UTC)

FWIW this is the first time I've built and tried to install courier-mta for years on a fresh AL install so maybe I need more dependencies and most likely need to rtfm some more... libcouriertls.c:77:21: error: 'SSLv3_method' undeclared here (not in a function) { "SSL3", &SSLv3_method, SSL_OP_ALL }, Makefile:576: recipe for target 'libcouriertls.lo' failed core/gnutls 3.4.10-1 [installed] core/openssl 1.0.2.g-3 [installed]

JesusMcCloud commented on 2015-09-13 19:52 (UTC)

Thanks for the input. I don't use STARTTLS, but TLS directly. This setup does not cause any problems.

andrej commented on 2015-09-13 17:53 (UTC)

I certainly don't want/need SSL3 to work. However, the default build with OpenSSL doesn't let Thunderbird connect and it doesn't even let openssl s_client in. The reason is unknown to me, simply because Thunderbird has no problem with TLS 1.2 otherwise. Switching to --with-gnutls on the Courier side resolved the issue and both Thunderbird and s_client connect just fine. FTR, one can do some debugging over encrypted IMAP like this: openssl s_client -starttls imap -connect your.server.address:143 Once you have this^^^ connection, you can do a few debugging steps like IMAP login, inbox queries etc. This is how I diagnosed the problem. I first tried to drop the STARTTLS requirement, just to find out that a clear text login from localhost worked. (So it was not an authdaemon or IMAP server problem.) Next I made STARTTLS mandatory again and tried to connect with s_client. Surprisingly, s_client connections failed with the error message noted below (no matter if I specified TLS 1, 1_1, 1_2 or whatnot on the command line explicitly) when attempted against the OpenSSL-based Courier. Once I switched to --with-gnutls, OpenSSL's s_client had no issues at all. And it says TLS 1.2 in its connection logs. Thunderbird works again, too. Well, this is somewhat weird, but now that GnuTLS doesn't make Courier segfault any more, it seems that everything works fine for me.

JesusMcCloud commented on 2015-09-13 11:50 (UTC)

Thanks @andrej, for pointing out errors in the unit files; this is fixed now. Just to be clear, everything works fine on my machine when built against OpenSSL. Deprecated protocols (such as SSL3) not working, is a *good* thing, not a bug.

markc commented on 2015-09-13 11:12 (UTC)

@andrej I think SSL3 has been removed from the latest courier config files. I can't check atm but it may be possible to add it back to one of the TLS variables. It's also possible OpenSSL have deprecated or removed it too. FWIW.

andrej commented on 2015-09-13 07:39 (UTC)

One more hint for those who run this: A few months ago GnuTLS used to be broken (segfaulting) and OpenSSL used to work fine, supporting even TLS 1.1 and 1.2. Well, not any more... With OpenSSL you'll now get the following error when trying to connect to IMAP with STARTTLS: routines:SSL3_GET_RECORD:wrong version number:s3_pkt.c:362 So I tried to compile Courier-MTA --with-gnutls and IMAP with STARTTLS works for me again.

andrej commented on 2015-09-13 07:23 (UTC)

Could you please fix the broken Systemd unit files? You can't put any shell commands into the unit file, so you need to set ExecStartPre=/bin/sh -c 'whatever stuff you have there now'.

markc commented on 2014-05-27 16:25 (UTC)

FWIW I just built 0.73.1 and it seems to work okay for local testing. I also removed apache from the makedepends line and it did not interfere with the build so would you mind removing apache from the next update as I use nginx. Thanks. @andrej: will take particular note of your problem and will report back if I notice anything similar. I have a Ubuntu 14.04 server with Btrfs that blocks for a few minutes until the client re-logs in. Slightly similar problem.

andrej commented on 2014-03-09 07:22 (UTC)

Courier-MTA 0.73.1 doesn't work for me for some reason. When I build it using the current PKGBUILD (just by editing the version number), I get a faulty Courier that cannot handle IMAP connections. There used to be 2 kinds of problems that could spoil IMAP connections: (1) something related to the (mis)use of Gamin / FAM and the IDLE IMAP extension, and (2) a glitch that caused the IMAP protocol handler (a binary that speaks IMAP and gets exec()'d (probably) by couriertcpd once the initial TCP and TLS matters are set) to be installed into a wrong directory, so the exec() failed and IMAP connections were closed immediately. However, this time it's different. :-( The symptoms are similar to the well-known problems from the past, but it doesn't seem to be anything related to Gamin or installation paths. Additionally, although the IMAP connections are closed immediately according to Courier's logs, the underlying TCP connections remain open, blocking the IMAP client forever. Version 0.72 works OK for me. Sadly I just don't have time to look at the diffs and dig deeper into this issue.

meskarune commented on 2014-01-26 19:44 (UTC)

I'm going to work on getting this cleaned up and updated in the next 2 weeks. There is a new version that was released Jan. 13th. Any suggestions would be great appreciated, I'm fairly new to packaging.

andrej commented on 2013-11-26 18:03 (UTC)

I submitted a DKIM filter package for Courier-MTA. It seems to work fine on my server. Comments are welcome.

JesusMcCloud commented on 2013-10-24 13:19 (UTC)

since upgrading to 0.72 I always get "No such file or directory" when invoking makeuserdb. setting $makedat= "/usr/lib/courier/makedatprog" in the makeuserdb script fixed that

onny commented on 2013-07-13 18:42 (UTC)

@andrej: Implemented your findings and fixes. I agree, that the filesystem structure is quite messy but I don't know if there's a better way for this relatively old program ...

andrej commented on 2013-07-09 06:29 (UTC)

Quick & Ugly & Dirty fix to the issue: 0) Build the package with makepkg without -c. 1) Grab ${srcdir}/imap/imapd (should be >1.5 MB in size) and copy it to /usr/lib/courier/ 2) Edit /usr/share/imapd and replace '/usr/bin/imapd' with '/usr/lib/courier/imapd' This should be fixed in the package... BTW, there also seems to be some build failures that don't stop the entire build process. Looks suspicious. :-(

andrej commented on 2013-07-09 05:46 (UTC)

OK, so I did some debugging of the IMAP issue. It fails with/without the IDLE extension. It fails with/without the mailbox sanity checking. It fails with both fam and gamin. It is *not* related to this issue, because fam doesn't fix it. Based on this, there should be a daemon called imapd. However, in this package, there's /usr/bin/imapd, which is a symlink to /usr/share/imapd (!!!), which later (via courierlogger and couriertcpd) executes /usr/bin/imapd. This looks like a weird cycle that cannot work.

andrej commented on 2013-07-09 03:20 (UTC)

So IMAP does not work at all. This is a critical bug; flagging package out-of-date to warn others.

andrej commented on 2013-07-09 02:10 (UTC)

There's something wrong with this package right now. imapd doesn't work, at least not with TLS. The connection is established, but nothing else happens. Some files end up directly in /usr/share (imapd, imapd-ssl, courierctl.start, esmtpd, esmtpd-ssl and multiple others), which is quite messy. Symlinks from /usr/bin are created, but it's still somewhat weird.

eigengrau commented on 2013-04-04 18:23 (UTC)

Also, please correct me if I'm missing something, but shouldn't the /usr/sbin/authtest binary have root-only permissions? It allows me to retrieve all the hashes from the shadowed passwd as a normal user.. o_O

eigengrau commented on 2013-04-04 18:12 (UTC)

Systemd units do not directly support bash syntax. Lines such as: > ExecStartPre=[ -d /var/run/courier ] || mkdir -p /var/run/courier && chown courier:courier /var/run/courier should instead say: > ExecStartPre=/bin/bash -c '[-d /var/run/courier ] ...... '

onny commented on 2013-01-05 11:07 (UTC)

Thank you andrej for testing. Courier is a very complex package and not easy to maintain. I'm very glad to see some support! I adopted your suggestions to the package. Instead of removing the PIDFile-part from the service file, I added an option to /etc/courier/courierd to create the PID-file. Hope that fixes it

andrej commented on 2013-01-05 02:40 (UTC)

Thx a lot for the update! I have some suggestions, based on the adjustmets I made to the units: 1) An extra unit for 'courierfilter' is needed, I called it courier-courierfilter.service in my configuration. Something like this works for me: [Unit] Description=Courier filter Daemon [Service] Type=forking ExecStartPre=[ -d /var/run/courier ] || mkdir -p /var/run/courier && chown courier:courier /var/run/courier ExecStart=/usr/sbin/courierfilter start ExecStop=/usr/sbin/courierfilter stop PIDFile=/var/run/courier/ [Install] 2) Caution, as noted here [], the 'courier' daemon does *not* create a PID file. Consequently, systemctl start courier will freeze when run from the shell and it will time out, killing the courier processes, when run automatically. (It waits for the PID file that never appears.) Removing the 'PIDFile=...' line from courier.service solves the problem. (Well, it's in no way the best solution, but it works.) 3) When filtering is on, esmtpd and esmtpd-ssl depend on it. They do not 'Require' filtering, for it may not be active, but they should definitely be started 'After' the filter, so this should appear in courier-esmtpd.service and courier-esmtpd-ssl.service: After=courier-courierfilter.service Once again, thank you very much for maintaining this package!

onny commented on 2013-01-04 04:04 (UTC)

@abdrej: done, feedback welcome. If you like, also update the wiki regarding courier documentation

andrej commented on 2012-12-31 04:08 (UTC)

Units for systemd would be really great... :-)