New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FWIW] Build 20160306 of courier and courier-imap packages #299

Closed
markc opened this Issue Mar 14, 2016 · 24 comments

Comments

Projects
None yet
2 participants
@markc
Copy link

markc commented Mar 14, 2016

I know this is only a dev update but that first bullet point is very important. Being able to provide multiple SSL certificates via a single IP to most mail clients is an awesome feature. It was possible before using GnuTLS but not when built with OpenSSL, but it is now.


Download: http://www.courier-mta.org/download.html

Changes since the last release:

  • courier, courier-imap: add support for TLS SNI when Courier is built with OpenSSL.
  • courier: "mx" SPF keyword ignores hosts without an MX, instead of returning an error.
  • maildrop: fix parsing a message without a body, and without a blank line that separates the message's headers from its body. This did not affect Courier which always inserts a blank line after headers, even if a received message didn't have one.
  • maildrop: fix maildrop not searching the last line of a text message.
  • maildrop: FLAGS variable sets message flags when delivering a message
    to a maildir.
  • Add Received-SPF: headers for the message envelope sender before the first Received: header. The Received-SPF: header for the HELO domain, if enabled, wasn't being added to the message due to a bug.
  • courier-imap: explicitly flush unread input when executing STARTTLS.
@oerdnj

This comment has been minimized.

Copy link
Owner

oerdnj commented Mar 15, 2016

@markc Did you had a chance to test the sandboxed packages? I can't go forward without those changes. It shouldn't be much work to prepare ppa:ondrej/courier-qa or ppa:ondrej/courier-dev with the development packages, but I need to iron out the major changes I did first.

@markc

This comment has been minimized.

Copy link

markc commented Mar 15, 2016

No, I've been rebuilding my server setup scripts and only just got them 90% working again yesterday. I was not looking forward to downloading debs and manually installing them so are you suggesting that I could access them via a deb list in /etc/apt/sources.list and apt install them in one go? If so then I could test the main packages within the next 12 hours. If instead I have to download individual packages and dpkg -i them then it'll take me longer.

@oerdnj

This comment has been minimized.

Copy link
Owner

oerdnj commented Mar 15, 2016

Should be as easy as adding ppa:ondrej/sandbox

@markc

This comment has been minimized.

Copy link

markc commented Mar 15, 2016

Ah right, this is the one I needed (I remove python from most of my servers)...

deb http://ppa.launchpad.net/ondrej/sandbox/ubuntu xenial main

My main goldcoast.org container has been up and running again for a few hours so I dropped these new packages into it but it fell over on the first package.

Unpacking courier-authdaemon (0.66.4-4+deb.sury.org~xenial+2) over (0.66.4-3+deb.sury.org~xenial+1) ...
dpkg: error processing archive /var/cache/apt/archives/courier-authdaemon_0.66.4-4+deb.sury.org~xenial+2_amd64.deb (--unpack):
 invalid or unknown syntax in trigger name '/usr/lib/courier-authlib/' (in trigger interests for package 'courier-authdaemon')
~ dpkg -D20000 -i /var/cache/apt/archives/courier-authdaemon_0.66.4-4+deb.sury.org~xenial+2_amd64.deb
(Reading database ... 18311 files and directories currently installed.)
Preparing to unpack .../courier-authdaemon_0.66.4-4+deb.sury.org~xenial+2_amd64.deb ...
D020000: trigproc_activate_packageprocessing pkg=courier-authdaemon:amd64
Unpacking courier-authdaemon (0.66.4-4+deb.sury.org~xenial+2) over (0.66.4-3+deb.sury.org~xenial+1) ...
D020000: post_script_tasks - ensure_diversions
D020000: post_script_tasks - trig_incorporate
dpkg: error processing archive /var/cache/apt/archives/courier-authdaemon_0.66.4-4+deb.sury.org~xenial+2_amd64.deb (--install):
 invalid or unknown syntax in trigger name '/usr/lib/courier-authlib/' (in trigger interests for package 'courier-authdaemon')
D020000: check_triggers_cycle pnow=systemd:amd64 first
Processing triggers for systemd (229-2ubuntu1) ...
D020000: post_postinst_tasks - trig_incorporate
D020000: tortoise_not_in_hare pnow=ureadahead tortoise=systemd
D020000: tortoise_not_in_hare pnow=ureadahead tortoise=systemd tortoisetrig=/etc/init.d
D020000: tortoise_not_in_hare pnow=ureadahead tortoise=systemd OK
Processing triggers for ureadahead (0.100.0-19) ...
D020000: post_postinst_tasks - trig_incorporate
Errors were encountered while processing:
 /var/cache/apt/archives/courier-authdaemon_0.66.4-4+deb.sury.org~xenial+2_amd64.deb
@oerdnj

This comment has been minimized.

Copy link
Owner

oerdnj commented Mar 15, 2016

@markc I believe this has been fixed in +3. Found some other error in courier-authlib-sqlite package, but unless you use it, it should be fine as of now:

root@lettie:~# apt-get install courier-imap
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  courier-authdaemon courier-authlib courier-authlib-userdb courier-base
  expect init-d-script libcourier-unicode1 libfam0 libltdl7 libtcl8.6 postfix
  ssl-cert
Suggested packages:
  courier-doc imap-client fam tcl8.6 procmail postfix-mysql postfix-pgsql
  postfix-ldap postfix-pcre sasl2-bin libsasl2-modules dovecot-common
  resolvconf postfix-cdb ufw postfix-doc openssl-blacklist
The following NEW packages will be installed:
  courier-authdaemon courier-authlib courier-authlib-userdb courier-base
  courier-imap expect init-d-script libcourier-unicode1 libfam0 libltdl7
  libtcl8.6 postfix ssl-cert
0 upgraded, 13 newly installed, 0 to remove and 0 not upgraded.
Need to get 1765 kB/2809 kB of archives.
After this operation, 10.5 MB of additional disk space will be used.
Do you want to continue? [Y/n] 
Get:1 http://eu.archive.ubuntu.com/ubuntu/ trusty/main ssl-cert all 1.0.33 [16.6 kB]
Get:2 http://eu.archive.ubuntu.com/ubuntu/ trusty-updates/main postfix amd64 2.11.0-1ubuntu1 [1084 kB]
Get:3 http://ppa.launchpad.net/ondrej/sandbox/ubuntu/ trusty/main courier-authlib amd64 0.66.4-4+deb.sury.org~trusty+3 [74.2 kB]
Get:4 http://ppa.launchpad.net/ondrej/sandbox/ubuntu/ trusty/main init-d-script amd64 2.88dsf+59+deb.sury.org~trusty+1 [5154 B]
Get:5 http://ppa.launchpad.net/ondrej/sandbox/ubuntu/ trusty/main courier-authdaemon amd64 0.66.4-4+deb.sury.org~trusty+3 [9480 B]
Get:6 http://ppa.launchpad.net/ondrej/sandbox/ubuntu/ trusty/main courier-authlib-userdb amd64 0.66.4-4+deb.sury.org~trusty+3 [34.3 kB]
Get:7 http://ppa.launchpad.net/ondrej/sandbox/ubuntu/ trusty/main libcourier-unicode1 amd64 1.4-2+deb.sury.org~trusty+2 [40.2 kB]
Get:8 http://ppa.launchpad.net/ondrej/sandbox/ubuntu/ trusty/main courier-base amd64 0.75.0-14+deb.sury.org~trusty+2 [262 kB]
Get:9 http://ppa.launchpad.net/ondrej/sandbox/ubuntu/ trusty/main courier-imap amd64 4.16.2+0.75.0-14+deb.sury.org~trusty+2 [239 kB]
Fetched 1765 kB in 0s (2133 kB/s) 
Preconfiguring packages ...
Selecting previously unselected package libltdl7:amd64.
(Reading database ... 22863 files and directories currently installed.)
Preparing to unpack .../libltdl7_2.4.2-1.7ubuntu1_amd64.deb ...
Unpacking libltdl7:amd64 (2.4.2-1.7ubuntu1) ...
Selecting previously unselected package libtcl8.6:amd64.
Preparing to unpack .../libtcl8.6_8.6.1-4ubuntu1_amd64.deb ...
Unpacking libtcl8.6:amd64 (8.6.1-4ubuntu1) ...
Selecting previously unselected package expect.
Preparing to unpack .../expect_5.45-5ubuntu1_amd64.deb ...
Unpacking expect (5.45-5ubuntu1) ...
Selecting previously unselected package courier-authlib.
Preparing to unpack .../courier-authlib_0.66.4-4+deb.sury.org~trusty+3_amd64.deb ...
Unpacking courier-authlib (0.66.4-4+deb.sury.org~trusty+3) ...
Selecting previously unselected package init-d-script.
Preparing to unpack .../init-d-script_2.88dsf+59+deb.sury.org~trusty+1_amd64.deb ...
Unpacking init-d-script (2.88dsf+59+deb.sury.org~trusty+1) ...
Selecting previously unselected package courier-authdaemon.
Preparing to unpack .../courier-authdaemon_0.66.4-4+deb.sury.org~trusty+3_amd64.deb ...
Unpacking courier-authdaemon (0.66.4-4+deb.sury.org~trusty+3) ...
Selecting previously unselected package courier-authlib-userdb.
Preparing to unpack .../courier-authlib-userdb_0.66.4-4+deb.sury.org~trusty+3_amd64.deb ...
Unpacking courier-authlib-userdb (0.66.4-4+deb.sury.org~trusty+3) ...
Selecting previously unselected package libcourier-unicode1:amd64.
Preparing to unpack .../libcourier-unicode1_1.4-2+deb.sury.org~trusty+2_amd64.deb ...
Unpacking libcourier-unicode1:amd64 (1.4-2+deb.sury.org~trusty+2) ...
Selecting previously unselected package libfam0.
Preparing to unpack .../libfam0_2.7.0-17.1_amd64.deb ...
Unpacking libfam0 (2.7.0-17.1) ...
Selecting previously unselected package courier-base.
Preparing to unpack .../courier-base_0.75.0-14+deb.sury.org~trusty+2_amd64.deb ...
Unpacking courier-base (0.75.0-14+deb.sury.org~trusty+2) ...
Selecting previously unselected package ssl-cert.
Preparing to unpack .../ssl-cert_1.0.33_all.deb ...
Unpacking ssl-cert (1.0.33) ...
Selecting previously unselected package postfix.
Preparing to unpack .../postfix_2.11.0-1ubuntu1_amd64.deb ...
Unpacking postfix (2.11.0-1ubuntu1) ...
Selecting previously unselected package courier-imap.
Preparing to unpack .../courier-imap_4.16.2+0.75.0-14+deb.sury.org~trusty+2_amd64.deb ...
Unpacking courier-imap (4.16.2+0.75.0-14+deb.sury.org~trusty+2) ...
Setting up libltdl7:amd64 (2.4.2-1.7ubuntu1) ...
Setting up libtcl8.6:amd64 (8.6.1-4ubuntu1) ...
Setting up expect (5.45-5ubuntu1) ...
Setting up courier-authlib (0.66.4-4+deb.sury.org~trusty+3) ...
Setting up init-d-script (2.88dsf+59+deb.sury.org~trusty+1) ...
Setting up courier-authdaemon (0.66.4-4+deb.sury.org~trusty+3) ...
initctl: Unable to connect to Upstart: Failed to connect to socket /com/ubuntu/upstart: Connection refused
invoke-rc.d: policy-rc.d denied execution of start.
Setting up courier-authlib-userdb (0.66.4-4+deb.sury.org~trusty+3) ...
Setting up libcourier-unicode1:amd64 (1.4-2+deb.sury.org~trusty+2) ...
Setting up libfam0 (2.7.0-17.1) ...
Setting up courier-base (0.75.0-14+deb.sury.org~trusty+2) ...
update-alternatives: using /usr/bin/deliverquota.courier to provide /usr/bin/deliverquota (deliverquota) in auto mode
update-alternatives: using /usr/share/man/man5/maildir.courier.5.gz to provide /usr/share/man/man5/maildir.5.gz (maildir.5.gz) in auto mode
update-alternatives: using /usr/bin/maildirmake.courier to provide /usr/bin/maildirmake (maildirmake) in auto mode
update-alternatives: using /usr/share/man/man7/maildirquota.courier.7.gz to provide /usr/share/man/man7/maildirquota.7.gz (maildirquota.7.gz) in auto mode
update-alternatives: using /usr/bin/makedat.courier to provide /usr/bin/makedat (makedat) in auto mode
512 semi-random bytes loaded
Generating DH parameters, 2048 bit long safe prime, generator 2
This is going to take a long time
...............................................................+........................................................................................................................................................................................................................................................+...............................................................................+.............................+........................................................................................................................+..............................................................+..........+..........................................................................................................................................+................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................+.........................................................................................................+....+..................................................................................................................................................................................+......................+.................................................................+...........+.............................................................................................................................................................+.........................................................+.............................+..+...........................................................................+........................................................................+..................................................................................+.....................................................+........................................................................+.....................................+....................+...................+..................................................................+...............+................................................+.......................................................................................+.................................................+..........................................................................................................................................+.....................................................................................................................+..................................................................................................................................................................................................+........................................................................................................................................+..............................................................................................................................+.......................+..........................................................................................................................................+........................................................+...................+..........................................................................................................+.....................................................................................+.......................+..........................................+.................................................................................................+....................................................+.................................................................................................................................................................................+.......................................................................................................................................+..........................................................................+.................................................................+.......+.............................++*++*
dpkg-statoverride: warning: --update given but /var/lib/courier/tmp does not exist
dpkg-statoverride: warning: --update given but /var/lib/courier/msgs does not exist
dpkg-statoverride: warning: --update given but /var/lib/courier/msgq does not exist
Setting up ssl-cert (1.0.33) ...
Setting up postfix (2.11.0-1ubuntu1) ...
Adding group `postfix' (GID 106) ...
Done.
Adding system user `postfix' (UID 102) ...
Adding new user `postfix' (UID 102) with group `postfix' ...
Not creating home directory `/var/spool/postfix'.
Creating /etc/postfix/dynamicmaps.cf
Adding tcp map entry to /etc/postfix/dynamicmaps.cf
Adding sqlite map entry to /etc/postfix/dynamicmaps.cf
Adding group `postdrop' (GID 107) ...
Done.
setting myhostname: lettie.labs.nic.cz
setting alias maps
setting alias database
setting myorigin
setting destinations: lettie.labs.nic.cz, localhost.labs.nic.cz, , localhost
setting relayhost: 
setting mynetworks: 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
setting mailbox_size_limit: 0
setting recipient_delimiter: +
setting inet_interfaces: all
setting inet_protocols: all
/etc/aliases does not exist, creating it.
WARNING: /etc/aliases exists, but does not have a root alias.

Postfix is now set up with a default configuration.  If you need to make 
changes, edit
/etc/postfix/main.cf (and others) as needed.  To view Postfix configuration
values, see postconf(1).

After modifying main.cf, be sure to run '/etc/init.d/postfix reload'.

Running newaliases
initctl: Unable to connect to Upstart: Failed to connect to socket /com/ubuntu/upstart: Connection refused
invoke-rc.d: policy-rc.d denied execution of restart.
Setting up courier-imap (4.16.2+0.75.0-14+deb.sury.org~trusty+2) ...
Generating a 4096 bit RSA private key
...............................................................++
...................................................................................................................................................................................................................................................++
writing new private key to '/etc/courier/imapd.pem'
-----
subject= /C=US/ST=NY/L=New York/O=Courier Mail Server/OU=Automatically-generated IMAP SSL key/CN=localhost/emailAddress=postmaster@example.com
notBefore=Mar 15 15:11:09 2016 GMT
notAfter=Mar 15 15:11:09 2017 GMT
SHA1 Fingerprint=8D:0D:DA:D0:C5:AA:2E:6A:0B:46:EE:E9:45:B7:C5:5D:75:E8:EF:F9
/run/courier/imapd.pid.lock: No such file or directory
/run/courier/imapd-ssl.pid.lock: No such file or directory
initctl: Unable to connect to Upstart: Failed to connect to socket /com/ubuntu/upstart: Connection refused
invoke-rc.d: policy-rc.d denied execution of start.
initctl: Unable to connect to Upstart: Failed to connect to socket /com/ubuntu/upstart: Connection refused
invoke-rc.d: policy-rc.d denied execution of start.
Processing triggers for libc-bin (2.19-0ubuntu6.7) ...
@markc

This comment has been minimized.

Copy link

markc commented Mar 15, 2016

An upgrade from your previous packages to +2 and then another upgrade that included courier-authdaemon +3 is the same result as below with courier-imap. I removed all courier packages and did a fresh install and it still died.

~ apt-get install --no-install-recommends courier-authdaemon courier-authlib-mysql courier-imap courier-mta courier-maildrop
[... all good until ...]
SHA1 Fingerprint=40:7E:6F:D7:77:F0:3A:14:13:83:E7:EB:7E:3A:A2:91:69:0B:BD:67
insserv: script courier-imap-ssl: service courier-imap already provided!
insserv: script courier-imap-ssl: service courier-imap already provided!
insserv: exiting now!
update-rc.d: error: insserv rejected the script header
dpkg: error processing package courier-imap (--configure):
 subprocess installed post-installation script returned error exit status 1
Processing triggers for libc-bin (2.21-0ubuntu6) ...
Processing triggers for systemd (229-2ubuntu1) ...
Processing triggers for ureadahead (0.100.0-19) ...
Errors were encountered while processing:
 courier-imap
E: Sub-process /usr/bin/dpkg returned an error code (1)
~ dpkg -D1 -i /var/cache/apt/archives/courier-imap_4.16.2+0.75.0-14+deb.sury.org~xenial+2_amd64.deb
D000001: ensure_diversions: new, (re)loading
D000001: ensure_statoverrides: new, (re)loading
(Reading database ... 18262 files and directories currently installed.)
Preparing to unpack .../courier-imap_4.16.2+0.75.0-14+deb.sury.org~xenial+2_amd64.deb ...
D000001: process_archive oldversionstatus=broken due to postinst failure
D000001: ensure_diversions: same, skipping
Unpacking courier-imap (4.16.2+0.75.0-14+deb.sury.org~xenial+2) over (4.16.2+0.75.0-14+deb.sury.org~xenial+2) ...
D000001: ensure_diversions: same, skipping
D000001: process_archive updating info directory
D000001: generating infodb hashfile
D000001: process queue pkg courier-imap:amd64 queue.len 0 progress 1, try 1
Setting up courier-imap (4.16.2+0.75.0-14+deb.sury.org~xenial+2) ...
D000001: deferred_configure updating conffiles
insserv: script courier-imap-ssl: service courier-imap already provided!
insserv: script courier-imap-ssl: service courier-imap already provided!
insserv: exiting now!
update-rc.d: error: insserv rejected the script header
dpkg: error processing package courier-imap (--install):
 subprocess installed post-installation script returned error exit status 1
D000001: ensure_diversions: same, skipping
Processing triggers for systemd (229-2ubuntu1) ...
D000001: ensure_diversions: same, skipping
Processing triggers for ureadahead (0.100.0-19) ...
D000001: ensure_diversions: same, skipping
Errors were encountered while processing:
 courier-imap
~ dpkg --configure courier-imap
Setting up courier-imap (4.16.2+0.75.0-14+deb.sury.org~xenial+2) ...
+ . /usr/share/debconf/confmodule
+ [ !  ]
+ PERL_DL_NONLAZY=1
+ export PERL_DL_NONLAZY
+ [  ]
+ exec /usr/share/debconf/frontend /var/lib/dpkg/info/courier-imap.postinst configure 
+ . /usr/share/debconf/confmodule
+ [ ! 1 ]
+ [ -z  ]
+ exec
+ [  ]
+ exec
+ DEBCONF_REDIR=1
+ export DEBCONF_REDIR
+ [ configure = configure ]
+ [ ! -f /etc/courier/imapd.pem ]
+ db_get courier-base/webadmin-configmode
+ _db_cmd GET courier-base/webadmin-configmode
+ _db_internal_IFS= 

+ IFS= 
+ printf %s\n GET courier-base/webadmin-configmode
+ IFS= 

+ IFS=
 read -r _db_internal_line
+ RET=false
+ return 0
+ [ false = true ]
+ makeimapaccess
+ add_override root courier 0640 /etc/courier/imapd.cnf
+ dpkg-statoverride --list /etc/courier/imapd.cnf
+ [ configure = configure ]
+ [ -d /run/systemd/system ]
+ systemd-tmpfiles --create /usr/lib/tmpfiles.d/courier-imap.conf
+ [ configure = configure ]
+ [ -x /etc/init.d/courier-imap ]
+ update-rc.d courier-imap defaults
insserv: script courier-imap-ssl: service courier-imap already provided!
+ [ -x /etc/init.d/courier-imap ]
+ invoke-rc.d courier-imap start
+ [ configure = configure ]
+ [ -d /run/systemd/system ]
+ systemd-tmpfiles --create /usr/lib/tmpfiles.d/courier-imap.conf
+ [ configure = configure ]
+ [ -x /etc/init.d/courier-imap-ssl ]
+ update-rc.d courier-imap-ssl defaults
insserv: script courier-imap-ssl: service courier-imap already provided!
insserv: exiting now!
update-rc.d: error: insserv rejected the script header
dpkg: error processing package courier-imap (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 courier-imap
@oerdnj

This comment has been minimized.

Copy link
Owner

oerdnj commented Mar 15, 2016

Could you try fixing /etc/init.d/courier-imap-ssl headers and run dpkg --configure -a again?

@oerdnj

This comment has been minimized.

Copy link
Owner

oerdnj commented Mar 15, 2016

This should also be fixed when courier_0.75.0-14+deb.sury.org~*+3 is built.

@oerdnj

This comment has been minimized.

Copy link
Owner

oerdnj commented Mar 15, 2016

@markc Could you retry? I fixed the small bugs.

@markc

This comment has been minimized.

Copy link

markc commented Mar 15, 2016

Just woke up, 9am here. The newest packages installed okay but imapd-ssl shows...

Mar 15 22:57:47 goldcoast.org imapd-ssl[12120]: /usr/lib/courier/courier/imaplogin: error while loading shared libraries: libcourierauth.so: cannot open shared object file: No such file or directory
Mar 15 22:59:46 goldcoast.org courieresmtpd[12099]: /usr/sbin/courieresmtpd: error while loading shared libraries: libcourierauthsasl.so: cannot open shared object file: No such file or directory
~ ldd /usr/sbin/courieresmtpd
        linux-vdso.so.1 =>  (0x00007ffcb5f52000)
        libidn.so.11 => /usr/lib/x86_64-linux-gnu/libidn.so.11 (0x00007f3f875e8000)
        libgdbm.so.3 => /usr/lib/x86_64-linux-gnu/libgdbm.so.3 (0x00007f3f873e2000)
        libcourier-unicode.so.3 => /usr/lib/x86_64-linux-gnu/libcourier-unicode.so.3 (0x00007f3f87199000)
        libcourierauthsasl.so => not found
        libcourierauth.so => not found
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f3f86dce000)
        libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f3f86a4c000)
        libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f3f86836000)
        /lib64/ld-linux-x86-64.so.2 (0x0000557315549000)
        libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f3f8652d000)
~ lspkg courier
courier-authdaemon
courier-authlib
courier-authlib-mysql
courier-authlib-userdb
courier-base
courier-imap
courier-maildrop
courier-mta
libcourier-unicode1:amd64
@oerdnj

This comment has been minimized.

Copy link
Owner

oerdnj commented Mar 15, 2016

It's after midnight here, so it's my last question from phone today. Does dpkg -S libcourierauth.so show something? Similarly for libcourierauthsasl.so?

Do you have some kind of automated setup I could use that setups some demo account that I can verify that the installation is working?

@markc

This comment has been minimized.

Copy link

markc commented Mar 15, 2016

That's odd, they are there...

~ dpkg -S libcourierauth.so
courier-authlib: /usr/lib/courier-authlib/libcourierauth.so
~ ll /usr/lib/courier-authlib/libcourierauth.so
-rw-r--r-- 1 root root 52088 Mar 15 17:24 /usr/lib/courier-authlib/libcourierauth.so
~ dpkg -S libcourierauthsasl.so
courier-authlib: /usr/lib/courier-authlib/libcourierauthsasl.so
~ ll /usr/lib/courier-authlib/libcourierauthsasl.so
-rw-r--r-- 1 root root 14672 Mar 15 17:24 /usr/lib/courier-authlib/libcourierauthsasl.so

I made a backup of /etc/courier before the install and just moved it back in place so markc@goldcoast.org should be a usable incoming mail account.

@markc

This comment has been minimized.

Copy link

markc commented Mar 15, 2016

Oh, I misunderstood your question about a setup script(s). I've been rewriting them for the last month and I'm not sure how generic and stable they are outside my desktop. You are more than welcome to try using them at https://github.com/markc/sh

sudo -i
git clone https://github.com/markc/sh .sh
.sh/shm install
source .shrc
setvhost example.com your_pw
getvhost # (to check the exported variables)
newservice courier mysql

and that might set up a default admin@example.org account with your_pw.

Update: in fact newservice nginx courier mysql might setup nginx with HTTP/2 and your php7.0-fpm packages (which I notice are now in main) as well.

@markc

This comment has been minimized.

Copy link

markc commented Mar 16, 2016

I simply created this file, did a ldconfig and restarted the mail server and all seems well :-)

~ cat /etc/ld.so.conf.d/courier.conf
/usr/lib/courier-authlib
@oerdnj

This comment has been minimized.

Copy link
Owner

oerdnj commented Mar 16, 2016

Gosh, that's the RUNPATH/RPATH madness. I'll probably just add symlinks to /usr/lib since it doesn't clashes with anything anyway.

@oerdnj

This comment has been minimized.

Copy link
Owner

oerdnj commented Mar 16, 2016

@markc All should be fixed in the latest versions of the package. The only new problem might arise with drop of courier-maildrop in favor of maildrop package. I look into packaging the development version soon now.

@markc

This comment has been minimized.

Copy link

markc commented Mar 17, 2016

Yes, I got caught out with the maildrop package. I CC'd you direct from a message to the courier-users@ mailing-list, no response yet.

FWIW I rely on maildrop NOT changing to getent passwd's idea of home because I set it to being root owned so that the real home dir can be SSH chrooted into for secure sftp/ssh access. The previous courier-maildrop version switches to the virtual users idea of homedir so it conveniently "jumps over" the real home dir and starts using the virtual home dirs Maildir directly. For some crazy reason the new maildrop insists on changing to the real home dir first (and fails because it's not owned by the current user) so therefor can't proceed on to the virtual home dirs mailbox. Argh!

@oerdnj

This comment has been minimized.

Copy link
Owner

oerdnj commented Mar 17, 2016

@markc Have you tried with 2.8.3 I uploaded few hours ago? Maybe it was some bug in 2.7.1 version of the package. Theoretically the maildrop and courier-maildrop should be the same as they come from same sources. But who knows what happen in that autoconf/automake madness the upstream use.

@markc

This comment has been minimized.

Copy link

markc commented Mar 17, 2016

@oerdnj yep, the version I tried is 2.8.3-0.1+deb.sury.org~wily+1. This was actually on a customers VPS and now when I go to update my xenial container (I was waiting for the reply below) it seems to have a non-dummy courier-maildrop 2.8.3+0.75.0-15+deb so I guess you have uploaded the original real courier-maildrop... yes, this one works as I expected and avoids the real getent home dir. Thanks for that. I will persist with mrsam and see if I can figure out a way to use the standard maildrop package to emulate courier-maildrops behaviour.

Mar 17 13:22:15 gc3 authdaemond[25202]: Authenticated:
  sysusername=<null>, sysuserid=1001, sysgroupid=1001,
  homedir=/home/u/goldcoast.org/home/admin,
  address=admin@goldcoast.org,
  fullname=<null>, maildir=<null>, quota=524288000S, options=<null>

Mar 17 13:22:15 gc3 courierlocal[25364]: id=blah,
  from=<markc@renta.net>,addr=<admin@goldcoast.org>: 
  maildrop: Changing to /home/u/goldcoast.org/home/admin

vs

~ getent passwd 1001
u1001:x:1001:1001::/home/u/goldcoast.org:/bin/sh

FWIW I just got this reply from the courier author, mrsam, and I guess he means single quotes so I'll try that on my container. (no, didn't work so I'll paste the error to the list and see what happens)

> I've read through most of this twice today...
>
> http://www.courier-mta.org/maildrop/maildropfilter.html
>
> but I can't seem to translate that info into how to "explicitly invoke"
> the -d option in this particular use case...
>
> ./courierd:DEFAULTDELIVERY="|/usr/bin/maildrop -w 90"
>
> Is something like this possible?
>
> DEFAULTDELIVERY="|/usr/bin/maildrop -w 90 -d ${RECIPIENT}"

Make them apostrophes. You don't want variable expansion at the time
this setting is read, but rather when this is executed at delivery time.
@oerdnj

This comment has been minimized.

Copy link
Owner

oerdnj commented Mar 17, 2016

Have you tried this? DEFAULTDELIVERY="|/usr/bin/maildrop -w 90 -d '${RECIPIENT}'" or this DEFAULTDELIVERY='|/usr/bin/maildrop -w 90 -d ${RECIPIENT}'?

@markc

This comment has been minimized.

Copy link

markc commented Mar 17, 2016

Neither of those variations worked. The non-courier maildrop still wanted to change to the getent home dir first. I'll ask on the list tomorrow. In the mean time thanks for courier-maildrop.

Mar 18 01:14:40 gc3 courierlocal[32033]: id=blah,
  from=<markc@renta.net>,addr=<admin@goldcoast.org>:
  maildrop: Changing to /home/u/goldcoast.org
@oerdnj

This comment has been minimized.

Copy link
Owner

oerdnj commented Mar 17, 2016

The courier-maildrop is just a leftover package, so don't rely on it. Well, unless we find that the maildrop package cannot be fixed. But they really should be the same.

@markc

This comment has been minimized.

Copy link

markc commented Mar 18, 2016

I must have been confused with all the variations I tried because your suggestion turned out to be the right one...

DEFAULTDELIVERY='|/usr/bin/maildrop -w 90 -d ${RECIPIENT}'

Tested on a wily VPS and on my xenial container and appears to be working because the getent $HOME is root owned and I just got mail delivered to the virtual $HOME using only the maildrop package :-)

courier-authdaemon      0.66.4-5+deb.sury.org~xenial+3
courier-authlib         0.66.4-5+deb.sury.org~xenial+3
courier-authlib-mysql   0.66.4-5+deb.sury.org~xenial+3
courier-authlib-sqlite  0.66.4-5+deb.sury.org~xenial+3
courier-authlib-userdb  0.66.4-5+deb.sury.org~xenial+3
courier-base            0.75.0-16+deb.sury.org~xenial+1
courier-imap            4.16.2+0.75.0-16+deb.sury.org~xenial+1
courier-mta             0.75.0-16+deb.sury.org~xenial+1
courier-ssl             0.75.0-16+deb.sury.org~xenial+1
libcourier-unicode1     1.4-2+deb.sury.org~xenial+2
maildrop                2.8.3-0.1+deb.sury.org~xenial+2

@markc markc closed this Mar 18, 2016

@markc

This comment has been minimized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment