The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

mailscanner mailwatch quarantine release

Discussion in 'cPanel Developers' started by Lyttek, Jan 6, 2006.

  1. Lyttek

    Lyttek Well-Known Member

    Joined:
    Jan 2, 2004
    Messages:
    770
    Likes Received:
    3
    Trophy Points:
    18
    Not having any luck searching on this, though I found a couple of related posts.

    If a message is quarantined, then released from within mailwatch, the quarantined message shows up as either que files in text form, or a text file containing all headers, etc. Any attachments are also included, both as an individual attachment (say, a .WMV file) as well as the encoded text in the original text file.

    Confused enough? :)

    Question: Is it possible, and how is it done, that the message and attachments are delivered as original bits, rather than being a set of attachments to the "message released from quarantine"? email, just as if they'd never been quarantined?

    I'd like to do this from GUI or similar script, as opposed to logging in and running command line stuff.
     
  2. Lyttek

    Lyttek Well-Known Member

    Joined:
    Jan 2, 2004
    Messages:
    770
    Likes Received:
    3
    Trophy Points:
    18
    Figured it out.

    Made some modifications to detail.php and functions.php that added a checkbox called 'deliver' to the mailwatch section where you can release a message. Selecting the correct boxes puts a copy of the queue files into /var/spool/exim/input where they are then delivered.

    If anyone wants the modified files named above, holler and I'll post the changes*.


    * changes are currently for the local quarantine only; I've not looked at changes for the RPC section.
     
  3. webignition

    webignition Well-Known Member

    Joined:
    Jan 22, 2005
    Messages:
    1,880
    Likes Received:
    0
    Trophy Points:
    36
    I certainly wouldn't mind knowing how this is done!
     
  4. Lyttek

    Lyttek Well-Known Member

    Joined:
    Jan 2, 2004
    Messages:
    770
    Likes Received:
    3
    Trophy Points:
    18
    Here goes:

    In /usr/local/cpanel/whostmgr/docroot/3rdparty/mailwatch/functions.php, add the following code:

    And in detail.php, make the following additions: (added code in bold, surrounded by existing code)

    That should do it. It should be noted that in operation, make sure you're quarantining messages as queue files, and DON'T deliver any attachments that are included with the message... just check the two queue files that end in -H and -D, as the latter file will have all the info for the attachments.

    Code probably needs to be written to check for correct quarantine configuration and to only allow the 'deliver' checkbox on the two queue files. May need to abstract the destination of the copy function as well.
     
  5. webignition

    webignition Well-Known Member

    Joined:
    Jan 22, 2005
    Messages:
    1,880
    Likes Received:
    0
    Trophy Points:
    36
    Thanks for the explanation - I'll give it a shot sometime (when I have the time!) and see how it goes.

    Thanks again.
     
  6. Lyttek

    Lyttek Well-Known Member

    Joined:
    Jan 2, 2004
    Messages:
    770
    Likes Received:
    3
    Trophy Points:
    18
    here's another question:

    Currently, when a message is quarantined, a notification message is returned to the sender... what needs to be done to send a notification to the recipient as well? Looks like that would be a handy configuration, but I can't seem to find anything about that except for spam messages, which aren't quarantined.
     
  7. goodmove

    goodmove Well-Known Member

    Joined:
    May 12, 2003
    Messages:
    624
    Likes Received:
    0
    Trophy Points:
    16
    You can set a notification for the recipient in /usr/mailscanner/etc/MailScanner.conf.

    Curious, why do you send a notification to the sender? I am only asking as doing so can get your mail server IP address into spam blacklists, as the sender address in spam is usually faked.
     

Share This Page