Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


stop outgoing remote emails, and allowed incoming mail (exim)
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

stop outgoing remote emails, and allowed incoming mail (exim)

Hello,

I would like to stop sending outgoing emails for all account in the server, and only allowed incoming emails.

I try to find a idea in the google, but almost all the ideas affect incoming mail too. Any ideas you have?.

Exim.conf is default veatacp file:
https://c.vestacp.com/0.9.8/rhel/exim.conf

Thanks in advance.

Comments

  • DewlanceVPSDewlanceVPS Member, Patron Provider
    edited February 2018

    @alshahad Just block all outgoing mail ports and use hourly limit like 1 email per hour and remove all domains from /etc/local... file which used in cPanel to send email. Use filter code which create issue to send email. (Wrong code in filter file can cause to fail send email)




    Disable mail features in package and use "disabled" features file. I use it on one of my free server which is used for free hosting https://free.zeromb.com:2083 - cPanel Server. (I think your situation is similar like mine ;)

  • @DewlanceVPS If he's using vestacp's config, most probably using vestacp not cpanel

    Thanked by 1Aidan
  • DewlanceVPSDewlanceVPS Member, Patron Provider
    edited February 2018

    @jetchirag said:
    @DewlanceVPS If he's using vestacp's config, most probably using vestacp not cpanel

    I was think "vestacp" is a file name ;)



    Look like vestacp use Exim so I think config is similar and hourly email limit comes with exim and most of can be modified like removing domains from /etc/localdomains and make it read only.



    Create filter with wrong code which can cause to fail email sending.


    Disable outgoing email by tld based (Disable most of TLDs especially most popular TLDs and free TLD.)

  • Thanks a lot. Just I got a wild idea!

    To share it with others:

    I block all outgoing connections in port 25 via iptables and only allowed incoming connections.

    And the outgoing emails will work only in local.

  • DewlanceVPSDewlanceVPS Member, Patron Provider

    @alshahad I think you also need to block connection to other mail port like IMAP, POP3 Port, etc.



    Look at this tutorial for exim, Use non existing IP for exim for outgoing mail. Means setup a IP which is not existing on your server for outgoing mail https://help.directadmin.com/item.php?id=153


  • alshahadalshahad Member
    edited February 2018

    @DewlanceVPS Yes, very well nice idea, to help people out:

    you can do so by editing your /etc/exim.conf.

    Change:

    remote_smtp:
    driver = smtp

    to:

    remote_smtp:
    driver = smtp
    interface = 9.9.9.9

    Where 9.9.9.9 should not exist in the server.

    Thanked by 1DewlanceVPS
  • happybeehappybee Member, Host Rep
    edited February 2018

    I think the following URL will help you with this. Actually, the post describes how to block the outgoing emails in cPanel server. But you can try the method one specified in there.

    https://grepitout.com/block-outgoing-emails-account-cpanel/

  • edited February 2018

    You can always block outbound SMTP port (25) at the firewall level and leave your vesta CP config stock. Leaving your CP configs stock might help during future system upgrades.

    /sbin/iptables -A OUTPUT -p tcp --dport 25 -j DROP

    Edit: Oops just saw your note later in the thread that you did just this. Sorry for dup. Derp, brain not working on a Monday.

  • DewlanceVPSDewlanceVPS Member, Patron Provider

    Good news for cPanel users, In new version 70



    In cPanel & WHM version 70, you can now allow, suspend, or queue outgoing mail for an email account in cPanel's Email Accounts interface (cPanel >> Home >> Email >> Email Accounts). This grants administrators the capacity to limit a user's ability to send outgoing mail, but still allow users to read or receive mail.

    Thanked by 1MikeA
  • yokowasisyokowasis Member
    edited February 2018

    @DewlanceVPS said:
    @alshahad Just block all outgoing mail ports .....

    @alshahad said:

    >

    Thanks a lot. Just I got a wild idea!

    >

    I block all outgoing connections in port ....

    Ok. Great. That's also what comes to my mind.

Sign In or Register to comment.