How to setup Proxmox without a FQDN?

stra4d

Well-Known Member
Mar 1, 2012
80
0
46
Hi

What if you don't have a FQDN for your server. We have a proxmox installation that is used internally only and we don't have a FQDN for it and don't need one. How can I setup proxmox correctly so that I can still send emails without them getting bounced/rejected?

Thanks,Scott
 
Use a smarthost to send mails (forward all mails to that server).

Thanks for the reply. This is unfamiliar territory for me - can I use my ISP's SMTP server? I assume this would all be manual setup regardless. Do I have to setup sendmail to do this - i.e. is proxmox using sendmail?
 
This is unfamiliar territory for me - can I use my ISP's SMTP server?

Yes, usually the ISP provides such service. But you need to ask you ISP for further information.

I assume this would all be manual setup regardless. Do I have to setup sendmail to do this - i.e. is proxmox using sendmail?

Proxmox uses 'postfix'
 
dietmar

Ok. So I think I am going in the right direction. I have setup postfix based on http://www.cyberciti.biz/faq/postfix-smtp-authentication-for-mail-servers/ with one modification, setting my ISPs port in relayhost.

However, since I am not running a FQDN, I am getting the following error:
Domain of sender address root@myhostname.mydomain.ca does not exist (in reply to RCPT TO command)

mydomain.ca exists, and is our domain. But the machine does not use an actual FQDN. Any ideas on how to correct this?
 
Ok, so for all those looking to do the same thing, here is the answer: smtp_generic_maps.

1. Create a file: /etc/postfix/generic_maps with the following:
root@doesntexist.mydomain.com me@myisp.com

2. Issue the following to hash the file:
# postmap /etc/postfix/generic_maps

3. Inside your main.cf:

smtp_generic_maps = hash:/etc/postfix/generic_maps

4. reload postfix

Hope this helps someone.
 
Last edited:
This is documented elsewhere, but I thought I would provide all the steps that I did so it was in one place.

How to Configure postfix to relay mail using your ISPs server

Create a text file as follows:
# P=/etc/postfix/password
# vi $P

The format of the client password file is as follows:



#smtp.isp.com username:password smtp.yourisp.com you@yourisp.com:yourSecretePassword Save and close the file. Set permissions:
# chown root:root $P
# chmod 0600 $P
# postmap hash:$P


Setup SMTP Mapping

Create a text file in postfix dir with [something like] the following in it:

# theuserthatdoesntexist userthatdoesexist
root@localhost you@yourisp.com



This file must be hashed by postmap:

# postmap /etc/postfix/generic_maps

Enable SMTP AUTH

Open main.cf file, enter:
# vi /etc/postfix/main.cf
Append following config directives:



relayhost = smtp.yourisp.com smtp_generic_maps = hash:/etc/postfix/generic_maps smtp_sasl_auth_enable = yes smtp_sasl_password_maps = hash:/etc/postfix/password smtp_sasl_security_options = Where,


  • relayhost = smtp.yourisp.com : Rely all mail via smtp.yourisp.com ISP mail server.
  • smtp_generic_maps : rename/map users that don't exist to user that does
  • smtp_sasl_auth_enable = yes : Cyrus-SASL support for authentication of mail servers.
  • smtp_sasl_password_maps = hash:/etc/postfix/password : Set path to sasl_passwd.
  • smtp_sasl_security_options = : Finally, allow Postfix to use anonymous and plaintext authentication by leaving it empty.
Note: if your relay mail server requires a different port (other than 25 which is the default) then you must use the following format for 'relayhost':


relayhost = [smtp.yourisp.com]:587 Save and close the file. Restart Postfix:
# /etc/init.d/postfix reload
Test your setup by sending a text email:
$ echo 'This is a test.' > /tmp/test
$ mail -s 'Test' you@example.com < /tmp/test
# tail -f /var/log/mail.log
# rm /tmp/test
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!