• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

qmail: Reject unencrypted email

Aileron79

New Pleskian
Hi all!

I'd like to create an email account which only accepts encrypted email. This of course shall not affect other users and their mail boxes. I don't have a problem writing a simple script which checks a single message for whether or not it's encrypted. but I have no clue where to hook such a script in a Plesk environment. Plesk obviously uses qmail as an MTA, and as spam usually is filtered at that stage I considered doing a similar thing but I don't know how, especially on a per-user-basis.

If possible I'd like to send an automated response message to unencrypted messages which contains the download link for the public key.

Alternatively I can periodically run a cronjob to check for new mail and filter accordingly, but that's not a very nice solution. I'd like to avoid usage of crond for this.
 
Hello,

qmail has a very nifty system to do everything you want with an email on a per mailbox basis. It is the .qmail file located in

/var/qmail/mailnames/DOMAIN/MAILBOX/.qmail

qmail reads the .qmail file and executes the content line per line. You can place even commands in it to run external scripts if you want/need.

You will find more about it on Life With qmail site at
http://www.lifewithqmail.org/lwq.html#dot-qmail-files

Delivery of a user's mail is usually controlled by one or more ".qmail" (pronounced dot kyoo mail) files--files in the user's home directory with names beginning with .qmail. The dot-qmail man page describes .qmail file usage.

.qmail files contain a list of delivery instructions, one instruction per line. The first character of the line determines what kind of delivery is involved:
Character Delivery Type Value
# none (comment) ignored
| program command to be run by shell
/ or . mbox (if last char isn't a /) pathname of mbox (including the / or .)
/ or . maildir (if last char is a /) pathname of maildir (including the / or .)
& forward address to forward message
letter or number forward address to forward message (including the first char)

You will have to test for yourself when plesk overwrites the file. I can imagine it will get overwritten when you change something to that email via plesk, like adding a forward or so.

Hope this helps,
Jan
 
Back
Top