I need to block the POP3 DELE Message by IPtables - Linux

0

I installed the iRedMail (Postfix, Dovecot, ....) and create Mailboxes for Users. But I hanged in the Deletion Request.

I want to prevent vUsers (that have MAilboxes) from deleting the eMails (Business Request).

Some Searches said to make ACL on the Maildir, bit I think that this solution will make problems in the Service User during the Deletion.

So I think that the solution may come from another way, from the IPtables, I want to block the POP3 DELE Request before entering the Server. I tried but failed.

Any Help in that (in IPtables Configurations or another Solution)... Thanks.

Mohamed Badr

Posted 2015-09-03T12:45:44.090

Reputation: 9

Answers

1

The iptables strategy is not the appropiate one IMHO, because you take for granted that the DELE command will be always sent as a whole in the same TCP packet, when it doesn't need to and the packet might be split into several packets. So that would result in some messages blocked and some not.

I'd consider using the 'lazy expunge' plugin for Dovecot, which makes the "deleted" e-mails be moved actually to a different folder, but never deleted (or deleted only when the administrator configure the action). I think that is the cleanest way of achieving this.

You can find more info here.

nKn

Posted 2015-09-03T12:45:44.090

Reputation: 4 960

I believe that the IPtables can match on a string found in the Packet Payload, I blocked before the Torrent Traffic by IPtables String options, without assigning any blocked Port Number. – Mohamed Badr – 2015-09-03T12:58:33.070

But I am interested in doing the "Lazy expunge", so I will search and return to you back ISA... Thanks. – Mohamed Badr – 2015-09-03T13:00:56.290

Yes, what I mean is that the whole command won't be sent in the same packet necessarily. For example, the command might be sent as POP3 D at the end of a TCP packet and the rest of the packet be splitted into another with content ELE, which wouldn't match your rule. Anyways, the plugin approach is quite cleaner to me than the iptables way. – nKn – 2015-09-03T13:01:15.177

Thanks Sir, but if you found the POP3 DELE Payload Format, kindly add comment. – Mohamed Badr – 2015-09-03T13:07:09.747