Sysadmin Pro - SMTP Email Setup

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

I just changed my IP adress to 123.456.67.890 and password
The first two screenshots are showing my sysadmin tab and the third the postfix folder. Also I already changed back sasl_passwd.db to sasl_passwd like it was before


Hi!

You are supposed to have both sasl_passwd (a readable text file) and sasl_passwd.db (an unreadable unless you use the right tools binary file in the).

Somehow the .db file did not get created or your manipulations (it sounds like you renamed files?) prevented it from being created.

Can you try resubmitting the page and see if that recreates the .db file?

Failing that, you could try issuing a

postmap hash:/etc/postfix/sasl_passwd

from a terminal session (using SSH for example) and see if it fixes your problem…

You should not have to do that but let’s try to get things going and try to figure out what went wrong after…

Good luck and have a nice day!

Nick

1 Like

Thanks! That command helped me to generate sasl_passwd.db
But now I have new errors
Dec 21 10:10:21 50 postfix/pickup[8307]: 47F906C1E0B: uid=498 from=
Dec 21 10:10:21 50 postfix/cleanup[8536]: 47F906C1E0B: message-id=20161221161021.47F906C1E0B@Y
Dec 21 10:10:21 50 postfix/qmgr[8308]: 47F906C1E0B: from=[email protected], size=471, nrcpt=1 (queue active)
Dec 21 10:10:21 50 postfix/smtp[8538]: warning: SASL authentication failure: No worthy mechs found
Dec 21 10:10:21 50 postfix/smtp[8538]: 47F906C1E0B: SASL authentication failed; cannot authenticate to server smtp.gmail.com[2607:f8b0:4001:c02::6c]: no mechanism available
Dec 21 10:10:21 50 postfix/smtp[8538]: warning: SASL authentication failure: No worthy mechs found
Dec 21 10:10:21 50 postfix/smtp[8538]: 47F906C1E0B: SASL authentication failed; cannot authenticate to server smtp.gmail.com[74.125.70.109]: no mechanism available
Dec 21 10:10:22 50 postfix/smtp[8538]: warning: SASL authentication failure: No worthy mechs found
Dec 21 10:10:22 50 postfix/smtp[8538]: 47F906C1E0B: to=[email protected], relay=smtp.gmail.com[74.125.70.108]:587, delay=0.96, delays=0.13/0.06/0.76/0, dsn=4.7.0, status=deferred (SASL authentication failed; cannot authenticate to server smtp.gmail.com[74.125.70.108]: no mechanism available)

Packages cyrus-sasl, cyrus-sasl-lib and cyrus-sasl-plain are installed.
Here is the bottom of main.cfg

readme_directory = /usr/share/doc/postfix-2.6.6/README_FILES

relayhost:587=smtp.gmail.com

smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options = noplaintext, noanonymous
smtp_sasl_type = cyrus
smtp_use_tls = yes
smtp_tls_CAfile = /etc/pki/tls/certs/ca-bundle.crt
relayhost = smtp.gmail.com:587
myhostname = Y

I’m using Sysadmin Pro. Is there any way to reset all settings to default because looks like we have a lot of issues with e-mail notification?

Finally! After removing “noplaintext” from “smtp_sasl_security_options =” I received test e-mail!
Thank you Marble and everybody who was helping me !!!

Hi!

Don’t directly update that setting there, this will surely get overwritten the next time FreePBX regenerates those files…

Back when I did a lot of MTA (mail server) administration I never played with SASL so I had to read up on it a little…

It sounds like the authentification to gmail server has to be done in plain text (it is still in TLS though so the point is moot) which is why Postfix was complaining with “noplaintext”.

(From what I understood you asked it not to use plain text and it’s the only thing it would be able to negotiate with gmail’s servers…)

You actually told FreePBX to put it there by putting “Requires both” in “SASL security options”.

Choose “Allow Plain Text” instead…

When you submit that page it looks like the following 3 files should be updated (you should see their timestamps change):

main.cf
sasl_passwd
sasl_passwd.db

Are they being updated?

Good luck and have a nice day!

Nick