Re: [courier-users] maildrop vs courier-maildrop deb packages
Mark Constable writes: On 17/03/16 21:00, Sam Varshavchik wrote: >> How can I get back the previous maildrop behaviour where it treats >> HOME as from the virtual homedir field rather than the home field >> in /etc/passwd? > > Most likely by explicitly invoking maildrop with the -d option. 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. pgp7hFt3Itoht.pgp Description: PGP signature -- Transform Data into Opportunity. Accelerate data analysis in your applications with Intel Data Analytics Acceleration Library. Click to learn more. http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140___ courier-users mailing list courier-users@lists.sourceforge.net Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users
Re: [courier-users] maildrop vs courier-maildrop deb packages
Mark Constable writes: I know this is about deb packaging details but someone here might know the answer to this question. The very latest ubuntu devel packages are dropping courier-maildrop in favour of just using the maildrop package and aside from the default /etc/courier/maildroprc moving to /etc/maildroprc I've noticed another slight difference... courier-maildrop package, where HOME is from the mysql homedir field... Mar 17 05:12:19 gc3 authdaemond[7616]: Authenticated: sysusername=, sysuserid=1001, sysgroupid=1001, homedir=/home/u/goldcoast.org/home/admin, address=ad...@goldcoast.org, fullname=, maildir=, quota=524288000S, options= Mar 17 05:12:19 gc3 courierlocal[7751]:id=blah, from=,addr=: maildrop: Changing to /home/u/goldcoast.org/home/admin maildrop package, where HOME now seems to be from getent passwd... Mar 17 06:11:29 gc3 courierlocal[7751]:id=blah, from=,addr=: maildrop: Changing to /home/u/goldcoast.org I have uncommented this in /etc/maildroprc but the above getent HOME field remains the same... DEFAULT="$HOME/Maildir" How can I get back the previous maildrop behaviour where it treats HOME as from the virtual homedir field rather than the home field in /etc/passwd? Most likely by explicitly invoking maildrop with the -d option. pgpOYehqQAm7w.pgp Description: PGP signature -- Transform Data into Opportunity. Accelerate data analysis in your applications with Intel Data Analytics Acceleration Library. Click to learn more. http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140___ courier-users mailing list courier-users@lists.sourceforge.net Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users
Re: [courier-users] maildrop vs courier-maildrop deb packages
On 17/03/16 21:00, Sam Varshavchik wrote: >> How can I get back the previous maildrop behaviour where it treats >> HOME as from the virtual homedir field rather than the home field >> in /etc/passwd? > > Most likely by explicitly invoking maildrop with the -d option. 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}" -- Transform Data into Opportunity. Accelerate data analysis in your applications with Intel Data Analytics Acceleration Library. Click to learn more. http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140 ___ courier-users mailing list courier-users@lists.sourceforge.net Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users
Re: [courier-users] maildrop vs courier-maildrop deb packages
Mark Constable writes: On 17/03/16 22:27, Sam Varshavchik wrote: >> 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. I guess you meant something like this? DEFAULTDELIVERY="|/usr/bin/maildrop -w 90 -V 9 -d '${RECIPIENT}'" No: DEFAULTDELIVERY='|/usr/bin/maildrop -w 90 -V 9 -d ${RECIPIENT}' You want to set DEFAULTDELIVERY to contain exactly that. double-quotes do shell variable expansion when parsed. RECIPIENT gets set during delivery. Apostrophes do not do shell variable expansion, so this sets DEFAULTDELIVERY to contain the actual '${RECIPIENT}', instead of whatever that environment variable had, if anything, in the inherited environment when the server starts. Pedantically, it should be DEFAULTDELIVERY='|/usr/bin/maildrop -w 90 -V 9 -d "${RECIPIENT}"' to guard against a wildcard virtual domain alias allowing some clown to use an address with shell special characters. pgpcimKi5siit.pgp Description: PGP signature -- Transform Data into Opportunity. Accelerate data analysis in your applications with Intel Data Analytics Acceleration Library. Click to learn more. http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140___ courier-users mailing list courier-users@lists.sourceforge.net Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users
Re: [courier-users] maildrop vs courier-maildrop deb packages
On 18/03/16 12:20, Sam Varshavchik wrote: > Pedantically, it should be > > DEFAULTDELIVERY='|/usr/bin/maildrop -w 90 -V 9 -d "${RECIPIENT}"' > > to guard against a wildcard virtual domain alias allowing some clown > to use an address with shell special characters. Right, I tried that but when I did not get any debug output to tell me what "maildrop: Changing to /home/etc" was I assumed that it was not quite the right incarnation so I kept trying other combinations. Then I reread your maildrop page again and sure enough... -V is ignored when maildrop runs in delivery mode. http://www.courier-mta.org/maildrop/maildrop.html These 2 paragraphs seem to be the most relevant but at no point is it obvious WHICH $HOME var is going to be used (getent or virtual) but if I reread the 2nd parargraph a few more times then it could be obvious that it was referring to the virtual $HOME (the one I want). > If a filename is not specified on the command line, or if the -d > option is used, maildrop will run in delivery mode. In delivery mode, > maildrop changes to the home directory of the user specified by the > -d option (or the user who is running maildrop if the -d option was > not given) and reads $HOME/.mailfilter for filtering instructions. > $HOME/.mailfilter must be owned by the user, and have no group or > global permissions (maildrop terminates if it does). > The -d option can also specify a name of a virtual account or > mailbox. See the makeuserdb(1) manual page in the Courier > Authentication library's documentation for more information. Anyway, it seems to be working. I can set the getent $HOME to be root owned (so that I can use SFTP/SSH chroots) and still have mail delivered inside that area to the virtual $HOME as was possible with the courier-maildrop deb package. Sam, thank you once again... especially for your pedantic help :-) -- Transform Data into Opportunity. Accelerate data analysis in your applications with Intel Data Analytics Acceleration Library. Click to learn more. http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140 ___ courier-users mailing list courier-users@lists.sourceforge.net Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users
Re: [courier-users] maildrop vs courier-maildrop deb packages
On 17/03/16 22:27, Sam Varshavchik wrote: >> >> How can I get back the previous maildrop behaviour where it treats >> >> HOME as from the virtual homedir field rather than the home field >> >> in /etc/passwd? >> > >> > Most likely by explicitly invoking maildrop with the -d option. >> >> 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. I guess you meant something like this? DEFAULTDELIVERY="|/usr/bin/maildrop -w 90 -V 9 -d '${RECIPIENT}'" No difference with every permutation of the above I could think of. *** To demonstrate the problem in case anyone else knows how to tweak the regular maildrop deb package to behave like the courier-maildrop package... courier-maildrop package Mar 17 05:12:19 gc3 authdaemond[7616]: Authenticated: sysusername=, sysuserid=1001, sysgroupid=1001, homedir=/home/u/goldcoast.org/home/admin, address=ad...@goldcoast.org, fullname=, maildir=, quota=524288000S, options= Mar 17 05:12:19 gc3 courierlocal[7751]:id=blah, from=,addr=: maildrop: Changing to /home/u/goldcoast.org/home/admin maildrop package Mar 17 06:11:29 gc3 courierlocal[7751]:id=blah, from=,addr=: maildrop: Changing to /home/u/goldcoast.org -- Transform Data into Opportunity. Accelerate data analysis in your applications with Intel Data Analytics Acceleration Library. Click to learn more. http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140 ___ courier-users mailing list courier-users@lists.sourceforge.net Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users