View Single Post
  #14  
Old 22nd March 2010, 11:26
djmixx07 djmixx07 is offline
Junior Member
 
Join Date: Mar 2010
Posts: 29
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Ok, im trying to mess around since i can restore it if i do something awfully wrong. Our previous net admin left an old (maybe obsolete) manual..so I tried some of it. I tried to "apt-get purge postfix", then "apt-get autoremove postfix".

Then I reinstalled it with "apt-get install postfix":
Code:
General type of configuration? <-- Internet Site
Mail name? <-- server1.domainname.com
then did "dpkg-reconfigure postfix":
Code:
General type of configuration? <-- Internet Site
Where should mail for root go <-- [blank]
Mail name? <-- server1.domainname.com
Other destinations to accept mail for? (blank for none) <--
server1.domainname.com, localhost.domainname.com, localhost.localdomain, localhost
Force synchronous updates on mail queue? <-- No
Local networks? <-- 127.0.0.0/8, 124.x.x.0/29
Use procmail for local delivery? <-- Yes
Mailbox size limit <-- 0
Local address extension character? <-- +
Internet protocols to use? <-- all
then:
Code:
postconf -e 'smtpd_sasl_local_domain ='
postconf -e 'smtpd_sasl_auth_enable = yes'
postconf -e 'smtpd_sasl_security_options = noanonymous'
postconf -e 'broken_sasl_auth_clients = yes'
postconf -e 'smtpd_recipient_restrictions =
permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination'
postconf -e 'inet_interfaces = all'
echo 'pwcheck_method: saslauthd' >> /etc/postfix/sasl/smtpd.conf
echo 'mech_list: plain login' >> /etc/postfix/sasl/smtpd.conf
The manual said to create the certificates for TLS doing these:
Code:
mkdir /etc/postfix/ssl
cd /etc/postfix/ssl/
openssl genrsa -des3 -rand /etc/hosts -out smtpd.key 1024

chmod 600 smtpd.key
openssl req -new -key smtpd.key -out smtpd.csr

openssl x509 -req -days 3650 -in smtpd.csr -signkey smtpd.key -out
smtpd.crt

openssl rsa -in smtpd.key -out smtpd.key.unencrypted

mv -f smtpd.key.unencrypted smtpd.key
openssl req -new -x509 -extensions v3_ca -keyout cakey.pem -out
cacert.pem -days 3650
then:
Code:
postconf -e 'smtpd_tls_auth_only = no'
postconf -e 'smtp_use_tls = yes'
postconf -e 'smtpd_use_tls = yes'
postconf -e 'smtp_tls_note_starttls_offer = yes'
postconf -e 'smtpd_tls_key_file = /etc/postfix/ssl/smtpd.key'
postconf -e 'smtpd_tls_cert_file = /etc/postfix/ssl/smtpd.crt'
postconf -e 'smtpd_tls_CAfile = /etc/postfix/ssl/cacert.pem'
postconf -e 'smtpd_tls_loglevel = 1'
postconf -e 'smtpd_tls_received_header = yes'
postconf -e 'smtpd_tls_session_cache_timeout = 3600s'
postconf -e 'tls_random_source = dev:/dev/urandom'
postconf -e 'myhostname = domainname.com'

/etc/init.d/postfix restart

mkdir -p /var/spool/postfix/var/run/saslauthd

/etc/init.d/saslauthd start
Now a problem again arises. The manual said to do "telnet localhost 25", and "ehlo localhost" after it establishes a connection. But I get stuck with telnet having this:
Code:
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
I tried to check mail.log and mail.err to find this:

mail.log:
Code:
Mar 22 17:58:23 mail postfix/master[2681]: warning: master_wakeup_timer_event: service pickup(public/pickup): No such file or directory
Mar 22 17:58:57 mail postfix/smtpd[14832]: fatal: open lock file pid/inet.smtp: cannot create file exclusively: No such file or directory
Mar 22 17:58:58 mail postfix/master[2681]: warning: process /usr/libexec/postfix/smtpd pid 14832 exit status 1
Mar 22 17:58:58 mail postfix/master[2681]: warning: /usr/libexec/postfix/smtpd: bad command startup -- throttling
mail.err:
Code:
Mar 22 18:16:14 mail postfix/smtpd[15240]: fatal: open lock file pid/inet.smtp: cannot create file exclusively: No such file or directory
Here's the current main.cf:
Code:
# See /usr/share/postfix/main.cf.dist for a commented, more complete version


# Debian specific:  Specifying a file name will cause the first
# line of that file to be used as the name.  The Debian default
# is /etc/mailname.
#myorigin = /etc/mailname

smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
biff = no

# appending .domain is the MUA's job.
append_dot_mydomain = no

# Uncomment the next line to generate "delayed mail" warnings
#delay_warning_time = 4h

readme_directory = no

# TLS parameters
smtpd_tls_cert_file = /etc/postfix/ssl/smtpd.crt
smtpd_tls_key_file = /etc/postfix/ssl/smtpd.key
smtpd_use_tls = yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache

# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
# information on enabling SSL in the smtp client.

myhostname = server1.domainname.com
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = server1.domainname.com, localhost.domainname.com, localhost.localdomain, localhost
relayhost = 
mynetworks = 127.0.0.0/8, 124.x.x.0/29
mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
inet_protocols = all
smtpd_sasl_local_domain = 
smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
broken_sasl_auth_clients = yes
smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination
smtpd_tls_auth_only = no
smtp_use_tls = yes
smtp_tls_note_starttls_offer = yes
smtpd_tls_CAfile = /etc/postfix/ssl/cacert.pem
smtpd_tls_loglevel = 1
smtpd_tls_received_header = yes
smtpd_tls_session_cache_timeout = 3600s
tls_random_source = dev:/dev/urandom
Hope this all helps to fix my problem. Thanks Falko and SamTzu for your assistance, you've been great. If I have to reinstall postfix again or restore it again to the point before I did all these, please let me know.

Kindly,
DJ
Reply With Quote