Postfix installation problem

Hi, I have started using FreeBSD recently. I am trying to configure the Postfix mail server using Purplehat's tutorial. I have Googled below issue but I'm not getting any good solution yet. I have tried below link but apparently the issue is not related with mine. Any help would be highly appreciated.

http://forums.freebsd.org/showthread.php?t=6711

The error I am facing:

Code:
postfix: warning: valid_hostname: empty hostname
postfix: fatal: unable to use my own hostname
*** [do-install] Error code 1

Stop in /usr/ports/mail/postfix.
*** [/usr/ports/mail/postfix/work/.install_done.postfix._usr_local] Error code 1

Stop in /usr/ports/mail/postfix.
*** [run-depends] Error code 1

Stop in /usr/ports/security/maia.
 
No, I did not, I have given the hostname just now and then again run make all install clean. It's now counting. I'll get back if I face the same error again.
 
The previous issue has resolved. Thanks for noticing it. But now I'm facing another problem and I don't know from where to start. At Postfix admin setup, when I tried to start Postfix by the following command, I got an error. I do not want to open another thread, therefore, I am placing the issue here.
Code:
#/usr/local/etc/rc.d/postfix start
/usr/local/etc/rc.d/postfix: Command not found.
 
Just providing the error I got when tried to make install clean from the port of Postfix.
Code:
postfix: fatal: /usr/local/etc/postfix/main.cf, line 28: missing '=' after attribute name: "permit_mynetworks"
*** [do-install] Error code 1

Stop in /usr/ports/mail/postfix.
*** [/usr/ports/mail/postfix/work/.install_done.postfix._usr_local] Error code 1

Stop in /usr/ports/mail/postfix.

I have used @pupalhat's tutorial on installing Postfix.
 
Last edited by a moderator:
I apologizes for posting again and again with a lot of silly matter which I am solving just after posting a few minutes ago. But I am unable to resolve below problem for almost two hours. I think I need a member's help regarding it. I am trying to connect by telnet localhost 110. I got the following error. I don't know what to do. Please forget above issues and kindly help regarding this.
Code:
[CMD=root@mail:/root #]telnet localhost 110[/CMD]
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
+OK AON Mail Server Ready.
[CMD]user example@example.info[/CMD]
+OK
[CMD]pass tah321#[/CMD]
-ERR [IN-USE] Temporary authentication failure.
Connection closed by foreign host.

My dovecot.log is showing the following.
Code:
Jun 29 16:46:01 auth-worker(default): Error: mysql: Connect failed to localhost (postfix): Access denied for user 'postfix'@'localhost' (using password: YES) - waiting for 1 seconds before retry
Jun 29 16:55:20 auth-worker(default): Error: mysql: Connect failed to localhost (postfix): Access denied for user 'postfix'@'localhost' (using password: YES) - waiting for 5 seconds before retry
Jun 29 16:55:20 auth-worker(default): Error: sql(example@example.info,127.0.0.1): Password query failed: Not connected to database

My mail log is showing the following:
Code:
Jun 29 16:32:55 mail dovecot: pop3-login: Aborted login (auth failed, 1 attempts): user=<example@example.info>, method=PLAIN, rip=127.0.0.1, lip=127.0.0.1, secured
 
Your database is not accepting the Postifx login credentials. Most likely you just copied and paste the configuration.

Don't do that on a mail server. Learn the basic principles first!
 
I think everyone has experienced the moment when you write something up to ask a question and either during the time of writing or, as you just mentioned, just after it do you suddenly find the solution. We've all been there.

However, it would be appreciated if you could share your solution on the thread too, that might help other future readers as well.

But for your last problem though I do suggest starting a new thread. Because now you're entering a subject which no longer has much to do with Postfix. Postfix is merely an SMTP server, the moment you need POP3 or IMAP functionality you'll have to resort to something else. And as I can see you picked up Dovecot, which is a good choice in combination with Postfix in my opinion, but it's still a completely different program.

People who know their way around Postfix don't necessarily have to know about Dovecot and vice versa.

My advice would be to start over and don't use a SQL backend and such, but stick to plain text authentication and the passwd database file. That will determine where the problem resides, if that works you can take the next step: activating the SQL backend and try again.

Also; why does Dovecot use the Postfix user account? That's also not a default setting, and one which you really don't need. Just making the two processes share the mail group should be enough.
 
ShelLuser said:
Also; why does Dovecot use the Postfix user account? That's also not a default setting, and one which you really don't need. Just making the two processes share the mail group should be enough.

It is the default setting in the guide that he tries to follow. It also makes sense if you understand how mail/postfixadmin works.
 
Thanks all for your kind participation. I have started the thread with the title "Postfix installation problem" and thought I'll put all my hardships during this configuration in single thread. But now I'm feeling it would not be a good idea. So I'll share the solutions of the problem I have faced in this thread and will open another thread as @ShelLuser advised.

My first problem when I tried to start Postfix with /usr/local/etc/rc.d/postfix I found Postfix is not there. So I have run the Postfix configuration again from /usr/ports/mail/postfix and end up with following error:

[quote][code]
Code:
postfix: warning: valid_hostname: empty hostname
postfix: fatal: unable to use my own hostname
*** [do-install] Error code 1
[/QUOTE][/code]

I have just edited the /etc/rc.conf file, put the host name in and rebooted the server. The issue resolved. Then again during Postfix installation, I have faced the following error:

[quote][code]
Code:
postfix: fatal: /usr/local/etc/postfix/main.cf, line 28: missing '=' after attribute name: "permit_mynetworks"
*** [do-install] Error code 1
[/QUOTE][/code]

So I reopen the /usr/local/etc/postfix/main.cf file and found there is whitespace after = on that line. I guessed that whitespace occurs due to purplehate's formatting at the web page. So I removed all whitespace, brought it all on the same line or just removed the whitespace and then the issue resolved. I made the correction thefollowing way.

[quote][code]
Code:
smtpd_recipient_restrictions =
  permit_mynetworks,
  permit_sasl_authenticated,
  reject_non_fqdn_hostname,
[/QUOTE][/code]

Instead of that, I modified the file the following way:
Code:
smtpd_recipient_restrictions =  permit_mynetworks,  permit_sasl_authenticated,  reject_non_fqdn_hostname,
[/quote][/quote][/quote][/CODE]


Then after Postfix was done, I was able to run Postfix and fall with the last problem which is still not resolved. I have taken @ShelLuser's advice and reinstalled the OS again!
 
Last edited by a moderator:
@gkontos , I tried to follow the tutorial as it is as much as possible, though I have changed where it required. I found I can log on to database with following command
Code:
mysql -h localhost -u postfix -p postfix

With the Postfix password, I was able to connect to the database, I have used the same Postfix password at /usr/local/etc/dovecot-sql.conf and dovecot-dict-sql.conf. If you think it would be good to share dovecot configuration files here, I'll do it.

I am just a beginner at unix systems and trying to learn by using it. Whenever I face any issue I Google or turn to the community. Would you be kind to explain more on the issue Dovecot failing to connect database please? Is there other way around of authenticating?

@Sheluser, your comment is very hard to me, Could you explain it treating my level as beginner?

My advice would be to start over and don't use a SQL backend and such, but stick to plain text authentication and the passwd database file. That will determine where the problem resides, if that works you can take the next step: activating the SQL backend and try again.
 
studyete said:
I am just a beginner at unix system and trying to learn by using it. Whenever I face any issue I google or turn to the community. Would you be kind to explain more on the issue dovecot failing to connect database please? Is there other way around of authenticating?

@Sheluser, your comment is very hard to me, Could you explain it treating my level as beginner?
Well, to start I didn't really hint at reinstalling the whole OS but merely Postfix and Dovecot. In general; if you ever make a complete mess of your system where several ports start to misbehave and there seems to be no other option but to start completely over then you'd only need to reinstall the ports.

Keep in mind that FreeBSD basically consists of 2 parts. First there is the base system, or main operating system. This is the part which consists of the kernel and basis functions and programs (/usr/bin, /bin, /usr/sbin, /etc, and so on). Everything you install "on top", normally by using the ports collection, ends up in /usr/local and no where else. These are also the only programs which end up in the package management system.

But as said; what I was referring to was re-installing these ports (for example by using # make deinstall in the mail/dovecot port directory), (re)moving any left over configuration files and then start over using # make install clean.

However, when I first commented I overlooked that you were following a tutorial of some sort. And being completely unfamiliar with that tutorial myself I obviously can't determine at which point things started to fail. It's also what triggered my surprise to see Dovecot use the Postfix credentials.

So I'm afraid I can't be of much help on that end.
 
The is only one line that needs to be configured in dovecot-db.conf

Code:
connect = host=localhost dbname=postfix user=postfix password=*******

If you can't connect with the correct values then probably you did not build dovecot with mysql support.
 
I believe the issue was related to my password syntax. I used # in my password and when I change it at dovecot-db.conf I end up with the following error. Is there any other simpler way other than MySQL. @gkontos would you be kind to see the following error please?

Code:
Jun 30 15:43:58 mail dovecot: Dovecot v1.2.17 starting up
Jun 30 15:43:58 mail dovecot: auth-worker(default): mysql: Connected to localhost (postfix)
Jun 30 15:44:32 mail dovecot: dovecot: User postmaster@examples.info not allowed to log in using too low primary UNIX group ID 125(postfix) (see first_valid_gid in config file)
Jun 30 15:44:32 mail dovecot: pop3-login: Internal login failure (auth failed, 1 attempts): user=<postmaster@examples.info>, method=PLAIN, rip=127.0.0.1, lip=127.0.0.1, secured
 
Last edited by a moderator:
All set and resolved. thanks @gkontos and @ShelLuser for your contribution. But one last problem I'm facing sending mail and there is no log about the error. I am just getting following error in Outlook or from the command line when I try to send mail.

Code:
451 4.3.0 <***@gmail.com>: Temporary lookup failure
tahnan@gmail.com... Deferred: 451 4.3.0 <***@gmail.com>: Temporary lookup failure
554 5.5.1 Error: no valid recipients
 
Last edited by a moderator:
studyete said:
I am just getting following error in Outlook or from the command line when I try to send mail.
That almost looks as if that server can't resolve. What happens if you try to run dig google.com mx?

Anything specific in /etc/resolv.conf?
 
I have only my DNS IP address at /etc/resolv.conf. Nothing else. However, I'm getting lots of warnings when starting Postfix and don't know i I should be worried about that. I am not asking to look over it but if you have the time, please check. Though my Postfix is getting started.

Code:
root@mail:/usr/ports/mail/postfix # /usr/local/etc/rc.d/postfix start
/usr/local/sbin/postconf: warning: unreasonable macro call nesting: "tuaha-alwatiq.com"
/usr/local/sbin/postconf: warning: unreasonable macro call nesting: "virtual_alias_maps"
/usr/local/sbin/postconf: warning: unreasonable macro call nesting: " "
/usr/local/sbin/postconf: warning: unreasonable macro call nesting: "virtual_alias_domains"
/usr/local/sbin/postconf: warning: unreasonable macro call nesting: " "
/usr/local/sbin/postconf: warning: unreasonable macro call nesting: "virtual_mailbox_maps"
/usr/local/sbin/postconf: warning: unreasonable macro call nesting: " "
/usr/local/sbin/postconf: warning: unreasonable macro call nesting: "virtual_mailbox_domains"
/usr/local/sbin/postconf: warning: unreasonable macro call nesting: " "
/usr/local/sbin/postconf: warning: unreasonable macro call nesting: "relay_recipient_maps"
/usr/local/sbin/postconf: warning: unreasonable macro call nesting: " "
/usr/local/sbin/postconf: warning: unreasonable macro call nesting: "relay_domains"
/usr/local/sbin/postconf: warning: unreasonable macro call nesting: " "
/usr/local/sbin/postconf: warning: unreasonable macro call nesting: "canonical_maps"
/usr/local/sbin/postconf: warning: unreasonable macro call nesting: " "
/usr/local/sbin/postconf: warning: unreasonable macro call nesting: "sender_canonical_maps"
/usr/local/sbin/postconf: warning: unreasonable macro call nesting: " "
/usr/local/sbin/postconf: warning: unreasonable macro call nesting: "recipient_canonical_maps"
/usr/local/sbin/postconf: warning: unreasonable macro call nesting: " "
/usr/local/sbin/postconf: warning: unreasonable macro call nesting: "relocated_maps"
/usr/local/sbin/postconf: warning: unreasonable macro call nesting: " "
/usr/local/sbin/postconf: warning: unreasonable macro call nesting: "transport_maps"
/usr/local/sbin/postconf: warning: unreasonable macro call nesting: " "
/usr/local/sbin/postconf: warning: unreasonable macro call nesting: "mynetworks"
/usr/local/sbin/postconf: warning: unreasonable macro call nesting: " "
/usr/local/sbin/postconf: warning: unreasonable macro call nesting: "virtual_mailbox_limit_maps"
/usr/local/sbin/postconf: warning: /usr/local/etc/postfix/main.cf: unused parameter: virtual_create_maildirsize=yes
/usr/local/sbin/postconf: warning: /usr/local/etc/postfix/main.cf: unused parameter: virtual_mailbox_extended=yes
 
dig google.com mx is resolving Google's MX records but the error I'm getting remains the same. Any suggestion please?
 
My maillog provides the following error from where I am getting a hint that my Postfix is somewhat unable to connect with the database.

Please any one have any suggestion.
Code:
Jul  7 22:47:14 mail postfix/postfix-script[84933]: starting the Postfix mail system
Jul  7 22:47:14 mail postfix/master[84935]: daemon started -- version 2.10.0, configuration /usr/local/etc/postfix
Jul  7 22:48:19 mail sendmail[84941]: r67GmJ0s084941: from=tahnan, size=36, class=0, nrcpts=1, msgid=<201307071648.r67GmJ0s084941@dispatch.kahuna.glbdns.microsoft.com>, relay=root@localhost
Jul  7 22:48:20 mail postfix/smtpd[84942]: error: open database /etc/aliases.db: No such file or directory
Jul  7 22:48:20 mail postfix/smtpd[84942]: connect from localhost[127.0.0.1]
Jul  7 22:48:20 mail sendmail[84941]: STARTTLS=client, relay=[127.0.0.1], version=TLSv1/SSLv3, verify=FAIL, cipher=DHE-RSA-AES256-SHA, bits=256/256
Jul  7 22:48:20 mail postfix/proxymap[84938]: warning: mysql query failed: Table 'postfix.alias' doesn't exist
Jul  7 22:48:20 mail postfix/trivial-rewrite[84944]: warning: proxy:mysql:/usr/local/etc/postfix/mysql_virtual_alias_maps.cf: table lookup problem
Jul  7 22:48:20 mail postfix/trivial-rewrite[84944]: warning: virtual_alias_domains lookup failure
Jul  7 22:48:20 mail postfix/trivial-rewrite[84944]: warning: proxy:mysql:/usr/local/etc/postfix/mysql_virtual_alias_maps.cf: table lookup problem
Jul  7 22:48:20 mail postfix/trivial-rewrite[84944]: warning: virtual_alias_domains lookup failure
Jul  7 22:48:20 mail postfix/smtpd[84942]: NOQUEUE: reject: RCPT from localhost[127.0.0.1]: 451 4.3.0 <tahnan@gmail.com>: Temporary lookup failure; from=<tahnan@dispatch.kahuna.glbdns.microsoft.com> to=<tahnan@gmail.com> proto=ESMTP helo=<dispatch.kahuna.glbdns.microsoft.com>
Jul  7 22:48:20 mail sendmail[84941]: r67GmJ0s084941: to=tahnan@gmail.com, ctladdr=tahnan (1001/1001), delay=00:00:01, xdelay=00:00:01, mailer=relay, pri=30036, relay=[127.0.0.1] [127.0.0.1], dsn=4.3.0, stat=Deferred: 451 4.3.0 <tahnan@gmail.com>: Temporary lookup failure
Jul  7 22:48:20 mail postfix/smtpd[84942]: disconnect from localhost[127.0.0.1]
Jul  7 23:07:19 mail postfix/postfix-script[84994]: stopping the Postfix mail system
Jul  7 23:07:19 mail postfix/master[84935]: terminating on signal 15
Jul  7 23:07:29 mail postfix/postfix-script[85070]: starting the Postfix mail system
Jul  7 23:07:29 mail postfix/master[85072]: daemon started -- version 2.10.0, configuration /usr/local/etc/postfix
 
So, what are you going to do with that hint? Are you going to check that the file in the hint exists? Is it bigger than zero bytes? And, what's the next step?
 
Back
Top