1

When I restart my server, postfix starts up - I can verify this by doing postfix status. It says "the Postfix mail system is up and running." When I try to send an email from a PHP script after that, however, it does not get sent, but just sits in the mail queue. I can verify this by typing mailq, which shows the message that should have been sent. If I restart postfix, not the server, by running postfix stop then postfix start, within 30 seconds to a minute the emails are delivered. Why do I have to restart postfix in order for it to work properly?

Here is my /etc/postfix/main.cf file with all comments stripped out.

queue_directory = /var/spool/postfix
command_directory = /usr/sbin
daemon_directory = /usr/libexec/postfix
data_directory = /var/lib/postfix
mail_owner = postfix
myhostname = myhostname.mydomain.com #I actually have my real domain on my server entered here
mydomain = mydomain.com.com #I have the real domain on my server
myorigin = $myhostname
inet_interfaces = $myhostname
inet_protocols = all
mydestination = $myhostname, localhost.$mydomain, localhost
unknown_local_recipient_reject_code = 550
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
debug_peer_level = 2
debugger_command =
     PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
     ddd $daemon_directory/$process_name $process_id & sleep 5
sendmail_path = /usr/sbin/sendmail.postfix
newaliases_path = /usr/bin/newaliases.postfix
mailq_path = /usr/bin/mailq.postfix
setgid_group = postdrop
html_directory = no
manpage_directory = /usr/share/man
sample_directory = /usr/share/doc/postfix/samples
readme_directory = /usr/share/doc/postfix/README_FILES

and for commmand postconf -n:

alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/libexec/postfix
data_directory = /var/lib/postfix
debug_peer_level = 2
debugger_command = PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin ddd $daemon_directory/$process_name $process_id & sleep 5
html_directory = no
inet_interfaces = $myhostname
inet_protocols = all
mail_owner = postfix
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
mydestination = $myhostname, localhost.$mydomain, localhost
mydomain = domain.com # real domain replaced for anonymity
myhostname = host.domain.com #real was taken out
myorigin = $myhostname
newaliases_path = /usr/bin/newaliases.postfix
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/postfix/README_FILES
sample_directory = /usr/share/doc/postfix/samples
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
unknown_local_recipient_reject_code = 550
  • What's the configuration of postfix? – Braiam Jul 31 '15 at 22:28
  • What do you mean by that? I don't know a whole lot about postfix, is there a specific setting I might need to look at. – user3413723 Jul 31 '15 at 22:44
  • 1
    Have you considered looking at your logs? – Satō Katsura Aug 1 '15 at 13:28
  • 1
    People here will be able to help only if you provide your postfix configuration postconf -n and log lines from postfix (redacting any sensitive information,of course ) – clement Aug 2 '15 at 6:45
  • 1
    @TCB13, I think you had the solution! I found another page that had this code: /sbin/chkconfig --level 345 postfix on which I think fixed the run level which may have caused it to start before the network. Anyways, that fixed it. – user3413723 Feb 15 '16 at 8:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.