Development Questions

So I’ve been wanting to crack open Mail-in-a-Box and start modifying it, but it’s kinda a mess sometimes, so I have a few questions, and I will probably ask more as I go.

So, I understand that Mail-in-a-Box has an SQLlite database for users, but I’m kinda lost where all the data is stored. I intend to add email notifications subscriptions for all Mail-in-a-Box administrators (see Mail-in-a-Box Mailing List ), but I am trying to figure out the most appropriate place to store the configuration.

I have found these locations for data:
/home/user-data/mail/users.sqlite
/etc/mailinabox.conf
/home/user-data/settings.yaml
/home/user-data/mail/mailboxes/[$DOMAIN]/[$USER]/

So I’m not exactly sure where I should store the settings for the subscriptions.

I am thinking what I’ll try to do is have the mail-in-a-Box daemon Python script run on an infinite loop and check using an HTTPS request every 15-30 minutes (randomly) for email announcements, then send an email (send using SMTP to localhost) to all the administrators.

However, I want to have opt-in/opt-out features that the user can configure.

What is the point of the “privacy” setting in settings.yaml? I don’t see it referenced anywhere in the code.

The general rule is “anything that needs to be backed up is stored in $STORAGE_ROOT (which by default is /home/user-data)”. The only exception is that since $STORAGE_ROOT is a variable, its value (i.e. /home/user-data) is stored at a known location in /etc/mailinabox.conf. So, if you want the data to be backed up, it goes somewhere in $STORAGE_ROOT.

What is the point of the “privacy” setting in settings.yaml?

@JoshData, so now I am trying to code the part where it pulls from a Github repository. I will have a bash script download the Github repository for emails, but I need to pick a directory to do it in.

I was looking at my current MIAB box, and I saw that the daemon is run on the user that installed it. I feel like this is a poor design, since we are assuming the user isn’t going to delete the Git folder. I would feel more comfortable if we made a mailinabox user and a mailinabox home ( /home/mail-in-a-box/ ).

So what I’m going to do is modify my fork to create that user and directory, move and move all that Git stuff there.

EDIT: Then I’ll write the email Github repository to /home/mail-in-a-box somewhere.

It should be running as root.

This topic was automatically closed after 61 days. New replies are no longer allowed.