How to setup postfix/dovecot? not working for me

Issues related to applications and software problems
Post Reply
sandbird
Posts: 5
Joined: 2014/04/16 09:10:02

How to setup postfix/dovecot? not working for me

Post by sandbird » 2014/04/16 09:42:58

I tried to setup profix/dovecot without any luck.

When I'm trying to send an email from gmail to my server, I'm getting:
NOQUEUE: reject: RCPT from ...

On /etc/postfix/mail.cf:

There are myorigin, mydomain and myhostname.
I don't know why there are 3 settings for the same thing but I put all of them to mydomain.com.

On the /etc/postfix/virtual:

I just list all of my virtual users in the format:
myuser@mydoamin.com myuser\@mydomain.com

I'm not sure that this is the right way, again no documentation for anything and no examples.

As for /etc/dovecot I guess that I managed to setup it for non-SSL. When I tried to force SSL google can't login.

I wish someone will post a simple script file example to setup what 99% of the users need:
working mail server with virtual users or even real users - I don't care as long as it'll managed to work. Also I don't care about SSL because it's near impossible to setup if you are not that guy from IBM that wrote this complicated mail software.

sandbird
Posts: 5
Joined: 2014/04/16 09:10:02

Re: How to setup postfix/dovecot? not working for me

Post by sandbird » 2014/04/16 10:53:17

Looks like it's a big secret.
I wish some day someone will create a new mail software that you will install, setup user names and the domain and that's all.
Most people don't know or don't have the time to download half created software and to code the rest of it in script files just to do the same operation that 90% of the users want from a mail server.
I guess that the IBM dude that code postfix/dovecot created it complicated so everyone will be forced to buy from him the secret scripts how to set it up.

fredvps
Posts: 61
Joined: 2014/03/13 22:05:19

Re: How to setup postfix/dovecot? not working for me

Post by fredvps » 2014/04/16 11:31:38

I've been struggling with this for a while now - unfortunately not helped by an ISP
issue I kept assuming was part of my own problem for 2 weeks.

On the google side - I'm starting to suspect that google are dropping email
sourced from self certified SSL sites or anything they "think" may be spam
from their relays.

Unfortunately as you say - the texts are worse than useless - they're actually wrong pretty
much everywhere including here.

sandbird
Posts: 5
Joined: 2014/04/16 09:10:02

Re: How to setup postfix/dovecot? not working for me

Post by sandbird » 2014/04/16 15:25:45

fredvps wrote:I've been struggling with this for a while now - unfortunately not helped by an ISP
issue I kept assuming was part of my own problem for 2 weeks.

On the google side - I'm starting to suspect that google are dropping email
sourced from self certified SSL sites or anything they "think" may be spam
from their relays.

Unfortunately as you say - the texts are worse than useless - they're actually wrong pretty
much everywhere including here.
If you have a working configuration files, can you post it here?

sandbird
Posts: 5
Joined: 2014/04/16 09:10:02

Re: How to setup postfix/dovecot? not working for me

Post by sandbird » 2014/04/16 17:03:56

I need to setup:

* postfix/dovecot mail server.
* one domain - let's say mydomain.com
* text file that allowing me to configure the users and passwords.

I tried this configuration but it's not working:

# Global Postfix configuration file. This file lists only a subset
# of all parameters. For the syntax, and for a complete parameter
# list, see the postconf(5) manual page (command: "man 5 postconf").
#
# For common configuration examples, see BASIC_CONFIGURATION_README
# and STANDARD_CONFIGURATION_README. To find these documents, use
# the command "postconf html_directory readme_directory", or go to
# http://www.postfix.org/.
#
# For best results, change no more than 2-3 parameters at a time,
# and test if Postfix still works after every change.

# SOFT BOUNCE
#
# The soft_bounce parameter provides a limited safety net for
# testing. When soft_bounce is enabled, mail will remain queued that
# would otherwise bounce. This parameter disables locally-generated
# bounces, and prevents the SMTP server from rejecting mail permanently
# (by changing 5xx replies into 4xx replies). However, soft_bounce
# is no cure for address rewriting mistakes or mail routing mistakes.
#
#soft_bounce = no

# LOCAL PATHNAME INFORMATION
#
# The queue_directory specifies the location of the Postfix queue.
# This is also the root directory of Postfix daemons that run chrooted.
# See the files in examples/chroot-setup for setting up Postfix chroot
# environments on different UNIX systems.
#
queue_directory = /var/spool/postfix

# The command_directory parameter specifies the location of all
# postXXX commands.
#
command_directory = /usr/sbin

# The daemon_directory parameter specifies the location of all Postfix
# daemon programs (i.e. programs listed in the master.cf file). This
# directory must be owned by root.
#
daemon_directory = /usr/libexec/postfix

# DO NOT SPECIFY A PRIVILEGED USER OR THE POSTFIX OWNER.
#
#default_privs = nobody

# INTERNET HOST AND DOMAIN NAMES
#
# The myhostname parameter specifies the internet hostname of this
# mail system. The default is to use the fully-qualified domain name
# from gethostname(). $myhostname is used as a default value for many
# other configuration parameters.
#
myhostname = mydomain.com
#myhostname = virtual.domain.tld

# The mydomain parameter specifies the local internet domain name.
# The default is to use $myhostname minus the first component.
# $mydomain is used as a default value for many other configuration
# parameters.
#
mydomain = mydomain.com

# SENDING MAIL
#
# The myorigin parameter specifies the domain that locally-posted
# mail appears to come from. The default is to append $myhostname,
# which is fine for small sites. If you run a domain with multiple
# machines, you should (1) change this to $mydomain and (2) set up
# a domain-wide alias database that aliases each user to
# user@that.users.mailhost.
#
# For the sake of consistency between sender and recipient addresses,
# myorigin also specifies the default domain name that is appended
# to recipient addresses that have no @domain part.
#
myorigin = $myhostname
#myorigin = $mydomain

# RECEIVING MAIL

# The inet_interfaces parameter specifies the network interface
# addresses that this mail system receives mail on. By default,
# the software claims all active interfaces on the machine. The
# machines, you should (1) change this to $mydomain and (2) set up
# a domain-wide alias database that aliases each user to
# user@that.users.mailhost.
#
# For the sake of consistency between sender and recipient addresses,
# myorigin also specifies the default domain name that is appended
# to recipient addresses that have no @domain part.
#
myorigin = $myhostname
#myorigin = $mydomain

# RECEIVING MAIL

# The inet_interfaces parameter specifies the network interface
# addresses that this mail system receives mail on. By default,
# the software claims all active interfaces on the machine. The
# parameter also controls delivery of mail to user@[ip.address].
#
# See also the proxy_interfaces parameter, for network addresses that
# are forwarded to us via a proxy or network address translator.
#
# Note: you need to stop/start Postfix when this parameter changes.
#
#inet_interfaces = all
#inet_interfaces = $myhostname
inet_interfaces = $myhostname, localhost
#inet_interfaces = localhost

# Enable IPv4, and IPv6 if supported
inet_protocols = all

# The proxy_interfaces parameter specifies the network interface
# addresses that this mail system receives mail on by way of a
# proxy or network address translation unit. This setting extends
# the address list specified with the inet_interfaces parameter.
#
# You must specify your proxy/NAT addresses when your system is a
# backup MX host for other domains, otherwise mail delivery loops
# will happen when the primary MX host is down.
#
#proxy_interfaces =
#proxy_interfaces = 1.2.3.4

mydestination = $myhostname, localhost.$mydomain, localhost
#mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
#mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain,
# mail.$mydomain, http://www.$mydomain, ftp.$mydomain

#local_recipient_maps = unix:passwd.byname $alias_maps
#local_recipient_maps = proxy:unix:passwd.byname $alias_maps
#local_recipient_maps =

# The unknown_local_recipient_reject_code specifies the SMTP server
# response code when a recipient domain matches $mydestination or
# ${proxy,inet}_interfaces, while $local_recipient_maps is non-empty
# and the recipient address or address local-part is not found.
#
# The default setting is 550 (reject mail) but it is safer to start
# with 450 (try again later) until you are certain that your
# local_recipient_maps settings are OK.
#
unknown_local_recipient_reject_code = 550

# TRUST AND RELAY CONTROL

#mynetworks_style = class
#mynetworks_style = subnet
mynetworks_style = host

# Alternatively, you can specify the mynetworks list by hand, in
# which case Postfix ignores the mynetworks_style setting.
#
# Specify an explicit list of network/netmask patterns, where the
# mask specifies the number of bits in the network part of a host
# address.
#
# You can also specify the absolute pathname of a pattern file instead
# of listing the patterns here. Specify type:table for table-based lookups
# (the value on the table right-hand side is not used).
#
#mynetworks = 168.100.189.0/28, 127.0.0.0/8
#mynetworks = $config_directory/mynetworks
#mynetworks = hash:/etc/postfix/network_table

#alias_maps = dbm:/etc/aliases
#alias_maps = hash:/etc/aliases
#alias_maps = hash:/etc/aliases, nis:mail.aliases
#alias_maps = netinfo:/aliases

# The alias_database parameter specifies the alias database(s) that
# are built with "newaliases" or "sendmail -bi". This is a separate
# configuration parameter, because alias_maps (see above) may specify
# tables that are not necessarily all under control by Postfix.
#
#alias_database = dbm:/etc/aliases
#alias_database = dbm:/etc/mail/aliases
#alias_database = hash:/etc/aliases
#alias_database = hash:/etc/aliases, hash:/opt/majordomo/aliases

virtual_mailbox_base=/var/mail
virtual_mailbox_domains=hash:/etc/postfix/vmail_domains
virtual_mailbox_maps=hash:/etc/postfix/vmail_mailbox
virtual_alias_maps=hash:/etc/postfix/virtual
virtual_minimum_uid=100
virtual_uid_maps=static:5000
virtual_gid_maps=static:5000
virtual_transport=dovecot

header_checks = regexp:/etc/postfix/header_checks
mime_header_checks = pcre:/etc/postfix/body_checks
smtpd_banner = $myhostname

mailbox_transport = lmtp:unix:/var/lib/imap/socket/lmtp
#
# The efficiency of LMTP delivery for cyrus-imapd can be enhanced via
# these settings.
#
local_destination_recipient_limit = 300
local_destination_concurrency_limit = 5

debug_peer_level = 2

# The debug_peer_list parameter specifies an optional list of domain
# or network patterns, /file/name patterns or type:name tables. When
# an SMTP client or server host name or address matches a pattern,
# increase the verbose logging level by the amount specified in the
# debug_peer_level parameter.
#
#debug_peer_list = 127.0.0.1
#debug_peer_list = some.domain

# The debugger_command specifies the external command that is executed
# when a Postfix daemon program is run with the -D option.
#
# Use "command .. & sleep 5" so that the debugger can attach before
# the process marches on. If you use an X-based debugger, be sure to
# set up your XAUTHORITY environment variable before starting Postfix.
#
debugger_command =
PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
ddd $daemon_directory/$process_name $process_id & sleep 5

# INSTALL-TIME CONFIGURATION INFORMATION
#
# The following parameters are used when installing a new Postfix version.
#
# sendmail_path: The full pathname of the Postfix sendmail command.
# This is the Sendmail-compatible mail posting interface.
#
sendmail_path = /usr/sbin/sendmail.postfix

# newaliases_path: The full pathname of the Postfix newaliases command.
# This is the Sendmail-compatible command to build alias databases.
#
newaliases_path = /usr/bin/newaliases.postfix

# mailq_path: The full pathname of the Postfix mailq command. This
# is the Sendmail-compatible mail queue listing command.
#
mailq_path = /usr/bin/mailq.postfix

# setgid_group: The group for mail submission and queue management
# commands. This must be a group name with a numerical group ID that
# is not shared with other accounts, not even with the Postfix account.
#
setgid_group = postdrop

# html_directory: The location of the Postfix HTML documentation.
#
html_directory = no

# manpage_directory: The location of the Postfix on-line manual pages.
#
manpage_directory = /usr/share/man

# sample_directory: The location of the Postfix sample configuration files.
# This parameter is obsolete as of Postfix 2.1.
#
sample_directory = /usr/share/doc/postfix-2.6.6/samples

# readme_directory: The location of the Postfix README files.
#
readme_directory = /usr/share/doc/postfix-2.6.6/README_FILES

smtpd_recipient_restrictions = permit_mynetworks,
reject_unauth_destination,
# reject_unknown_client,
reject_invalid_hostname,
reject_non_fqdn_hostname,
reject_non_fqdn_sender,
reject_non_fqdn_recipient,
reject_unknown_sender_domain,
reject_unknown_recipient_domain,
smtpd_sender_restrictions = permit_mynetworks,
reject_unknown_sender_domain,
reject_non_fqdn_sender

fredvps
Posts: 61
Joined: 2014/03/13 22:05:19

Re: How to setup postfix/dovecot? not working for me

Post by fredvps » 2014/04/18 11:01:11

sandbird wrote: If you have a working configuration files, can you post it here?
I wish I could - I currently have a system that I can use mail internally to local
accounts (fred jim sheila etc on the server itself) with the mail command
I can also send mail to my other server on the net but it cant send back. Nothing else works
anything sent that goes anywhere else just vanishes despite the postfix log claiming
it was sent and listing the google relay that took it.

Part of my problem is I have knowledge gaps - the last time I did anything
serious with linux was over 20 years ago and all it takes is one setting to be wrong
for the whole house of cards to fall of course.

So right now I cant help - sorry.

Whoever
Posts: 1361
Joined: 2013/09/06 03:12:10

Re: How to setup postfix/dovecot? not working for me

Post by Whoever » 2014/04/19 05:44:33

sandbird wrote:Looks like it's a big secret.
I wish some day someone will create a new mail software that you will install, setup user names and the domain and that's all.
Most people don't know or don't have the time to download half created software and to code the rest of it in script files just to do the same operation that 90% of the users want from a mail server.
I guess that the IBM dude that code postfix/dovecot created it complicated so everyone will be forced to buy from him the secret scripts how to set it up.
This isn't the way to ask for help.

altiris
Posts: 334
Joined: 2013/05/31 01:27:50

Re: How to setup postfix/dovecot? not working for me

Post by altiris » 2014/04/20 15:40:17

sandbird wrote:Looks like it's a big secret.
I wish some day someone will create a new mail software that you will install, setup user names and the domain and that's all.
Most people don't know or don't have the time to download half created software and to code the rest of it in script files just to do the same operation that 90% of the users want from a mail server.
I guess that the IBM dude that code postfix/dovecot created it complicated so everyone will be forced to buy from him the secret scripts how to set it up.
I understand that you are posting this because you are frustrated as things arent working (happens to me all the time) but you really just need to be patient. If you want something that is more automated maybe try Windows Server as it is more automated and has Wizards to do everything. There is no coding involved in the configuration for postfix/dovecot, various types of options have been made into commands to make things simpler. Mail servers are complicated, so are DNS servers, you will not get it right from the start, its like anything you need to practice, in this case you need to read a lot. Now to actually assist you, I followed this guide and I have successfully setup a mail server http://www.unixmen.com/install-postfix- ... entos-6-4/ (The creator of the guide disabled SELinux but I recommened you DO NOT, you do not need to disable SELinux as postfix/dovecot work fine with it enabled, if you plan to use squirrelmail or roundcube then you need to issue this command setsebool -P httpd_can_network_connect=1 )

Additionally, if you want to send mail to the outside you need to configure SASL, which I believe I used this guide and it worked fine. http://wiki.centos.org/HowTos/postfix_sasl

Good luck.

Post Reply