Link to home
Start Free TrialLog in
Avatar of alpires
alpiresFlag for Brazil

asked on

how to install and configure POSTFIX - Ubuntu

Hi, I am trying to install and make postfix work, but I couldnt do this so far..
I have followed thousands of tutorials.. but its not working..

it even connects, but i'm having trouble to send mail.. "Relay access denied"...

Anyway, I'd like to know

1- How to uninstall all these packs I have installed
2- step by step, install and configure everything from the start.. i want start it from zero

I need to configure domain: nextmail.co.cc
username: judson
password: apcs1234

authenticated only.. can someone give me a tutorial step by step of installation and configuration like this ?

Thank You
Avatar of pawwa
pawwa
Flag of Serbia image

1- How to uninstall all these packs I have installed

# sudo aptitude remove postfix* --purge

2- step by step, install and configure everything from the start.. i want start it from zero

You have to edit /etc/postfix/main.cf and concentrate on the following parameters (I'm giving you the examples):

myhostname = mail.nextmail.co.cc
mydomain = nextmail.co.cc
myorigin = $mydomain
inet_interfaces = all
mynetworks = 127.0.0.0/8 192.168.1.0/24

The mynetworks lists the network clients that could relay mail. In this example the only ones who could relay mail through the server is localhost and the clients in the network 192.168.1.0/24.

Save the file, and start postfix:

# /etc/init.d/postfix start

You should relay the mail now. Did I got you right, is this what you wanted, or you wanted to configure SMTP-AUTH?
Avatar of alpires

ASKER

Try fix my conf then, and Yes, it shouldnt be open relay.. should be auth only:

# 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 (Ubuntu)
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.

mydomain = nextmail.co.cc
myhostname = mail.nextmail.co.cc
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
mydestination = $myhostname, localhost.$mydomain, $mydomain, mail.$mydomain, www.$mydomain, judmail.com
relayhost = $myhostname
relay_domains = $myhostname
mynetworks = 127.0.0.1,localhost
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
home_mailbox = Maildir/
mailbox_command =
inet_protocols = all
smtpd_sasl_auth_enable = yes
smtpd_sasl_type = cyrus
smtpd_sasl_path = smtpd
smtpd_sasl_authenticated_header = no
smtpd_sasl_security_options = noanonymous
smtpd_sasl_local_domain =
broken_sasl_auth_clients = yes
smtpd_recipient_restrictions = permit
broken_sasl_auth_clients = yes
smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination
smtpd_sender_restrictions =
smtp_use_tls = yes
smtpd_tls_received_header = yes
smtpd_tls_mandatory_protocols = SSLv3, TLSv1
smtpd_tls_mandatory_ciphers = medium
smtpd_tls_auth_only = no
tls_random_source = dev:/dev/urandom
myorigin = /etc/mailname# 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.

mydomain = nextmail.co.cc
myhostname = mail.nextmail.co.cc
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
mydestination = $myhostname, localhost.$mydomain, $mydomain, mail.$mydomain, www.$mydomain, judmail.com
relayhost = $myhostname
relay_domains = $myhostname
mynetworks = 127.0.0.1,localhost
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
home_mailbox = Maildir/
mailbox_command =
inet_protocols = all
smtpd_sasl_auth_enable = yes
smtpd_sasl_type = cyrus
smtpd_sasl_path = smtpd
smtpd_sasl_authenticated_header = no
smtpd_sasl_security_options = noanonymous
smtpd_sasl_local_domain =
broken_sasl_auth_clients = yes
smtpd_recipient_restrictions = permit
broken_sasl_auth_clients = yes
smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination
smtpd_sender_restrictions =
smtp_use_tls = yes
smtpd_tls_received_header = yes
smtpd_tls_mandatory_protocols = SSLv3, TLSv1
smtpd_tls_mandatory_ciphers = medium
smtpd_tls_auth_only = no
tls_random_source = dev:/dev/urandom
myorigin = /etc/mailname
smtp_tls_security_level = may
smtpd_tls_security_level = may
smtp_tls_note_starttls_offer = yes
smtpd_tls_CAfile = /etc/postfix/ssl/cacert.pem
smtpd_tls_loglevel = 1
smtpd_tls_session_cache_timeout = 3600s
Avatar of abolinhas
to remove postfix, try apt-get remove postfix.

and then try use artica for postfix, it's a good web inteface to manage postfix e their plugins without techincal skill's.

www.artica.fr
Avatar of alpires

ASKER

iam installing this artica using this tuto
http://www.artica.fr/index.php/get-a-download-artica/binaries-setup-all-distris

I'm noticing many erros while installing. error are the same:

ERROR 1045 (28000): Acess denied for user 'root@localhost' (using password: NO);
on installation ?
Avatar of alpires

ASKER

YEs, like here.. everytime I press ENTER this process happens again...




###########################################
##                                       ##
##  Artica-postfix modules installation  ##
##                                       ##
###########################################

"Be sure to not install Artica on a production server already set
Artica will transform this system to fit it`s needs that should not encounter
your same parameters strategy. use a free system before installing it!"

#################################################################################
##                                                                             ##
## You can access to artica by typing https://yourserver:9000                  ##
## Use on logon section the username "Manager"                                 ##
## Use on logon section the password "secret"                                  ##
## You have to logon to artica web site, set yours domains and apply policies  ##
##                                                                             ##
## You can install others package by executing artica-make                     ##
## /usr/share/artica-postfix/bin/artica-make --help                            ##
##                                                                             ##
#################################################################################

Select the modules you want to install:

##################################################################
##                                                              ##
## Install mandatories dependencies..:..................[ENTER] ##
##                                                              ##
##################################################################

This will install 2 package(s):
Quit the installation program.........................:[Q]
Type the option.......................................:


You have selected the option :

The following package(s) must be installed in order to perform continue setup

-----------------------------------------------------------------------------
",zabbix-server-mysql"
-----------------------------------------------------------------------------

Do you allow install these packages? [Y]
Y
Lendo listas de pacotes... Pronto
Construindo árvore de dependências      
Lendo informação de estado... Pronto
zabbix-server-mysql já é a versão mais nova.
Os seguintes pacotes foram automaticamente instalados e não são mais requeridos:
  libcrypt-openssl-rsa-perl libconvert-uulib-perl libarchive-zip-perl libcrypt-openssl-bignum-perl expect courier-base libmail-dkim-perl
  libconvert-tnef-perl courier-authlib-userdb courier-authlib libnet-server-perl libunix-syslog-perl mhonarc libio-multiplex-perl libnet-cidr-perl
  libberkeleydb-perl courier-authdaemon
Use 'apt-get autoremove' para removê-los.
0 pacotes atualizados, 0 pacotes novos instalados, 0 a serem removidos e 0 não atualizados.
1 pacotes não totalmente instalados ou removidos.
Depois desta operação, 0B adicionais de espaço em disco serão usados.
Configurando zabbix-server-mysql (1:1.6.1-3ubuntu0.1) ...
dbconfig-common: writing config to /etc/dbconfig-common/zabbix-server-mysql.conf
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO).
unable to connect to mysql server.
error encountered creating user:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
dbconfig-common: zabbix-server-mysql configure: aborted.
dbconfig-common: flushing administrative password
dpkg: erro processando zabbix-server-mysql (--configure):
 sub-processo post-installation script retornou estado de saída de erro 1
Erros foram encontrados durante o processamento de:
 zabbix-server-mysql
E: Sub-process /usr/bin/dpkg returned an error code (1)
Checking.............: system...
Checking.............: AppArmor...
Checking.............: Base system...
Checking.............: Postfix system...
Checking.............: Cyrus system...
Checking.............: Files Sharing system...
Checking.............: Squid proxy and securities...
Checking.............: NFS System...
Checking.............: PowerDNS System...
Some dependencies will missing for next installation if you
continue, some packages installed will failed...
Press Enter key to continue or press "c" and Enter if you want to skip mandatories checking

Avatar of alpires

ASKER

I think it didnt install mysql server
do #apt-get install mysql-server and try again

if you want artica have a portuguese forum for you.



Avatar of alpires

ASKER

actually I have mysql installed.. I found it.. but it has password and its not 'root's ' user.. how do i change it ?
do #mysqladmin -u root password NEWPASSWORD
Avatar of alpires

ASKER

error: 'Acess denied for user 'root'@'localhost' (usiing password: NO)'.

damn it these shits never works for me..

if I unistall this artica and mysqlserver.. and install artica again, will artica install and configure mysql ?
remove mysql-server and try again
Avatar of alpires

ASKER

see what happens now.. its all instaled.. but I cant test.. .. btw how do I access the interface ?


Select the modules you want to install:
Install all modules.......:................................installed

SMTP MTA (include postfix and securities modules):.....Installed
Amavisd-new and milter:................................Installed
Mail server (include postfix and Cyrus-imap):..........Installed
**********************************************************
Files Sharing (include Samba and Pure-ftpd):...........Installed
**********************************************************

Squid Proxy (include Squid and dansguardian):..........Installed
**********************************************************

NFS System :...........................................Installed
**********************************************************

PowerDNS System :......................................Installed

----------------------------
Install/upgrade Artica-postfix:........................[5] (1.4.032901)
reboot  Artica-postfix:................................[R]
Get SuperAdmin Infos:..................................[I]

Quit the installation program.........................:[Q]
Type the option.......................................:

Q
You got new messages in /var/mail/root
root@mail:/home/apc# telnet localhost 25
Trying ::1...
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
220 mail.novaerapublicidade.com ESMTP Sendmail 8.14.3/8.14.3/Debian-6; Wed, 31 Mar 2010 12:01:58 -0300; (No UCE/UBE) logging access from: localhost(OK)-localhost [127.0.0.1]
ehlo localhost
250-mail.novaerapublicidade.com Hello localhost [127.0.0.1], pleased to meet you
250 ENHANCEDSTATUSCODES
mail from: <judson@novaerapublicidade.com>
451 4.3.0 Temporary system failure. Please try again later.
mail from: <judson@apcsoftware.com.br>
451 4.3.0 Temporary system failure. Please try again later.

to access to the web interface do https://yourip:9000

by default the username is Manager and pwd is secret

Avatar of alpires

ASKER

not working.. but apache is working..
try urself..

http://189.35.150.132/  -> works
http://189.35.150.132:9000 -> not working
Avatar of alpires

ASKER

wow, it works (at least user interface)..
I have lunchtime now, i back in 1hor30min.. then i'll try to use it :)

(if u want to test email sending, feel free)
Avatar of alpires

ASKER

looks like theres a problem on starting postfix service.. well , be back later :S
if u want try it please feel free to do it
first do # /usr/share/artica-postfix/bin/artica-update --upgrade-nightly --verbose

to update to the last version
ASKER CERTIFIED SOLUTION
Avatar of abolinhas
abolinhas
Flag of Portugal image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of alpires

ASKER

postei lá. topico .. f=74&t=2276