[BlueOnyx:23962] Re: 5210R: Postfix SNI support + MailDir

Dirk Estenfeld dirk.estenfeld at blackpoint.de
Wed Jun 10 07:11:07 -05 2020


Hello Michael,

thank you very much for your work and information. This looks good.
Please be aware that you might also have some changes in AV-Spam for collecting mails in caughtspam mail folder. 

Best regards,
Dirk

 
blackpoint GmbH – Friedberger Straße 106b – 61118 Bad Vilbel 

-----Ursprüngliche Nachricht-----
Von: Blueonyx <blueonyx-bounces at mail.blueonyx.it> Im Auftrag von Michael Stauber
Gesendet: Mittwoch, 10. Juni 2020 06:44
An: blueonyx at mail.blueonyx.it
Betreff: [BlueOnyx:23960] Re: 5210R: Postfix SNI support + MailDir

Hi Larry,

> On mine the 10-mail.conf change was:
> mail_location = maildir:~/Maildir:LAYOUT=fs:DIRNAME=MailDiR
> 
> and the procmailrc change was:
> ##ORGMAIL=$HOME/mbox
> ##DEFAULT=$ORGMAIL
> PATH=/usr/local/bin:/usr/bin:/bin
> 
> MAILDIR=$HOME/Maildir
> DEFAULT=$MAILDIR/INBOX/MailDiR/new
> LOGFILE=$MAILDIR/log
> 
> 
> Which is really not 100% correct because it ends up putting all the 
> mail one level deeper (Maildir/INBOX/MailDiR/) than it should be but 
> by the time I got it working I was too frustrated to go back and 
> change it.

Ah, I see. Here is what worked for me:

[root at jarvis ~]# cat /etc/procmailrc
ORGMAIL=$HOME/Maildir/
DEFAULT=$ORGMAIL
MAILDIR=$ORGMAIL

[root at jarvis ~]# cat /etc/dovecot/conf.d/10-mail.conf|grep ^mail mail_location = maildir:~/Maildir:LAYOUT=fs

So I now have that sorted for 5210R and the result is in the BlueOnyx "5210R-testing" YUM repository. Attached is a screenshot of the new "Network Services" / "Email" GUI page.

As you can see there:

The Email server is configurable: Sendmail (default) or Postfix.

You can set the "Mailbox Format": Mbox (default) or Maildir.

Additionally there is a checkbox "Convert Mailboxes". If ticked, it'll run a conversion of all mailboxes that currently have emails. It'll convert *to* the format that's chosen under "Mailbox Format" after you save.

So you can change the format, save and then can go back later and can convert. Or you can change the format *and* tick the checkbox to convert the mailboxes and save only once.

HOWEVER: The mouse-over helptext makes it clear that this is risky, that it can fail and that the recommended way is to do the conversion of mailboxes from the Shell in SSH as "root" via this little tool:

[root at jarvis 5210R-Postfix]# /usr/sausalito/sbin/mbox_maildir_convert.pl
┌──────────────────────────────────────────────────────────────┐
│ BlueOnyx Mbox/Maildir & Maildir/Mbox converter               │
└──────────────────────────────────────────────────────────────┘

usage:     /usr/sausalito/sbin/mbox_maildir_convert.pl [OPTIONS]

Example: /usr/sausalito/sbin/mbox_maildir_convert.pl --mbox
Example: /usr/sausalito/sbin/mbox_maildir_convert.pl --maildir

       --mbox     Converts all mailboxes to mbox format
       --maildir  Converts all mailboxes to maildir format
       -h|--help  This help text

That will do the trick quite nicely.

Additionally "base-blueonyx" has been updated with provisions that once the mailbox format has been set and /etc/sysconfig/bxmbox is present, then /etc/procmailrc will not be messed with anymore during YUM updates.

Code changes for the Mailbox feature:

https://devel.blueonyx.it/trac/changeset?reponame=&new=3877%40BlueOnyx%2F5210R-Postfix&old=3872%40BlueOnyx%2F5210R-Postfix

And here is the code for /usr/sausalito/sbin/mbox_maildir_convert.pl:

https://devel.blueonyx.it/trac/browser/BlueOnyx/5210R-Postfix/ui/base-system.mod/src/blueonyx-mailbox-converter/mbox_maildir_convert.pl?rev=3873

For mbox to maildir conversions it makes a call to /usr/sausalito/sbin/mb2md.pl (it's inlcuded).

For maildir to mbox conversions I hacked something together based on a few code-snippets that I found elsewhere.

It basically checks /Maildir for subdirectories containing 'cur' and 'new' subdirectories. If it finds emails in them, then it escapes single quotes and cobbles it all into a new mbox file.

When you DO a conversion and a target "mbox" or "Maildir" are already present? Then they will be renamed and that backup is then left alone.

--
With best regards

Michael Stauber
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5506 bytes
Desc: not available
URL: <http://mail.blueonyx.it/pipermail/blueonyx/attachments/20200610/40302899/attachment.p7s>


More information about the Blueonyx mailing list