Sysadmin Pro - SMTP Email Setup

Hi
I need to setup sending voicemail to email. I want to use built in SMTP server. But I have a problem with SMTP configuration.

Jun  3 11:43:22 50 postfix[30359]: warning: valid_hostname: numeric hostname: *.*.*.81
Jun  3 11:43:22 50 postfix[30359]: fatal: file /etc/postfix/main.cf: parameter myhostname: bad parameter value: *.*.*.81
Jun  3 11:43:23 50 postfix/sendmail[30368]: warning: valid_hostname: numeric hostname: *.*.*.81
Jun  3 11:43:23 50 postfix/sendmail[30368]: fatal: file /etc/postfix/main.cf: parameter myhostname: bad parameter value: *.*.*.81

My settings looks like

My Hostname : Empty
My Origin: *.*.*.81
My Domain: *.*.81

or

My Hostname : Empty
My Origin: *.*.*.80
My Domain: *.*.80

My external IP is ...80
If I’m leaving Hostname empty then SysAdmin in the main.cf putting myhostname = ..
.81
How can I fix that or do I need to install any additional modules ?

FreePBX 6.12.65-32
System Admin 13.0.57.2
Asterisk 11.21.2

The error message kind of says it all. If you want to use email, you need to supply a real hostname and domain name.

Yes. It is probably easier to use gmail or if you have another email such as company email server.

Many e-mail servers, especially corporate ones, do not allow numeric server names in the From address. That’s why Postfix doesn’t allow you to send with a numeric address in the from. You would have to try a couple email services to see which ones have “numeric server names” allowed.

NO email server allows IP addresses in the From address.

No email server SHOULD allow IP addresses in the From address, and certainly no modern ones are configured this way out of the box, but there might be a system out there somewhere that allows numeric FROM addresses - especially in “hobby shop” or local-use-only mail servers. It would have to be in a place where they turned of the MX check.

I agree that it’s wrong and the sysadmin should be beaten with a cat-6 cable, but it’s still possible to set one up. Since I don’t administer all of the systems out there, I was reticent to say “No”.

Having said that, I agree that it’s dangerous as HECK to allow numeric addresses in a From address.

I’m receiving the error with gmail account:
postfix/sendmail[29752]: warning: valid_hostname: numeric hostname: 50.111.111.81
postfix/sendmail[29752]: fatal: unable to use my own hostname

It is automatically taking IP of the host
I change main.cf manually by removing

myhostname = 50.111.111.81

in the end of that file

My “SMTP Email Setup” looks like
SMTP Server : Use External SMTP Server
My Hostname: Empty
My Origin:50-111-111-81.static.comcastbusiness.net
My Domain: comcastbusiness.net
Provider: Gmail
Username: [email protected]
Password:******

What is wrong with using a hostname? I don’t understand why you find it so hard to understand it when we keep telling you DON’T DO THAT. I’m serious - usually, I try really hard to be helpful, but I just can’t understand how you can possibly think that an address that ends in digits in a hostname field is going to work.

YOU MUST USE A HOSTNAME - NOT AN IP ADDRESS.

Let me say that another way:

STOP DOING WHAT WE KEEP TELLING YOU NOT TO DO.

Seriously - we are seven messages into this thread and you are posting that you are getting the same error message you got on message 1 - the 5 messages in between told you what the problem was and to not do it. Are you just not reading the messages we are typing?

In the previous post I said that I’m not using it. System automatically adding it and I have no idea why. Also I remove myhostname = 50.111.111.81 in the main.cf.

Please stop censoring information

Is that change something?
OK. I will change my previous posts.

If delete everything except
Provider: Gmail
Username: [email protected]
Password:******

After I pushing submit button it’s automatically adding
My Origin:50.111.111.81
My Domain:111.111.81
Still receiving:

postfix/sendmail[29752]: warning: valid_hostname: numeric hostname: 50.111.111.81
postfix/sendmail[29752]: fatal: unable to use my own hostname

Any ideas how can I fix that?

My Origin & My Domain adding automatically when I am pushing “Submit” button.


Jun 8 14:26:32 50 postfix[25259]: warning: valid_hostname: numeric hostname: 50.111.111.81
Jun 8 14:26:32 50 postfix[25259]: fatal: file /etc/postfix/main.cf: parameter myhostname: bad parameter value: 50.111.111.81
Jun 8 14:26:33 50 postfix/sendmail[25268]: warning: valid_hostname: numeric hostname: 50.111.111.81
Jun 8 14:26:33 50 postfix/sendmail[25268]: fatal: file /etc/postfix/main.cf: parameter myhostname: bad parameter value: 50.111.111.81

As I can see on this manual
http://wiki.freepbx.org/display/FPG/System+Admin+-+Email+Setup
if I’m choosing External SMTP Server then hostname and domain settings should be hidden. But on my server they are not.

Could somebody help me with that or that is a software glitch and I need to create a ticket?

You need to not set it to be an IP address.

That issue was resolved by changing the host name.
But now I have a new one
Dec 6 15:25:05 50 postfix/pickup[18107]: EF2A86C130B: uid=498 from=
Dec 6 15:25:05 50 postfix/cleanup[18481]: EF2A86C130B: message-id=20161206212505.EF2A86C130B@company
Dec 6 15:25:06 50 postfix/qmgr[18108]: EF2A86C130B: from=[email protected], size=485, nrcpt=1 (queue active)
Dec 6 15:25:49 50 postfix/smtp[18523]: fatal: open database /etc/postfix/sasl_passwd.db: No such file or directory
Dec 6 15:25:50 50 postfix/master[17614]: warning: process /usr/libexec/postfix/smtp pid 18523 exit status 1
Dec 6 15:25:50 50 postfix/master[17614]: warning: /usr/libexec/postfix/smtp: bad command startup – throttling
Dec 6 15:26:50 50 postfix/smtp[18589]: fatal: open database /etc/postfix/sasl_passwd.db: No such file or directory
Dec 6 15:26:51 50 postfix/master[17614]: warning: process /usr/libexec/postfix/smtp pid 18589 exit status 1
Dec 6 15:26:51 50 postfix/master[17614]: warning: /usr/libexec/postfix/smtp: bad command startup – throttling

I changed sasl_passwd to sasl_passwd.db and now I have a new issue
Dec 15 16:05:44 50 postfix/smtp[26381]: fatal: open database /etc/postfix/sasl_passwd.db: Invalid argument
Dec 15 16:05:45 50 postfix/master[17614]: warning: process /usr/libexec/postfix/smtp pid 26381 exit status 1
Dec 15 16:05:45 50 postfix/master[17614]: warning: /usr/libexec/postfix/smtp: bad command startup – throttling
Dec 15 16:06:02 50 postfix/pickup[24769]: 5BF126C1E01: uid=498 from=
Dec 15 16:06:02 50 postfix/cleanup[26446]: 5BF126C1E01: message-id=20161215220602.5BF126C1E01@Y
Dec 15 16:06:02 50 postfix/qmgr[20199]: 5BF126C1E01: from=[email protected], size=471, nrcpt=1 (queue active)

Hi!

The error is here:

This means that the database file that contains your password does not actually exist…

Normally if this file was not supposed to be updated/generated by FreePBX you would issue a

postmap hash:/etc/postfix/sasl_passwd

or something similar (it might not be a hash table) to generate tjhis file from the content of /etc/postfix/sasl_passwd.

But as far as I know this should all be done for you by FreePBX…

I guess you could renote your PBX and check if /etc/postfix/sasl_passwd exists, what its content is (is it the user and password you expect) and try to issue the postmap line I gave you above to see if it gives any error…

Good luck and have a nice day!

Nick

I was able to open “sasl_passwd.db” by

vi /etc/postfix/sasl_passwd.db

and that’s what inside

Generated by FreePBX Sysadmin.

Do not attempt to change this file

smtp.gmail.com:587 [email protected]:password

After “postfix reload”:

Dec 19 16:25:58 50 postfix/postfix-script[30139]: refreshing the Postfix mail system
Dec 19 16:25:59 50 postfix/master[17614]: reload – version 2.6.6, configuration /etc/postfix
Dec 19 16:26:56 50 postfix/smtp[30264]: fatal: open database /etc/postfix/sasl_passwd.db: Invalid argument
Dec 19 16:26:57 50 postfix/master[17614]: warning: process /usr/libexec/postfix/smtp pid 30264 exit status 1
Dec 19 16:26:57 50 postfix/master[17614]: warning: /usr/libexec/postfix/smtp: bad command startup – throttling
Dec 19 16:27:04 50 postfix/pickup[30143]: 24B626C1E45: uid=498 from=
Dec 19 16:27:04 50 postfix/cleanup[30309]: 24B626C1E45: message-id=20161219222704.24B626C1E45@Y
Dec 19 16:27:04 50 postfix/qmgr[30144]: 24B626C1E45: from=[email protected], size=471, nrcpt=1 (queue active)
Dec 19 16:27:04 50 postfix/qmgr[30144]: warning: connect to transport private/smtp: Resource temporarily unavailable
Dec 19 16:27:04 50 postfix/error[30311]: 24B626C1E45: to=[email protected], relay=none, delay=0.32, delays=0.25/0.01/0/0.06, dsn=4.3.0, status=deferred (mail transport unavailable)

Hi!

/etc/postfix/sasl_passwd is plain text…
/etc/postfix/sasl_passwd.db is binary data, you should not be able to type it like that…

You most likely have a line like this in main.cf

smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd

This actually tells Postfix to load the /etc/postfix/sasl_passwd.db (note the added .db) as an hash file…

Normally you generate the sasl_passwd.db file from the sasl_passwd file by typing this

postmap hash:/etc/postfix/sasl_passwd

but this should be done by FreePBX for you…

Even though I don’t have a gmail account I tried to fake having one and provide login info and it didn’t quite behave like I expected it to… It was doing absolutely nothing with the login info when said I had a gmail account, I had to choose “other” for it to behave a little more like I expected…

(I usually use my own mail server so I don’t have to use authentication…)

Can you please provide a screen capture of how you configure this (hide what you might think is sensitive)?

Can you also recheck those files? sasl_passwd should be in plain text, sasl_passwd.db should definitely contain binary data…

Good luck and have a nice day!

Nick

1 Like