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.

Stop Processing Mail Queue

Discussion in 'E-mail Discussions' started by postcd, Jun 25, 2016.

  1. postcd

    postcd Well-Known Member

    Joined:
    Oct 22, 2010
    Messages:
    624
    Likes Received:
    6
    Trophy Points:
    18
    Thank You,
    isnt there any other way to stop processing mailqueue? Because i would like to stop it by the script that is checking mail queue size automatically periodically.. so i will not be infront of computer at time i need to stop mailqueue processing..
     
  2. postcd

    postcd Well-Known Member

    Joined:
    Oct 22, 2010
    Messages:
    624
    Likes Received:
    6
    Trophy Points:
    18
    >You can block the SMTP port

    Wouldn't this cause queued emails be removed from queue because of some "internal" failure?

    When i do: netstat -penta|grep exim
    I see exim listen at 25,465,587

    I read that "SMTP generally uses port 25 for connections, port 587 is actually the preferred port for outbound SMTP traffic"

    iptables -L INPUT|egrep "smtp|25|465|587"
    ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:smtp

    Im also using csf firewall which has seemingly related command:

    csf -td, --tempdeny ip ttl [-p port] [-d direction] [comment]
    Add an IP to the temp IP ban list. ttl is how long to blocks for
    (default:seconds, can use one suffix of h/m/d). Optional port.
    Optional direction of block can be one of: in, out or inout
    (default:in)

    ( csf -td 127.0.0.1 86400 -p 587 -d out ??)

    Please which command do you suggest me to execute in my bash script to stop mail queue processing or simply prevent sending out e-mails in queue? Thx

    Example reject command
    iptables -A OUTPUT -p tcp --dport 25 -j REJECT
    iptables-save
    but unsure how to undo it and if its safe in ip table
     
    #2 postcd, Jun 26, 2016
    Last edited: Jun 26, 2016
  3. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
Loading...

Share This Page