Issues related to setting up and using your mailserver and mail clients-Prevent a User from allowing more than 50MB of quota per E-Mail

Issues related to setting up and using your mailserver and mail clients-Prevent a User from allowing more than 50MB of quota per E-Mail

If there you would like to keep the E-Mail quotas in check, you can prevent any User from setting a quota value higher than MB by creating this script:

cd /usr/local/directadmin/scripts/custom
nano email_create_pre.sh

and then in that script, add this code:

#!/bin/sh
if [ “$quota” != “” ]; then
if [ “$quota” -gt “50” ]; then
echo “Cannot set quota greater than 50MB”;
exit 1;
fi
fi
exit 0;

Then chmod the script to 755, and also create a link for a modification hook:

chmod 755 email_create_pre.sh
ln -s email_create_pre.sh email_change_pass_pre.sh

Test it out by both trying to create and also change an E-Mail account to have more than 50 Mega of quota.

Adding a DMARC record to help lower your spam score

DMARC is a system that adds some rules for DKIM and SPF, so remote servers can have a better idea of what your intention is for messages that fails those 2 systems.
It does not really do anything, but adds clarity for actions took by remote servers, and should lower your spam score in some cases.
Be sure your SPF TXT value contains “-all” (not ~all), and you have DKIM setup before proceeding.

Please Note: When using the Evolution skin:

  1. Navigate to “DNS Management”
  2. Click “Add Record”
  3. For “Record Type”, select “TXT”
  4. TXT Record Type, seelct “DMARC”
  5. Enter your email into the “Aggregate Email (RUA)” field: spam-reports@domain.com
  6. Click “Add”

 


For other skins, like “Enhanced”, to add a DMARC record, go to your domain’s DNS Management, and add the following TXT record:

_dmarc    TXT    “v=DMARC1; p=none; sp=none; rua=mailto:spam-reports@domain.com

Be sure to include the whole thing in “quotes”.

The E-Mail Address  will sometimes be sent reported spam messages by larger providers.  Not all of services will email this address, but it is handy if a a client in large email provider clicks “this is spam” for a given message, and you will be sent that message, there you can determine if someone on your domain is spamming or spoofing, or if the client incorrectly clicked that message (at which point, you would probably want to remove that client from your mail-out, as they likely don’t want it).

The rua=mailto:email portion is not mandatory if you do not want to get these emails.

You can change the values as desired, as per the DMARC specifications:
http://dmarc.org

Google’s DMARC guide:
https://support.google.com/a/answer/2466563?hl=en


I wish to automate new DMARC records for all new domains

If you would like the above setup, and you want to automate it’s addition to all of new dns zones, you can run the following command:

cd /usr/local/directadmin/data/templates/custom
cp ../dns_txt.conf .

and then add the record where you want to the bottom of the custom/dns_txt.conf by running this command:

echo ‘_dmarc=”v=DMARC1; p=none; sp=none; rua=mailto:spam-reports@|DOMAIN|”‘ >> dns_txt.conf

keep in mind that this assumes you have got a spam-reports account created already.

Leave a Reply

Your email address will not be published. Required fields are marked *