Fabio Ferrari
2010-Jul-16 13:44 UTC
[Dovecot] Problem with hard links in lda - please help
Hello, I'm trying to enable hardlinks for messages sent to mutiple users. (I need this because I have mailing lists with 5000 users used many times a day). I've read that, to do this, I have to write a script that uses the /usr/local/libexec/dovecot/deliver command in this way: deliver -p <FILE> -d <USER1> -d <USER2> Of course, I enabled the "socket listen" option in the configuration file to get the command line work, and set the maildir_copy_with_hardlinks = yes The deliver command works, so I have the messages correctly in the "new" directory in the maildir folder. But if I list the files, they have the "links" number = 1, so I see that the file was copied, not hardlinked! I see in the page http://wiki.dovecot.org/LDA that is possible, in fact it says Parameters [...] -p <path>: Path to the mail to be delivered instead of reading from stdin. If using maildir the file is hard linked to the destination if possible. This allows a single mail to be delivered to multiple users using hard links, but currently it also prevents deliver from updating cache file so it shouldn't be used unless really necessary. (v1.1+) Of course, I use a version 1.1+ (1.2.12). Please help, thanks in advance Fabio Ferrari
Timo Sirainen
2010-Jul-16 14:13 UTC
[Dovecot] Problem with hard links in lda - please help
On Fri, 2010-07-16 at 15:44 +0200, Fabio Ferrari wrote:> I'm trying to enable hardlinks for messages sent to mutiple users. (I need > this because I have mailing lists with 5000 users used many times a day). > > I've read that, to do this, I have to write a script that uses the > /usr/local/libexec/dovecot/deliver > command in this way: > deliver -p <FILE> -d <USER1> -d <USER2>You can't give more than -d parameter. deliver can deliver a mail only to a single user at a time. The important part is that your MTA calls a script (that you need to create) that gets multiple users as parameters, and then you can call deliver -p for each one of them separately. I don't think MTA can call the delivery script with 5000 parameters, so there must be some duplication always. Also mailing lists often send separate mails to users. If this is happening, hard linking can't be done because the mails are different.
Fabio Ferrari
2010-Jul-26 14:10 UTC
[Dovecot] Problem with hard links in lda - please help
Ok it works now! Thank you very much for your help! Fabio Ferrari> On 23.7.2010, at 11.22, Fabio Ferrari wrote: > >> But now the >> deliver -p FILE -d USER >> crashes, giving me a very bad segmentation fault. > > Often it happens if you have a something=no setting as the first setting > in config file. This triggers a glibc bug and crashes it. Move the setting > down. > >