LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
Search this Thread
Old 06-19-2009, 07:25 PM   #1
Roganartu
LQ Newbie
 
Registered: Jun 2009
Posts: 2

Rep: Reputation: 0
Problems with Postfix on Ubuntu Hardy 8.04.2


After spending quite some fixing the port 25 error which seems pretty common with postfix, I now have a new error (which is good I suppose because at least now it's trying to send the mail!)

Note: I only need to send emails from the machine, not receive them. Really only want my PHP apps to be able to send out membership confirmations etc but it's just not working for me. As far as I can tell postfix can be configured to relay messages to smtp.gmail.com for delivery, correct? This is what I've been trying to do, though just being able to send the emails is good enough for me!

Error received each time I try to send a mail from shell is:
Code:
Jun 20 09:42:14 Roganartu sm-mta[26589]: NOQUEUE: SYSERR(root): hash map "access": missing map file /etc/mail/access.db: No such file or directory
Jun 20 09:42:14 Roganartu sm-mta[26589]: ruleset=check_relay, arg1=localhost, arg2=127.0.0.1, reject=451 4.3.0 Temporary system failure. Please try again later.
/etc/postfix/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 (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/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.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 = domain.com (changed for security puposes)
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = $mydomain
mydestination = $mydomain, localhost.$mydomain, , localhost
relayhost = smtp.gmail.com
mynetworks = 127.0.0.0/8
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = loopback-only
inet_protocols = all
## TLS Settings
#
smtp_tls_CAfile = /etc/postfix/cacert.pem
smtp_tls_cert_file = /etc/postfix/cert.pem
smtp_tls_key_file = /etc/postfix/key.pem
smtp_tls_session_cache_database = btree:/var/run/smtp_tls_session_cache
smtp_use_tls = yes
smtpd_tls_CAfile = /etc/postfix/cacert.pem
smtpd_tls_cert_file = /etc/postfix/cert.pem
smtpd_tls_key_file = /etc/postfix/key.pem
smtpd_tls_received_header = yes
smtpd_tls_session_cache_database = btree:/var/run/smtpd_tls_session_cache
smtpd_use_tls = yes
tls_random_source = dev:/dev/urandom
#
## SASL Settings
# This is going in to THIS server
smtpd_sasl_auth_enable = no
# We need this
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtpd_sasl_local_domain = $myhostname
smtp_sasl_security_options = noanonymous
#smtp_sasl_security_options =
smtp_sasl_tls_security_options = noanonymous
smtpd_sasl_application_name = smtpd

transport_maps = hash:/etc/postfix/transport
virtual_maps = hash:/etc/postfix/virtusertable
/etc/postfix/master.cf
Code:
#
# Postfix master process configuration file.  For details on the format
# of the file, see the master(5) manual page (command: "man 5 master").
#
# Do not forget to execute "postfix reload" after editing this file.
#
# ==========================================================================
# service type  private unpriv  chroot  wakeup  maxproc command + args
#               (yes)   (yes)   (yes)   (never) (100)
# ==========================================================================
smtp      inet  n       -       -       -       -       smtpd
#submission inet n       -       -       -       -       smtpd
#  -o smtpd_tls_security_level=encrypt
#  -o smtpd_sasl_auth_enable=yes
#  -o smtpd_client_restrictions=permit_sasl_authenticated,reject
#  -o milter_macro_daemon_name=ORIGINATING
#smtps     inet  n       -       -       -       -       smtpd
#  -o smtpd_tls_wrappermode=yes
#  -o smtpd_sasl_auth_enable=yes
#  -o smtpd_client_restrictions=permit_sasl_authenticated,reject
#  -o milter_macro_daemon_name=ORIGINATING
#628      inet  n       -       -       -       -       qmqpd
pickup    fifo  n       -       -       60      1       pickup
cleanup   unix  n       -       -       -       0       cleanup
qmgr      fifo  n       -       n       300     1       qmgr
#qmgr     fifo  n       -       -       300     1       oqmgr
tlsmgr    unix  -       -       -       1000?   1       tlsmgr
rewrite   unix  -       -       -       -       -       trivial-rewrite
bounce    unix  -       -       -       -       0       bounce
defer     unix  -       -       -       -       0       bounce
trace     unix  -       -       -       -       0       bounce
verify    unix  -       -       -       -       1       verify
flush     unix  n       -       -       1000?   0       flush
proxymap  unix  -       -       n       -       -       proxymap
proxywrite unix -       -       n       -       1       proxymap
smtp      unix  -       -       -       -       -       smtp
# When relaying mail as backup MX, disable fallback_relay to avoid MX loops
relay     unix  -       -       -       -       -       smtp
        -o smtp_fallback_relay=
#       -o smtp_helo_timeout=5 -o smtp_connect_timeout=5
showq     unix  n       -       -       -       -       showq
error     unix  -       -       -       -       -       error
retry     unix  -       -       -       -       -       error
discard   unix  -       -       -       -       -       discard
local     unix  -       n       n       -       -       local
virtual   unix  -       n       n       -       -       virtual
lmtp      unix  -       -       -       -       -       lmtp
anvil     unix  -       -       -       -       1       anvil
scache    unix  -       -       -       -       1       scache
#
# ====================================================================
# Interfaces to non-Postfix software. Be sure to examine the manual
# pages of the non-Postfix software to find out what options it wants.
#
# Many of the following services use the Postfix pipe(8) delivery
# agent.  See the pipe(8) man page for information about ${recipient}
# and other message envelope options.
# ====================================================================
#
# maildrop. See the Postfix MAILDROP_README file for details.
# Also specify in main.cf: maildrop_destination_recipient_limit=1
#
maildrop  unix  -       n       n       -       -       pipe
  flags=DRhu user=vmail argv=/usr/bin/maildrop -d ${recipient}
#
# See the Postfix UUCP_README file for configuration details.
#
uucp      unix  -       n       n       -       -       pipe
  flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient)
#
# Other external delivery methods.
#
ifmail    unix  -       n       n       -       -       pipe
  flags=F user=ftn argv=/usr/lib/ifmail/ifmail -r $nexthop ($recipient)
bsmtp     unix  -       n       n       -       -       pipe
  flags=Fq. user=bsmtp argv=/usr/lib/bsmtp/bsmtp -t$nexthop -f$sender $recipient
scalemail-backend unix  -       n       n       -       2       pipe
  flags=R user=scalemail argv=/usr/lib/scalemail/bin/scalemail-store ${nexthop} ${user} ${extension}
mailman   unix  -       n       n       -       -       pipe
  flags=FR user=list argv=/usr/lib/mailman/bin/postfix-to-mailman.py
  ${nexthop} ${user}
Any help is much appreciated.

Thanks heaps in advance, my port 25 problem was already solved by an old thread here, hoping someone can help out with this one too.
 
Old 06-19-2009, 09:12 PM   #2
billymayday
Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
What's the "port 25 error"? Never heard of it myself.

You need to create the database.

Code:
postmap /etc/mail/access
Assuming the raw access file in in /etc/mail
 
Old 06-19-2009, 09:47 PM   #3
Roganartu
LQ Newbie
 
Registered: Jun 2009
Posts: 2

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by billymayday View Post
What's the "port 25 error"? Never heard of it myself.
As far as my googlings could tell, seems to happen most commonly when people add more than one line in /etc/postfix/master.cf that calls port 25 (most common since it's the smtp port). Mine was because sendmail didn't properly uninstall itself. I had to go through and manually remove all references to it from all rc.d folders and reboot.
Quote:
Originally Posted by billymayday View Post
You need to create the database.

Code:
postmap /etc/mail/access
Assuming the raw access file in in /etc/mail
How? I'm fine doing it manually, but I don't know what's supposed to be in it or the syntax etc.

Also, new error after removing sendmail from rc.d folders:
Code:
Jun 20 12:27:45 Roganartu postfix/cleanup[4027]: fatal: open database /etc/postfix/virtusertable.db: No such file or directory
Jun 20 12:27:46 Roganartu postfix/master[3911]: warning: process /usr/lib/postfix/cleanup pid 4027 exit status 1
Jun 20 12:27:46 Roganartu postfix/master[3911]: warning: /usr/lib/postfix/cleanup: bad command startup -- throttling
I think I know the new problem now, but not how to fix it.

My test emails I'm sending to a domain that is hosted on the server, but that email address is through google apps. As far as I can tell, by sending this email, postfix is thinking it's a local address and trying to open the virtusertable to work out what to do with it.

I'm confused with what to put in the virtusertable because if I create a catchall account that goes to the address it was sent to originally, wont postfix go round in circles with it even though it's hosted elsewhere?
 
Old 06-19-2009, 10:08 PM   #4
billymayday
Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
You have a file in /etc/postfix called virtusertable that I guess you modified in your installation process(?) (virtual_maps = hash:/etc/postfix/virtusertable), but it's a hash table, meaning a type of indexed file for faster access. To create the database (ie /etc/postfix/virtusertable.db from /etc/postfix/virtusertable), simply use postmap

Code:
 postmap /etc/postfix/virtusertable
If you get any similar errors, do the same thing (different file of course).

Since I know nothing about how you went about setting things up, I can't say a lot more.
 
  


Reply

Tags
hardy, postfix, ubuntu


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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Ubuntu Hardy Heron 8.04 Having Some Newbie Problems theahbab Linux - Newbie 5 01-09-2009 05:01 AM
LXer: Simple Guide How to Upgrade Ubuntu 8.04 (Hardy Heron) to Ubuntu 8.10 (Intrepid LXer Syndicated Linux News 0 10-31-2008 10:50 AM
LXer: Drupal + Postfix Integration Under Ubuntu 8.04 (Hardy) LXer Syndicated Linux News 0 10-17-2008 04:51 PM
cant install Linux multi media software on ubuntu hardy heron ubuntu 8.0.4 gnome Jazz44 Linux - General 3 09-15-2008 10:17 AM
LXer: Installing Xen On An Ubuntu 8.04 (Hardy Heron) Server From The Ubuntu Repositor LXer Syndicated Linux News 0 05-08-2008 02:10 PM


All times are GMT -5. The time now is 01:31 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