Page 1 of 1
How to change smtp server
Posted: Tue Jun 28, 2016 6:29 pm
by Dr. Natas
Hey everyone,
I'm having some difficulty finding where the mailexchange1 configurations is at. I'm trying to update it to mailexhange.2.example.com, but I don't know there the settings are located. Does anyone know where I can adjust the settings for the new server.
Output of /var/log/maillog
Code: Select all
Jun 28 15:00:01 nagios_localhost postfix/smtp[29778]: 0354F604D5: to=<[email protected]>, relay=mailexchange1.example.com [x.x.x.x]:25, delay=0.74, delays=0.24/0.02/0/0.47, dsn=2.6.0, status=sent (250 2.6.0 <20160628220001.0354F604D5@nagios_localdomain> [InternalId=1365128] Queued mail for delivery)
Re: How to change smtp server
Posted: Tue Jun 28, 2016 6:53 pm
by Box293
Does this guide help:
https://www.linode.com/docs/email/postf ... tp-debian7
While it's for Debian, the config should be the same.
Re: How to change smtp server
Posted: Wed Jun 29, 2016 11:19 am
by Dr. Natas
Sorry for the late reply, but I'm running CentOS 6 x86_64. Here is sample output of my /etc/mail.rc I'm still trying to find my way around nagios, but still no luck.
Code: Select all
[root@nagios tmp]# cat main.cf | grep -v -e '#' -e '^$'
queue_directory = /var/spool/postfix
command_directory = /usr/sbin
daemon_directory = /usr/libexec/postfix
data_directory = /var/lib/postfix
mail_owner = postfix
inet_interfaces = localhost
inet_protocols = all
mydestination = $myhostname, localhost.$mydomain, localhost
unknown_local_recipient_reject_code = 550
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
debug_peer_level = 2
debugger_command =
PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
ddd $daemon_directory/$process_name $process_id & sleep 5
sendmail_path = /usr/sbin/sendmail.postfix
newaliases_path = /usr/bin/newaliases.postfix
mailq_path = /usr/bin/mailq.postfix
setgid_group = postdrop
html_directory = no
manpage_directory = /usr/share/man
sample_directory = /usr/share/doc/postfix-2.6.6/samples
readme_directory = /usr/share/doc/postfix-2.6.6/README_FILES
Sample output of /etc/postfix/main.rc
Code: Select all
[root@nagios postfix]# cat main.cf |grep -v -e '#' -e '^$'
ueue_directory = /var/spool/postfix
command_directory = /usr/sbin
daemon_directory = /usr/libexec/postfix
data_directory = /var/lib/postfix
mail_owner = postfix
inet_interfaces = localhost
inet_protocols = all
mydestination = $myhostname, localhost.$mydomain, localhost
unknown_local_recipient_reject_code = 550
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
debug_peer_level = 2
debugger_command =
PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
ddd $daemon_directory/$process_name $process_id & sleep 5
sendmail_path = /usr/sbin/sendmail.postfix
newaliases_path = /usr/bin/newaliases.postfix
mailq_path = /usr/bin/mailq.postfix
setgid_group = postdrop
html_directory = no
manpage_directory = /usr/share/man
sample_directory = /usr/share/doc/postfix-2.6.6/samples
readme_directory = /usr/share/doc/postfix-2.6.6/README_FILES
Re: How to change smtp server
Posted: Wed Jun 29, 2016 2:42 pm
by tgriep
If you want to change the relay host that postfix forwards it's email to, you would edit the main.cf file and un-comment one og the relayhost options and put your new server in it like the example below.
Code: Select all
relayhost = mailexhange.2.example.com
This would work for you is the new server doesn't require any sort of authentication.
Re: How to change smtp server
Posted: Wed Jun 29, 2016 6:51 pm
by Dr. Natas
Thank you,
I worked perfectly. I turned out my windows admin didn't update out mail exchange servers so I they were still using the old ones.
Re: How to change smtp server
Posted: Thu Jun 30, 2016 9:16 am
by mcapra
Is it alright if we lock this thread and mark the issue as resolved?
Re: How to change smtp server
Posted: Thu Jun 30, 2016 6:36 pm
by Dr. Natas
Issued resolved.