Long queue IDs in Postfix

Alvaro Marín alvaro at hostalia.com
Thu Oct 6 09:57:58 UTC 2016


Hi,

I've attached 2 patches to the GitHub's issue:

https://github.com/MailScanner/v5/issues/15

Regards,

El 02/09/16 a las 14:52, Alvaro Marín escribió:
> Hi again,
> 
> since the day we talked, I've a server that scans ~90k mails/day, that
> has been running with this patch applied and it works fine.
> 
> I've been working in another patch that provides support for long queue
> IDs and hash queue depth > 0 in the Postfix's incoming directory .
> 
> Postfix's defaults are:
> 
> hash_queue_depth = 1
> hash_queue_names = deferred, defer
> 
> but if the incoming queue is hashed too, for example, if we have:
> 
> hash_queue_names = incoming, active, deferred, bounce, defer, flush,
> hold, trace
> 
> only short queue IDs can be used, as we discussed 2 years ago:
> 
> http://lists.mailscanner.info/pipermail/mailscanner/2014-May/101348.html
> 
> the problem is when the outgoing file is created:
> 
>   if ($MailScanner::SMDiskStore::HashDirDepth == 2) {
>     $this->{hdname} =~ /^(.)(.)(.*)$/;
>     $this->{hdpath} = "$dir/$1/$2/" . $this->{hdname};
>   } elsif ($MailScanner::SMDiskStore::HashDirDepth == 1) {
>     $this->{hdname} =~ /^(.)(.*)$/;
>     $this->{hdpath} = "$dir/$1/" . $this->{hdname};
>   } elsif ($MailScanner::SMDiskStore::HashDirDepth == 0) {
>     $this->{hdname} =~ /^(.*)$/;
>     $this->{hdpath} = "$dir/" . $this->{hdname};
>   }
> 
> this code is valid for short queue IDs but not for long ones (the
> hierarchy is not generated using the first characters of the ID, as that
> code do).
> 
> I'll test it and the next week i'll create an issue in github.
> 
> Regards,
> 
> 
> El 29/08/16 a las 16:00, Jerry Benton escribió:
>> Alvaro,
>>
>> Thank you. If you get a chance to test it on 5.0.3, which is the
>> latest stable version, let me know. I will try to take a look at it.
>> Mark may as well as he also uses Postfix.
>>
>>
>> -
>> Jerry Benton
>> www.mailborder.com
>> +1 - 844-436-6245
>>
>>
>> -----Original Message-----
>> From: Alvaro Marín <alvaro at hostalia.com>
>> Reply: MailScanner Discussion <mailscanner at lists.mailscanner.info>
>> Date: August 29, 2016 at 9:57:44 AM
>> To: mailscanner at lists.mailscanner.info <mailscanner at lists.mailscanner.info>
>> Subject:  Long queue IDs in Postfix
>>
>>> Hi,
>>>
>>> I've this issue opened in github:
>>>
>>> https://github.com/MailScanner/v5/issues/15
>>>
>>> I've enabled long_queue_ids in Postfix (with hash_queue_depth disabled)
>>> and MailScanner works fine, but when it requeues the message, it creates
>>> one message with a short queue ID format:
>>>
>>> MailScanner[14209]: Requeue: 3sK7N64rr3zJX5T.A6FFB to D74D7218040
>>>
>>> The HDOutFileName function generates it in Postfix.pm:
>>>
>>> $file = sprintf("%05X%lX", int(rand 1000000)+1, (stat($file))[1]);
>>>
>>> that should be in a long format.
>>> Reading Postfix's code, I see:
>>>
>>> /*
>>>
>>> The long non-repeating queue ID is encoded in an alphabet of 10 digits,
>>> 21 upper-case characters, and 21 or fewer lower-case characters. The
>>> alphabet is made "safe" by removing all the vowels (AEIOUaeiou). The ID
>>> is the concatenation of:
>>> - the time in seconds (base 52 encoded, six or more chars),
>>> - the time in microseconds (base 52 encoded, exactly four chars),
>>> - the 'z' character to separate the time and inode information,
>>> - the inode number (base 51 encoded so that it contains no 'z'). */
>>>
>>> So I've created a patch that implements this functionality (if long
>>> queue ids format is enabled, if not, it will be generated as usual).
>>>
>>> I'm running MailScanner-4.84.5-3 (with the patch to manage long queue
>>> IDs from 4.85.1-1 version) and it runs fine (the patch attached is done
>>> against last stable release code of MailScanner); I'll be watching it
>>> for some days.
>>>
>>> Regards,
>>> --
>>> Alvaro Marín Illera
>>> Hostalia Internet
>>> www.hostalia.com
>>>
>>>
>>>
>>> --
>>> MailScanner mailing list
>>> mailscanner at lists.mailscanner.info
>>> http://lists.mailscanner.info/listinfo/mailscanner
>>>
>>>
>>
>>
> 
> 


-- 
Alvaro Marín Illera
Hostalia Internet
www.hostalia.com



More information about the MailScanner mailing list