LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 08-11-2007, 05:45 AM   #1
Gins
Senior Member
 
Registered: Jul 2004
Location: Germany
Distribution: open SUSE 11.0, Fedora 7 and Mandriva 2007
Posts: 1,638

Rep: Reputation: 46
How to initialize Postfix?


Niss@linux-3vxw:~> su root
Password:
linux-3vxw:/home/Niss # find / -name postfix
/var/adm/SuSEconfig/md5/etc/postfix
/var/adm/backup/postfix
/var/spool/postfix
/usr/share/doc/packages/postfix
/usr/sbin/postfix
/usr/lib/scpm/resource_types/service/get_deps/postfix
/usr/lib/postfix
/etc/permissions.d/postfix
/etc/sysconfig/postfix
/etc/init.d/postfix
/etc/postfix
linux-3vxw:/home/Niss #

The above indicates that the email program postfix is on my system.


linux-3vxw:/home/Niss # postfix
postfix/postfix-script: fatal: usage: postfix start (or stop, reload, abort, flush, check, set-permissions, upgrade-configuration)
linux-3vxw:/home/Niss #

How can I start the program? As you see I just wrote the word postfix and pressed enter. It didn't work.
 
Old 08-11-2007, 05:49 AM   #2
reddazz
Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 73
Try
Code:
#/etc/init.d/postfix start
Post back any output.
 
Old 08-11-2007, 06:20 AM   #3
Gins
Senior Member
 
Registered: Jul 2004
Location: Germany
Distribution: open SUSE 11.0, Fedora 7 and Mandriva 2007
Posts: 1,638

Original Poster
Rep: Reputation: 46
Oh great!
It worked reddazz.

linux-3vxw:/home/Niss # /etc/init.d/postfix start
Starting mail service (Postfix) done
linux-3vxw:/home/Niss #

Where do I find the program?
I am running open SUSE 10.2 nowadays.

Is this purely a command line program?

Last edited by Gins; 08-11-2007 at 06:45 AM.
 
Old 08-11-2007, 07:19 AM   #4
reddazz
Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 73
Yes postfix is purely command line. All MTA programs I know are all CLI based although you can use apps such as webmin to administer them.
 
Old 08-11-2007, 07:45 AM   #5
Gins
Senior Member
 
Registered: Jul 2004
Location: Germany
Distribution: open SUSE 11.0, Fedora 7 and Mandriva 2007
Posts: 1,638

Original Poster
Rep: Reputation: 46
I would like to try this reddazz.

Do you know how to send an email using Postfix?
 
Old 08-11-2007, 02:10 PM   #6
reddazz
Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 73
You obviously have to install Postfix first and then tinker with its configuration file which is usually /etc/postfix/main.cf. For more info on the configuration options, take a look here.
 
Old 08-11-2007, 03:23 PM   #7
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,644

Rep: Reputation: 523Reputation: 523Reputation: 523Reputation: 523Reputation: 523Reputation: 523
Quote:
Originally Posted by Gins
linux-3vxw:/home/Niss # postfix
postfix/postfix-script: fatal: usage: postfix start (or stop, reload, abort, flush, check, set-permissions, upgrade-configuration)
It told you how to start it. The "usage" line says "type postfix start" (or stop or reload, etc, most names are self-explanatory).

That said, /etc/init.d postfix verb is the "right" way. But for future reference when a program spits back a "usage:" line at you, it's telling you how to use it.
 
Old 08-11-2007, 03:37 PM   #8
Gins
Senior Member
 
Registered: Jul 2004
Location: Germany
Distribution: open SUSE 11.0, Fedora 7 and Mandriva 2007
Posts: 1,638

Original Poster
Rep: Reputation: 46
Thanks reddazz.
The following is an interesting site for the purpose of configuration.

http://www.postfix-book.com/debugging.html

It says there should be /etc/syslog.conf file.
I don't find such a file on my system.

In /etc folder, I found the following two folders.

syslog-ng

sysconfig

This is a tall order for me.
 
Old 08-11-2007, 03:48 PM   #9
Gins
Senior Member
 
Registered: Jul 2004
Location: Germany
Distribution: open SUSE 11.0, Fedora 7 and Mandriva 2007
Posts: 1,638

Original Poster
Rep: Reputation: 46
linux-3vxw:/home/Niss # postfix start
postfix/postfix-script: fatal: the Postfix mail system is already running
linux-3vxw:/home/Niss #

So the problem is in the file 'postfix-script'.
--------------------------------------------
I just looked at the 'postfix-script' file. Though I have some knowledge of scripting, I don't know how to manipulate values inside this file.

Last edited by Gins; 08-11-2007 at 03:53 PM.
 
Old 08-11-2007, 03:49 PM   #10
Gins
Senior Member
 
Registered: Jul 2004
Location: Germany
Distribution: open SUSE 11.0, Fedora 7 and Mandriva 2007
Posts: 1,638

Original Poster
Rep: Reputation: 46
linux-3vxw:/etc/postfix # cat 'postfix-script'
#!/bin/sh

#++
# NAME
# postfix-script 1
# SUMMARY
# execute Postfix administrative commands
# SYNOPSIS
# \fBpostfix-script\fR \fIcommand\fR
# DESCRIPTION
# The \fBpostfix-script\fR script executes Postfix administrative
# commands in an environment that is set up by the \fBpostfix\fR(1)
# command.
# SEE ALSO
# master(8) Postfix master program
# postfix(1) Postfix administrative interface
# LICENSE
# .ad
# .fi
# The Secure Mailer license must be distributed with this software.
# AUTHOR(S)
# Wietse Venema

# IBM T.J. Watson Research
# P.O. Box 704
# Yorktown Heights, NY 10598, USA
#--

# Avoid POSIX death due to SIGHUP when some parent process exits.

trap '' 1

case $daemon_directory in
"") echo This script must be run by the postfix command. 1>&2
echo Do not run directly. 1>&2
exit 1
esac

LOGGER="$command_directory/postlog -t $MAIL_LOGTAG/postfix-script"
INFO="$LOGGER -p info"
WARN="$LOGGER -p warn"
ERROR="$LOGGER -p error"
FATAL="$LOGGER -p fatal"
PANIC="$LOGGER -p panic"

umask 022
SHELL=/bin/sh

#
# Can't do much without these in place.
#
cd $command_directory || {
$FATAL no Postfix command directory $command_directory!
exit 1
}
cd $daemon_directory || {
$FATAL no Postfix daemon directory $daemon_directory!
exit 1
}
test -f master || {
$FATAL no Postfix master program $daemon_directory/master!
exit 1
}
cd $config_directory || {
$FATAL no Postfix configuration directory $config_directory!
exit 1
}
cd $queue_directory || {
$FATAL no Postfix queue directory $queue_directory!
exit 1
}

#
# Parse JCL
#
case $1 in

start_msg)

echo "Start postfix"
;;

stop_msg)

echo "Stop postfix"
;;

start)

$daemon_directory/master -t 2>/dev/null || {
$FATAL the Postfix mail system is already running
exit 1
}
if [ -f $queue_directory/quick-start ]
then
rm -f $queue_directory/quick-start
else
$config_directory/postfix-script check-fatal || {
$FATAL Postfix integrity check failed!
exit 1
}
# Foreground this so it can be stopped. All inodes are cached.
$config_directory/postfix-script check-warn
fi
$INFO starting the Postfix mail system
$daemon_directory/master &
;;

drain)

$daemon_directory/master -t 2>/dev/null && {
$FATAL the Postfix mail system is not running
exit 1
}
$INFO stopping the Postfix mail system
kill -9 `sed 1q pid/master.pid`
;;

quick-stop)

$config_directory/postfix-script stop
touch $queue_directory/quick-start
;;

stop)

$daemon_directory/master -t 2>/dev/null && {
$FATAL the Postfix mail system is not running
exit 1
}
$INFO stopping the Postfix mail system
kill `sed 1q pid/master.pid`
;;

abort)

$daemon_directory/master -t 2>/dev/null && {
$FATAL the Postfix mail system is not running
exit 1
}

$INFO aborting the Postfix mail system
kill `sed 1q pid/master.pid`
;;

reload)

$daemon_directory/master -t 2>/dev/null && {
$FATAL the Postfix mail system is not running
exit 1
}
$INFO refreshing the Postfix mail system
$command_directory/postsuper active || exit 1
kill -HUP `sed 1q pid/master.pid`
$command_directory/postsuper &
;;

flush)

cd $queue_directory || {
$FATAL no Postfix queue directory $queue_directory!
exit 1
}
$command_directory/postqueue -f
;;

check)

$config_directory/postfix-script check-fatal || exit 1
$config_directory/postfix-script check-warn
exit 0
;;

check-fatal)
# This command is NOT part of the public interface.

$SHELL $config_directory/post-install create-missing || {
$WARN unable to create missing queue directories
exit 1
}

# Look for incomplete installations.

test -f $config_directory/master.cf || {
$FATAL no $config_directory/master.cf file found
exit 1
}

# See if all queue files are in the right place. This is slow.
# We must scan all queues for mis-named queue files before the
# mail system can run.

$command_directory/postsuper || exit 1
exit 0
;;

check-warn)
# This command is NOT part of the public interface.

for dir in $daemon_directory $config_directory $queue_directory
do
ls -lLd $dir | (grep " root " >/dev/null ||
$WARN not owned by root: $dir)
done

find $daemon_directory/* $config_directory/* ! -user root \
-exec $WARN not owned by root: {} \;

find $daemon_directory/. $config_directory/. \
\( -perm -020 -o -perm -002 \) -type f \
-exec $WARN group or other writable: {} \;

find `ls -d $queue_directory/* | \
egrep '/(incoming|active|defer|deferred|bounce|hold|trace|corrupt|public|private|flush)$'` \
! \( -type p -o -type s \) ! -user $mail_owner \
-exec $WARN not owned by $mail_owner: {} \;

find $queue_directory/public $queue_directory/maildrop \
$command_directory/postqueue $command_directory/postdrop \
-prune ! -group $setgid_group \
-exec $WARN not owned by group $setgid_group: {} \;

find $command_directory/postqueue $command_directory/postdrop \
-prune ! -perm -02111 \
-exec $WARN not set-gid or not owner+group+world executable: {} \;

for name in `ls -d $queue_directory/* | \
egrep '/(bin|etc|lib|usr)$'` ; \
do \
find $name ! -user root \
-exec $WARN not owned by root: {} \; ; \
done

# WARNING: this should not descend into the maildrop directory.
# maildrop is the least trusted Postfix directory.

find $queue_directory/maildrop/. -prune ! -user $mail_owner \
-exec $WARN not owned by $mail_owner: $queue_directory/maildrop \;

for dir in bin etc lib sbin usr
do
test -d $dir && find $dir -type f -print | while read path
do
test -f /$path && {
cmp -s $path /$path ||
$WARN $queue_directory/$path and /$path differ
}
done
done

find corrupt -type f -exec $WARN damaged message: {} \;

# XXX also: look for weird stuff, weird permissions, etc.

test -f /usr/sbin/sendmail -a -f /usr/lib/sendmail && {
cmp -s /usr/sbin/sendmail /usr/lib/sendmail || {
$WARN /usr/lib/sendmail and /usr/sbin/sendmail differ
$WARN Replace one by a symbolic link to the other
}
}
exit 0
;;

set-permissions|upgrade-configuration)
$config_directory/post-install create-missing "$@"
;;

post-install)
# Currently not part of the public interface.
shift
$config_directory/post-install "$@"
;;

/*)
# Currently not part of the public interface.
"$@"
;;

*)

$FATAL "usage: postfix start (or stop, reload, abort, flush, check, set-permissions, upgrade-configuration)"
exit 1
;;

esac
linux-3vxw:/etc/postfix #
 
Old 08-11-2007, 04:20 PM   #11
reddazz
Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 73
Quote:
Originally Posted by Gins
linux-3vxw:/home/Niss # postfix start
postfix/postfix-script: fatal: the Postfix mail system is already running
linux-3vxw:/home/Niss #

So the problem is in the file 'postfix-script'.
--------------------------------------------
I just looked at the 'postfix-script' file. Though I have some knowledge of scripting, I don't know how to manipulate values inside this file.
There is nothing wrong with the script. If you look at the error message, its telling you that postfix is already running. I suspect its running because you ran "/etc/init.d/postfix start" as I had shown you earlier.
 
Old 08-11-2007, 04:30 PM   #12
Gins
Senior Member
 
Registered: Jul 2004
Location: Germany
Distribution: open SUSE 11.0, Fedora 7 and Mandriva 2007
Posts: 1,638

Original Poster
Rep: Reputation: 46
I just want to create a mailbox and send a message.
I looked in vain to find details on Google.
It seems you don't work with this program.

I just want to send a message and receive a message.
 
Old 08-11-2007, 04:33 PM   #13
Gins
Senior Member
 
Registered: Jul 2004
Location: Germany
Distribution: open SUSE 11.0, Fedora 7 and Mandriva 2007
Posts: 1,638

Original Poster
Rep: Reputation: 46
The following command worked.

linux-3vxw:/home/Niss # postfix reload

postfix/postfix-script: refreshing the Postfix mail system

linux-3vxw:/home/Niss #

-------------------------------------------


linux-3vxw:/home/Niss # postfix 'upgrade-configuration'

Editing /etc/postfix/master.cf, adding missing entry for tlsmgr service

linux-3vxw:/home/Niss #

Last edited by Gins; 08-11-2007 at 04:36 PM.
 
Old 08-11-2007, 04:43 PM   #14
Gins
Senior Member
 
Registered: Jul 2004
Location: Germany
Distribution: open SUSE 11.0, Fedora 7 and Mandriva 2007
Posts: 1,638

Original Poster
Rep: Reputation: 46
The command ' postconf -n' was positive.
--------------------------------------------------------

linux-3vxw:/home/Nissa # postconf -n
alias_maps = hash:/etc/aliases
biff = no
canonical_maps = hash:/etc/postfix/canonical
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/lib/postfix
debug_peer_level = 2
defer_transports =
disable_dns_lookups = no
disable_mime_output_conversion = no
html_directory = /usr/share/doc/packages/postfix/html
inet_interfaces = 127.0.0.1 ::1
inet_protocols = all
mail_owner = postfix
mail_spool_directory = /var/mail
mailbox_command =
mailbox_size_limit = 0
mailbox_transport =
mailq_path = /usr/bin/mailq
manpage_directory = /usr/share/man
masquerade_classes = envelope_sender, header_sender, header_recipient
masquerade_domains =
masquerade_exceptions = root
message_size_limit = 10240000
mydestination = $myhostname, localhost.$mydomain
myhostname = linux-3vxw.site
mynetworks_style = subnet
newaliases_path = /usr/bin/newaliases
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/packages/postfix/README_FILES
relayhost =
relocated_maps = hash:/etc/postfix/relocated
sample_directory = /usr/share/doc/packages/postfix/samples
sender_canonical_maps = hash:/etc/postfix/sender_canonical
sendmail_path = /usr/sbin/sendmail
setgid_group = maildrop
smtp_sasl_auth_enable = no
smtp_use_tls = no
smtpd_client_restrictions =
smtpd_helo_required = no
smtpd_helo_restrictions =
smtpd_recipient_restrictions = permit_mynetworks,reject_unauth_destination
smtpd_sasl_auth_enable = no
smtpd_sender_restrictions = hash:/etc/postfix/access
smtpd_use_tls = no
strict_8bitmime = no
strict_rfc821_envelopes = no
transport_maps = hash:/etc/postfix/transport
unknown_local_recipient_reject_code = 550
virtual_alias_domains = hash:/etc/postfix/virtual
virtual_alias_maps = hash:/etc/postfix/virtual
linux-3vxw:/home/Niss #
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Postfix error: /usr/lib/postfix/smtpd pid 7529 exit status 1 Chiragrs Linux - Networking 7 05-16-2008 12:42 AM
cannot initialize camera (does this go here?) AnimaSola Linux - Hardware 1 09-12-2006 04:34 AM
Postfix - how do hosted domains download their mail from my postfix franschoek Linux - Software 1 04-01-2006 09:41 PM
Postfix send mail problem(In RH9, kernal 2.4.20, postfix 2.1.5) minor Linux - General 4 07-11-2005 09:12 PM
Network Initialize delphig Linux - Networking 1 03-26-2004 12:26 AM


All times are GMT -5. The time now is 03:13 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration