Where to configure SMTP host

zerozeroseven

New Member
Aug 11, 2011
3
1
1
Hello,

I'm quite a newbie in Proxmox VE and I have the responsability of a cluser composed of two proxmox with about 9 virtual machines.
I have to say that this system is very reliant and stable. We are very happy with proxmox.

My question is about the confguration of the smtp/postfix. I know this is not directly related to proxmox but if I can have some help from this forum, I will be very happy.

All 9 machines are backup-ed every night with a vmzdump task that will fire a mail at the end.
Unfortunatelly, the smtp connection is refused.

postfix/smtp[17925]: connect to hostA[x.x.x.x]:25: Connection refused

I know that the hostA is a exchange server and we cannot send email to it. We have a smtp/pop server (hostB) that authorise anonynous connection and I would like change the config of postfix in order for it to use hostB instead ofhostA.

The /etc/postfix/main.cf is the original one and it doesn't contain any reference to hostA. So main.cf is not the good place to change that.

I did try a
find . | xargs grep 'hostA' -sl in order to find a conf file, but the find command doesn't give me any clues.

So my question is the following.

Where can I change the connection host for smtp ? I'm lost. Any help will be appreciate.

Thanks in advance for any answer.
 
Hello,

just type dpkg-reconfigure postfix on a root terminal and set your exchange server as smarthost. After that allow the ip´s from you proxmox-hosts in the exchange-relay settings.

happy hacking ;)

macday
 
Pardon my English, I have also had the same problem by notifying the backup, I finally have the SMTP RELAY condigurar as follows.

GMAIL EXAMPLE:

apt-get update
apt-get install postfix sasl2-bin libsasl2-2 libsasl2-modules
nano /etc/default/saslauthd


START=yes




nano /etc/postfix/main.cf


add or edit these lines.


smtp_use_tls=yes
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtp_sasl_tls_security_options = noanonymous
tls_random_source = dev:/dev/urandom
smtp_sasl_auth_enable = yes
relayhost=[smtp.gmail.com]:587
smtp_sasl_password_maps=hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options = noanonymous








echo '' > /etc/postfix/sasl_passwd
chown root.root /etc/postfix/sasl_passwd
chmod 600 /etc/postfix/sasl_passwd
nano /etc/postfix/sasl_passwd




[smtp.gmail.com]:587 user@gmail.com:password






postmap /etc/postfix/sasl_passwd
postfix check
/etc/init.d/postfix restart




TEST
echo "Subject: Test"| sendmail -f name@yourdomain.com -v destinationmail@domain


VIEW LOG
tail -f /var/log/mail.log
 
Thanks both of you for your answer.

I just want to change the smtp server. In my company, we have an anonymous smtp/pop server (hostB) that is used by applications that need to send an email.
Currently proxmox is trying to connect to hostA.
I just want to change the proxmox's postfix configuration in order for emails generated by the proxmox box to go to hostB. (hostB is not an exchange server but a plain stmp/pop server).

Do I really need to run "dpkg-reconfigure postfix" as stated by macday ?

By the way I don't understand how and why proxmox try to connect to hostA as it is never referenced in any configuration file. It's like magic for me.

Thanks for your answer.
 
Thanks both of you for your answer.

I just want to change the smtp server. In my company, we have an anonymous smtp/pop server (hostB) that is used by applications that need to send an email.
Currently proxmox is trying to connect to hostA.
I just want to change the proxmox's postfix configuration in order for emails generated by the proxmox box to go to hostB. (hostB is not an exchange server but a plain stmp/pop server).

Do I really need to run "dpkg-reconfigure postfix" as stated by macday ?

By the way I don't understand how and why proxmox try to connect to hostA as it is never referenced in any configuration file. It's like magic for me.

Thanks for your answer.
Hi,
i guess your hostA is the MX-host with the highest prio defined in your DNS!
What's wrong about macdays tip? Of course you can do this also with vi (/etc/postfix/main.cf: relayhost = hostB) after "postfix reload" it should work.

Udo