0

I want to disable local mail on my Centos VPS because the I have a web form (on a website which is hosted by the VPS) which is delivering mail to the local mailbox rather than looking at MX records to deliver it to the Exchange Server.

I have looked at some instructions in this question Postifx disable local delivery

How can this be achieved if I am using ZPanel? Does ZPanel handle things differently?

Can someone provide guidance on resolving this?

FYI, Postfix is being used (this was automatically setup by ZPanel).

Here is the output of 'postconf -n'

alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
broken_sasl_auth_clients = yes
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/libexec/postfix
debug_peer_level = 2
delay_warning_time = 4
disable_vrfy_command = yes
header_checks = regexp:/etc/postfix/header_checks
html_directory = no
inet_interfaces = all
mail_owner = postfix
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
mydestination = localhost.$mydomain, localhost
mydomain = gunston.gwsadmin.info
myhostname = gunston.gwsadmin.info
mynetworks = all
newaliases_path = /usr/bin/newaliases.postfix
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/postfix-2.2.2/README_FILES
recipient_delimiter = +
relay_domains = proxy:mysql:/etc/zpanel/configs/postfix/mysql-relay_domains_maps.cf
sample_directory = /usr/share/doc/postfix-2.2.2/samples
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
smtp_use_tls = no
smtpd_client_restrictions =
smtpd_data_restrictions = reject_unauth_pipelining
smtpd_helo_required = yes
smtpd_helo_restrictions =
smtpd_recipient_restrictions = permit_sasl_authenticated,        permit_mynetwor                                                                                                                               qdn_recipient,        reject_unknown_recipient_domain
smtpd_sasl_auth_enable = yes
smtpd_sasl_local_domain = $myhostname
smtpd_sasl_path = private/auth
smtpd_sasl_security_options = noanonymous
smtpd_sasl_type = dovecot
smtpd_sender_restrictions =
smtpd_use_tls = no
soft_bounce = yes
transport_maps = hash:/etc/postfix/transport
unknown_local_recipient_reject_code = 550
virtual_alias_maps = proxy:mysql:/etc/zpanel/configs/postfix/mysql-virtual_alias
virtual_gid_maps = static:12
virtual_mailbox_base = /var/zpanel/vmail
virtual_mailbox_domains = proxy:mysql:/etc/zpanel/configs/postfix/mysql-virtual_
virtual_mailbox_maps = proxy:mysql:/etc/zpanel/configs/postfix/mysql-virtual_mai
virtual_minimum_uid = 101
virtual_transport = dovecot
virtual_uid_maps = static:101
pgunston
  • 311
  • 4
  • 6
  • 16
  • Typically Linux servers deliver email locally when either the hostname matches the destination domain (call your server `example.com` and everything `@example.com` is considered local) or example.com is explicitly configured as local. Questions on how to work things within the limits of a control panel typically don't get much response here on ServerFault. – HBruijn Dec 10 '14 at 00:00
  • @HBruijn I do not need to make the modifications within the control panel. I can do it at the command line level however, I mentioned that ZPanel is installed because I have a feeling that the ZPanel installation will impact how Postfix handles mail. – pgunston Dec 10 '14 at 00:27
  • 2
    Why did you re-post this? Anyway, seriously. Get rid of Zpanel. It's only going to make your life more difficult going forward. – EEAA Dec 10 '14 at 02:14
  • [Administration panels are off topic](http://serverfault.com/help/on-topic). [Even the presence of an administration panel on a system,](http://meta.serverfault.com/q/6538/118258) because they [take over the systems in strange and non-standard ways, making it difficult or even impossible for actual system administrators to manage the servers normally](http://meta.serverfault.com/a/3924/118258), and tend to indicate low-quality questions from *users* with insufficient knowledge for this site. – HopelessN00b Mar 10 '15 at 09:50

1 Answers1

3

With postfix, it's trivial. Just remove example.com from mysql table. For more info about this table, see parameter

virtual_mailbox_domains = proxy:mysql:/etc/zpanel/configs/postfix/mysql-virtual_

Disclaimer:

  • This change may cause zpanel to explode stop working, because you dared to change the low level of zpanel system.
  • Because this change was unsupported by zpanel, the zpanel system may go berserk override your change. So you'd have to reapply it.
  • Repost comment from EEAA: Anyway, seriously. Get rid of Zpanel. It's only going to make your life more difficult going forward
masegaloeh
  • 18,236
  • 10
  • 57
  • 106
  • 1
    Sorry about the fixup, masegaloeh. Your answer was sufficiently funny it made tea come out of my nose, so I wanted it to be even more perfect. +1 from me! – MadHatter Dec 10 '14 at 07:51