just the last step...and it works. Postfix...need help config.

Discussion in 'Installation/Configuration' started by ubuntusr, Jan 4, 2009.

  1. ubuntusr

    ubuntusr New Member

    Dear all,

    I have installed ubuntu server NO GUI on my hp desktop machine.
    I am thrilled! because everything works!
    I have installed postfix, courier, sasl, spamassassin, mysql, squirrelmail on the box according to a howtoforge tut.
    I had some problems with spamassassin, apache, and courier, but I solved them all.

    However there's one problem which I cannot solve. I am at this for two weeks and I cannot have no more!
    I'm beyond frustration,...I'm tired. It takes like 5-7 hours everyday trying to solve and I did everything I could think of. I surfed the Inet, but this had no consequence.
    I have windows box here with hmailsever on it, and it works fine behind the router/firewall.

    My A record is ok and my MX record and PTR also ok. Again, with hmailserver everyhting works without any problems.
    check it also at pingability.com (very good site)

    First postfix did not send mail locally, but I succeeded in making it work.
    Now it sends out mail (I think....), but I get a "connection refused" if I send a mail to my mailaccount at my ISP and on other mail accounts. The mail stays in the mailqueue on my box. I use the command mailq to check if mail has been sent.

    I always try to solve my problems, but sometimes one needs a helping hand.....

    Any suggestions and any idea pointing me in the right directions is valuable and very welcome.

    thanks in advance for your effort and it's greatly appreciated.

    August.

    /etc/postfix/main.cf

    # 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 (ImergonServer)

    smtpd_banner = $myhostname ESMTP $mail_name (ImergonMailServer)
    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 = /usr/share/doc/postfix

    # TLS parameters
    smtpd_tls_cert_file = /etc/postfix/smtpd.cert
    smtpd_tls_key_file = /etc/postfix/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 = host.domain.nl
    mydomain = domain.nl
    myorigin = /etc/mailname

    # mydestination = $myhostname,localhost,localhost.$mydomain,mail.$mydomain
    mydestination = mail.domain.nl,localhost,localhost.localdomain,warrior.$mydomain
    mynetworks = 127.0.0.1,10.0.0.0/24
    alias_maps = hash:/etc/aliases
    alias_database = hash:/etc/aliases
    mailbox_size_limit = 0
    recipient_delimiter = +
    html_directory = /usr/share/doc/postfix/html
    virtual_alias_domains =
    # This setting searches for domains in the mysql database.
    virtual_mailbox_domains = proxy:mysql:/etc/postfix/mysql-virtual_domains.cf
    # This setting defines the mailboxes of the users who are in mysql users db.
    virtual_mailbox_maps = proxy:mysql:/etc/postfix/mysql-virtual_mailboxes.cf
    virtual_mailbox_base = /home/vmail
    virtual_uid_maps = static:5000
    virtual_gid_maps = static:5000
    smtpd_sasl_auth_enable = yes
    broken_sasl_auth_client = yes
    smtpd_sasl_authenticated_header = yes
    smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination, reject_unknown_sender_domain, reject_rbl_client zen.spamhaus.org, reject_rbl_client list.dsbl.org smtpd_helo_required = yes
    disable_vrfy_command = yes
    smtpd_data_restrictions = reject_unauth_pipelining
    smtpd_etrn_restrictions = reject
    # This setting is a lookup to transport mail to the right users in the mysql db.
    transport_maps = proxy:mysql:/etc/postfix/mysql-virtual_transports.cf
    virtual_create_maildirsize = yes
    virtual_mailbox_extended = yes
    # virtual_mailbox_limit_maps = proxy:mysql:/etc/postfix/mysql-virtual_mailbox_limit_maps.cf virtual_mailbox_limit_override = yes
    virtual_maildir_limit_message = "The user you are trying to reach is over quota on mailbox." virtual_overquota_bounce = yes
    # This setting is for aliases to be defined in the mysql db.
    proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $virtual_mailbox_maps $virtual_mailbox_domains $relay_recipient_maps $relay_domains $canonical_maps $sender_canonical_maps $recipient_canonical_maps $relocated_maps $transport_maps $mynetworks $virtual_mailbox_limit_maps
    content_filter = amavis:[127.0.0.1]:10024
    receive_override_options = no_address_mappings
    virtual_alias_maps = proxy:mysql:/etc/postfix/mysql-virtual_forwardings.cf, mysql:/etc/postfix/mysql-virtual_email2email.cf
    relayhost =
    inet_interfaces = all
    inet_protocols = all

    /etc/postfix/master.cf:

    #

    # 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 - 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

    # new added line by August for configuration.

    amavis unix - - - - 2 smtp

    -o smtp_data_done_timeout=1200

    -o smtp_send_xforward_command=yes


    127.0.0.1:10025 inet n - - - - smtpd

    -o content_filter=

    -o local_recipient_maps=

    -o relay_recipient_maps=

    -o smtpd_restriction_classes=

    -o smtpd_client_restrictions=

    -o smtpd_helo_restrictions=

    -o smtpd_sender_restrictions=

    -o smtpd_recipient_restrictions=permit_mynetworks,reject

    -o mynetworks=127.0.0.0/8

    -o strict_rfc821_envelopes=yes

    -o receive_override_options=no_unknown_recipient_checks,no_header_body_checks

    -o smtpd_bind_address=127.0.0.1

    # Configurations is done.

    #

    # ====================================================================

    # 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}

    /etc/mailname:

    mail.mydomain.nl

    /etc/hosts :

    127.0.0.1 localhost localhost
    127.0.1.1 host MailMachine

    182.193.122.122 mail.mydomain.nl mailserver



    # The following lines are desirable for IPv6 capable hosts

    ::1 localhost ip6-localhost ip6-loopback

    fe00::0 ip6-localnet

    ff00::0 ip6-mcastprefix

    ff02::1 ip6-allnodes

    ff02::2 ip6-allrouters

    ff02::3 ip6-allhosts

    /var/log/mail.log :

    Jan 4 12:17:02 Mail authdaemond: stopping authdaemond children

    Jan 4 12:17:02 Mail postfix/master[4647]: terminating on signal 15

    Jan 4 12:17:06 Mail spamd[4005]: spamd: server killed by SIGTERM, shutting down

    Jan 4 12:17:51 Mail amavis[3847]: starting. /usr/sbin/amavisd-new at Mail.lan amavisd-new-2.6.1 (20080629),

    Unicode aware

    Jan 4 12:17:51 Mail amavis[3847]: Perl version 5.010000

    Jan 4 12:17:53 Mail amavis[3852]: Net::Server: Group Not Defined. Defaulting to EGID '121 121'

    Jan 4 12:17:53 Mail amavis[3852]: Net::Server: User Not Defined. Defaulting to EUID '109'

    Jan 4 12:17:53 Mail amavis[3852]: Module Amavis::Conf 2.103

    Jan 4 12:17:53 Mail amavis[3852]: Module Archive::Zip 1.18

    Jan 4 12:17:53 Mail amavis[3852]: Module BerkeleyDB 0.34

    Jan 4 12:17:53 Mail amavis[3852]: Module Compress::Zlib 2.011

    Jan 4 12:17:53 Mail amavis[3852]: Module Convert::TNEF 0.17

    Jan 4 12:17:53 Mail amavis[3852]: Module Convert::UUlib 1.11

    Jan 4 12:17:53 Mail amavis[3852]: Module Crypt::OpenSSL::RSA 0.25

    Jan 4 12:17:53 Mail amavis[3852]: Module DBD::mysql 4.007

    Jan 4 12:17:53 Mail amavis[3852]: Module DBI 1.605

    Jan 4 12:17:53 Mail amavis[3852]: Module DB_File 1.816_1

    Jan 4 12:17:53 Mail amavis[3852]: Module Digest::MD5 2.36_01

    Jan 4 12:17:53 Mail amavis[3852]: Module Digest::SHA 5.45

    Jan 4 12:17:53 Mail amavis[3852]: Module Digest::SHA1 2.11

    Jan 4 12:17:53 Mail amavis[3852]: Module MIME::Entity 5.426

    Jan 4 12:17:53 Mail amavis[3852]: Module MIME::parser 5.426

    Jan 4 12:17:53 Mail amavis[3852]: Module MIME::Tools 5.426

    Jan 4 12:17:53 Mail amavis[3852]: Module Mail::DKIM 0.32

    Jan 4 12:17:53 Mail amavis[3852]: Module Mail::Header 2.03

    Jan 4 12:17:53 Mail amavis[3852]: Module Mail::Internet 2.03

    Jan 4 12:17:53 Mail amavis[3852]: Module Mail::SPF v2.006

    Jan 4 12:17:53 Mail amavis[3852]: Module Mail::SpamAssassin 3.002005

    Jan 4 12:17:53 Mail amavis[3852]: Module Net::DNS 0.63

    Jan 4 12:17:53 Mail amavis[3852]: Module Net::Server 0.97

    Jan 4 12:17:53 Mail amavis[3852]: Module NetAddr::IP 4.007

    Jan 4 12:17:53 Mail amavis[3852]: Module Razor2::Client::Version 2.84

    Jan 4 12:17:53 Mail amavis[3852]: Module Socket6 0.20

    Jan 4 12:17:53 Mail amavis[3852]: Module Time::HiRes 1.9711

    Jan 4 12:17:53 Mail amavis[3852]: Module URI 1.35

    Jan 4 12:17:53 Mail amavis[3852]: Module Unix::Syslog 1.1

    Jan 4 12:17:53 Mail amavis[3852]: Amavis::DB code loaded

    Jan 4 12:17:53 Mail amavis[3852]: Amavis::Cache code loaded

    Jan 4 12:17:53 Mail amavis[3852]: SQL base code NOT loaded

    Jan 4 12:17:53 Mail amavis[3852]: SQL::Log code NOT loaded

    Jan 4 12:17:53 Mail amavis[3852]: SQL::Quarantine NOT loaded

    Jan 4 12:17:53 Mail amavis[3852]: Lookup::SQL code NOT loaded

    Jan 4 12:17:53 Mail amavis[3852]: Lookup::LDAP code NOT loaded

    Jan 4 12:17:53 Mail amavis[3852]: AM.PDP-in proto code loaded

    Jan 4 12:17:53 Mail amavis[3852]: SMTP-in proto code loaded

    Jan 4 12:17:53 Mail amavis[3852]: Courier proto code NOT loaded

    Jan 4 12:17:53 Mail amavis[3852]: SMTP-out proto code loaded

    Jan 4 12:17:53 Mail amavis[3852]: Pipe-out proto code NOT loaded

    Jan 4 12:17:53 Mail amavis[3852]: BSMTP-out proto code NOT loaded

    Jan 4 12:17:53 Mail amavis[3852]: Local-out proto code loaded

    Jan 4 12:17:53 Mail amavis[3852]: OS_Fingerprint code NOT loaded

    Jan 4 12:17:53 Mail amavis[3852]: ANTI-VIRUS code loaded

    Jan 4 12:17:53 Mail amavis[3852]: ANTI-SPAM code loaded

    Jan 4 12:17:53 Mail amavis[3852]: ANTI-SPAM-SA code loaded

    Jan 4 12:17:53 Mail amavis[3852]: Unpackers code loaded

    Jan 4 12:17:53 Mail amavis[3852]: DKIM code loaded

    Jan 4 12:17:53 Mail amavis[3852]: Tools code NOT loaded

    Jan 4 12:17:53 Mail amavis[3852]: Found $file at /usr/bin/file

    Jan 4 12:17:53 Mail amavis[3852]: No $dspam, not using it

    Jan 4 12:17:53 Mail amavis[3852]: No $altermime, not using it
    Jan 4 12:17:53 Mail amavis[3852]: Internal decoder for .mail

    Jan 4 12:17:53 Mail amavis[3852]: No decoder for .F

    Jan 4 12:17:53 Mail amavis[3852]: Found decoder for .Z at /bin/uncompress

    Jan 4 12:17:53 Mail amavis[3852]: Internal decoder for .gz

    Jan 4 12:17:53 Mail amavis[3852]: Found decoder for .bz2 at /bin/bzip2 -d

    Jan 4 12:17:53 Mail amavis[3852]: Found decoder for .lzo at /usr/bin/lzop -d

    Jan 4 12:17:53 Mail amavis[3852]: No decoder for .rpm tried: rpm2cpio.pl, rpm2cpio
    Jan 4 12:17:53 Mail

    amavis[3852]: Found decoder for .cpio at /usr/bin/pax

    Jan 4 12:17:53 Mail amavis[3852]: Found decoder for .tar at /usr/bin/pax

    Jan 4 12:17:53 Mail amavis[3852]: Found decoder for .deb at /usr/bin/ar

    Jan 4 12:17:53 Mail amavis[3852]: Internal decoder for .zip

    Jan 4 12:17:53 Mail amavis[3852]: No decoder for .7z tried: 7zr, 7za, 7z

    Jan 4 12:17:53 Mail amavis[3852]: No decoder for .rar tried: unrar-free

    Jan 4 12:17:53 Mail amavis[3852]: No decoder for .arj tried: arj, unarj

    Jan 4 12:17:53 Mail amavis[3852]: Found decoder for .arc at /usr/bin/nomarch

    Jan 4 12:17:53 Mail amavis[3852]: Found decoder for .zoo at /usr/bin/zoo

    Jan 4 12:17:53 Mail amavis[3852]: No decoder for .lha

    Jan 4 12:17:53 Mail amavis[3852]: No decoder for .doc tried: ripole
    Jan 4 12:17:53 Mail amavis[3852]: No

    decoder for .cab tried: cabextract

    Jan 4 12:17:53 Mail amavis[3852]: No decoder for .tnef

    Jan 4 12:17:53 Mail amavis[3852]: Internal decoder for .tnef

    Jan 4 12:17:53 Mail amavis[3852]: No decoder for .exe tried: unrar-free; arj, unarj

    Jan 4 12:17:53 Mail amavis[3852]: Using primary internal av scanner code for ClamAV-clamd

    Jan 4 12:17:53 Mail amavis[3852]: Using primary internal av scanner code for check-jpeg

    Jan 4 12:17:53 Mail amavis[3852]: Found secondary av scanner ClamAV-clamscan at /usr/bin/clamscan
    Jan 4 12:17:54

    Mail amavis[3852]: Creating db in /var/lib/amavis/db/; BerkeleyDB 0.34, libdb 4.6

    Jan 4 12:17:56 Mail spamd[3976]: logger: removing stderr method

    Jan 4 12:18:03 Mail spamd[4016]: spamd: server started on port 783/tcp (running version 3.2.5)

    Jan 4 12:18:03 Mail spamd[4016]: spamd: server pid: 4016

    Jan 4 12:18:03 Mail spamd[4016]: spamd: server successfully spawned child process, pid 4300

    Jan 4 12:18:03 Mail spamd[4016]: spamd: server successfully spawned child process, pid 4301

    Jan 4 12:18:03 Mail spamd[4016]: prefork: child states: II

    Jan 4 12:18:03 Mail authdaemond: modules="authmysql", daemons=5

    Jan 4 12:18:03 Mail authdaemond: Installing libauthmysql

    Jan 4 12:18:03 Mail authdaemond: Installation complete: authmysql

    Jan 4 12:18:05 Mail postfix/master[4647]: daemon started -- version 2.5.5, configuration /etc/postfix

    Jan 4 12:33:45 Mail imapd: Connection, ip=[::ffff:10.0.0.152]

    Jan 4 12:33:48 Mail imapd: LOGIN, [email protected], ip=[::ffff:10.0.0.152], port=[1454], protocol=IMAP

    Jan 4 12:33:51 Mail imapd: Connection, ip=[::ffff:10.0.0.152]

    Jan 4 12:33:51 Mail imapd: LOGIN, [email protected], ip=[::ffff:10.0.0.152], port=[1457], protocol=IMAP

    Jan 4 12:34:06 Mail postfix/smtpd[5074]: connect from clientHost.lan[10.0.0.152]

    Jan 4 12:34:06 Mail postfix/smtpd[5074]: 82C691361C4: client=clientHost.lan[10.0.0.152]

    Jan 4 12:34:06 Mail postfix/cleanup[5082]: 82C691361C4: message-id=<[email protected]>

    Jan 4 12:34:06 Mail postfix/qmgr[4659]: 82C691361C4: from=<[email protected]>, size=706, nrcpt=1 (queue active)

    Jan 4 12:34:06 Mail postfix/smtpd[5074]: disconnect from clientHost.lan[10.0.0.152]

    Jan 4 12:34:06 Mail imapd: Connection, ip=[::ffff:10.0.0.152]

    Jan 4 12:34:06 Mail imapd: LOGIN, [email protected], ip=[::ffff:10.0.0.152], port=[1459], protocol=IMAP

    Jan 4 12:34:07 Mail postfix/smtpd[5092]: connect from localhost[127.0.0.1]

    Jan 4 12:34:07 Mail postfix/smtpd[5092]: C0096136224: client=localhost[127.0.0.1]

    Jan 4 12:34:07 Mail postfix/cleanup[5082]: C0096136224: message-id=<[email protected]>

    Jan 4 12:34:07 Mail postfix/qmgr[4659]: C0096136224: from=<[email protected]>, size=1146, nrcpt=1 (queue active)
    Jan

    4 12:34:07 Mail postfix/qmgr[4659]: warning: connect to transport smtp: Connection refused

    Jan 4 12:34:07 Mail amavis[4128]: (04128-01) Passed CLEAN, LOCAL [10.0.0.152] [10.0.0.152] <[email protected]> ->

    <[email protected]>, Message-ID: <[email protected]>, mail_id: GYKj8cTMngN5, Hits: -1.085, size: 706,

    queued_as: C0096136224, 1064 ms

    Jan 4 12:34:07 Mail postfix/smtp[5083]: 82C691361C4: to=<[email protected]>, relay=127.0.0.1[127.0.0.1]:10024,

    delay=1.4, delays=0.27/0.02/0.01/1.1, dsn=2.0.0, status=sent (250 2.0.0 Ok, id=04128-01, from

    MTA([127.0.0.1]:10025): 250 2.0.0 Ok: queued as C0096136224)

    Jan 4 12:34:07 Mail postfix/qmgr[4659]: 82C691361C4: removed

    Jan 4 12:34:07 Mail postfix/error[5094]: C0096136224: to=<[email protected]>, relay=none, delay=0.08,

    delays=0.03/0.03/0/0.02, dsn=4.3.0, status=deferred (mail transport unavailable)

    Jan 4 12:35:46 Mail postfix/postfix-script[5179]: refreshing the Postfix mail system

    Jan 4 12:35:46 Mail postfix/master[4647]: reload configuration /etc/postfix

    Jan 4 12:39:07 Mail postfix/smtpd[5092]: timeout after END-OF-MESSAGE from localhost[127.0.0.1]

    Jan 4 12:39:07 Mail postfix/smtpd[5092]: disconnect from localhost[127.0.0.1]

    Jan 4 12:40:46 Mail postfix/qmgr[5184]: C0096136224: from=<[email protected]>, size=1146, nrcpt=1 (queue active)

    Jan 4 12:40:46 Mail postfix/smtp[5501]: connect to xs4all.nl[194.109.21.4]:25: Connection refused

    Jan 4 12:40:46 Mail postfix/smtp[5501]: connect to xs4all.nl[194.109.21.3]:25: Connection refused

    Jan 4 12:40:46 Mail postfix/smtp[5501]: C0096136224: to=<[email protected]>, relay=none, delay=399,

    delays=399/0.03/0.06/0, dsn=4.4.1, status=deferred (connect to xs4all.nl[194.109.21.3]:25: Connection refused)


    Places with (mail transport unavailable) is where I experimented to make thing work.
    again your effort is greatly appreciated.
    August.
     
  2. falko

    falko Super Moderator Howtoforge Staff

Share This Page