Postfix can't send and receive mails

Discussion in 'Server Operation' started by satimis, Nov 10, 2008.

  1. satimis

    satimis New Member

    Hi folks,


    Debian Etch


    Postfix can't send and receive mails.


    On running;
    # /etc/init.d/postfix check

    # tail /var/log/mail.log
    Code:
    Nov 10 10:00:56 xen05 amavis[3329]: No decoder for       .arj  tried: arj, unarj
    Nov 10 10:00:56 xen05 amavis[3329]: No decoder for       .arc  tried: nomarch, arc
    Nov 10 10:00:56 xen05 amavis[3329]: No decoder for       .zoo  tried: zoo
    Nov 10 10:00:56 xen05 amavis[3329]: No decoder for       .lha  tried: lha
    Nov 10 10:00:56 xen05 amavis[3329]: No decoder for       .doc  tried: ripole
    Nov 10 10:00:56 xen05 amavis[3329]: No decoder for       .cab  tried: cabextract
    Nov 10 10:00:56 xen05 amavis[3329]: No decoder for       .tnef
    Nov 10 10:00:56 xen05 amavis[3329]: Internal decoder for .tnef
    Nov 10 10:00:56 xen05 amavis[3329]: No decoder for       .exe  tried: rar, unrar; lha; arj, unarj
    Nov 10 10:00:56 xen05 amavis[3329]: (!!) TROUBLE in pre_loop_hook: db_home directory is not writable: /var/lib/amavis/db at /usr/sbin/amavisd-new line 6921.
    
    Please advise where shall I check and how to fix the problem. TIA


    Edit:


    It was amavis problem.


    Ran
    # adduser clamav amavis

    adding the user clamav to the group amavis


    then problem gone but another problem surfaces;


    # /etc/init.d/postfix check

    # tail /var/log/mail.log
    Code:
    Nov 10 12:56:15 xen05 postfix/smtpd[2973]: lost connection after RCPT from localhost.localdomain[127.0.0.1]
    Nov 10 12:56:15 xen05 postfix/smtpd[2973]: disconnect from localhost.localdomain[127.0.0.1]
    Nov 10 13:09:48 xen05 postfix/master[2752]: reload configuration /etc/postfix
    Nov 10 13:10:25 xen05 postfix/smtpd[3006]: connect from localhost.localdomain[127.0.0.1]
    Nov 10 13:11:11 xen05 postfix/smtpd[3006]: EDC4F7824C: client=localhost.localdomain[127.0.0.1]
    Nov 10 13:11:49 xen05 postfix/cleanup[3008]: EDC4F7824C: message-id=<[email protected]>
    Nov 10 13:11:49 xen05 postfix/qmgr[3002]: EDC4F7824C: from=<[email protected]>, size=383, nrcpt=1 (queue active)
    Nov 10 13:11:49 xen05 postfix/smtp[3009]: connect to 127.0.0.1[127.0.0.1]: Connection refused (port 10024)
    Nov 10 13:11:49 xen05 postfix/smtp[3009]: EDC4F7824C: to=<[email protected]>, relay=none, delay=56, delays=56/0.01/0/0, dsn=4.4.1, status=deferred (connect to 127.0.0.1[127.0.0.1]: Connection refused)
    Nov 10 13:11:52 xen05 postfix/smtpd[3006]: disconnect from localhost.localdomain[127.0.0.1]
    

    postfix still can't send/receive mails.


    "... connect to 127.0.0.1[127.0.0.1]: Connection refused (port 10024) .." Why port 10024 comes into play?



    B.R.
    satimis
     
    Last edited: Nov 10, 2008
  2. falko

    falko Super Moderator ISPConfig Developer

    It's used by amavisd. Please make sure that amavisd is running.
     
  3. satimis

    satimis New Member

    Hi falko,


    Problem partially solved after running;

    # cd /var/lib/amavis/

    # chown virtual:virtual db
    # ls -l
    total 12
    Code:
    drwxr-xr-x 2 virtual virtual 4096 2008-11-08 05:52 db
    drwxr-xr-x 2 virtual virtual 4096 2008-11-07 11:06 tmp
    drwxr-xr-x 2 virtual virtual 4096 2008-11-07 11:06 virusmails
    

    Mail can be sent via telnet.


    # tail /var/log/mail.log
    Code:
    Nov 10 16:25:42 xen05 postfix/qmgr[2746]: A360C782F4:
    from=<[email protected]>, size=791, nrcpt=1 (queue active)
    Nov 10 16:25:42 xen05 postfix/smtpd[2884]: disconnect from
    localhost.localdomain[127.0.0.1]
    Nov 10 16:25:42 xen05 amavis[2417]: (02417-02) FWD via SMTP:
    <[email protected]> -> <[email protected]>, 250 2.6.0 Ok,
    id=02417-02, from MTA([127.0.0.1]:10025): 250 2.0.0 Ok: queued as
    A360C782F4
    Nov 10 16:25:42 xen05 amavis[2417]: (02417-02) Passed CLEAN, LOCAL
    [127.0.0.1] [127.0.0.1] <[email protected]> ->
    <[email protected]>, Message-ID:
    <[email protected]>, mail_id: pmhX0KqR3luj,
    Hits: -, queued_as: A360C782F4, 594 ms
    Nov 10 16:25:42 xen05 amavis[2417]: (02417-02) TIMING [total 606 ms] -
    SMTP EHLO: 121 (20%)20, SMTP pre-MAIL: 1 (0%)20, SMTP pre-DATA-flush:
    13 (2%)22, SMTP DATA: 19 (3%)26, body_digest: 5 (1%)26, gen_mail_id: 99
    (16%)43, mime_decode: 35 (6%)49, get-file-type1: 38 (6%)55,
    decompose_part: 2 (0%)55, parts_decode: 0 (0%)55, update_cache: 13
    (2%)57, decide_mail_destiny: 1 (0%)57, fwd-connect: 62 (10%)68,
    fwd-mail-from: 16 (3%)70, fwd-rcpt-to: 114 (19%)89, fwd-data-cmd: 1
    (0%)89, write-header: 1 (0%)90, fwd-data-contents: 1 (0%)90,
    fwd-data-end: 32 (5%)95, fwd-rundown: 2 (0%)95, prepare-dsn: 2 (0%)96,
    main_log_entry: 15 (3%)98, update_snmp: 5 (1%)99, unlink-1-files: 3
    (1%)100, rundown: 2 (0%)100
    Nov 10 16:25:42 xen05 postfix/smtp[2882]: 039AE7829B:
    to=<[email protected]>, relay=127.0.0.1[127.0.0.1]:10024, delay=74,
    delays=73/0.01/0.27/0.49, dsn=2.6.0, status=sent (250 2.6.0 Ok,
    id=02417-02, from MTA([127.0.0.1]:10025): 250 2.0.0 Ok: queued as
    A360C782F4)
    Nov 10 16:25:42 xen05 postfix/qmgr[2746]: 039AE7829B: removed
    Nov 10 16:25:43 xen05 postfix/smtpd[2879]: disconnect from
    localhost.localdomain[127.0.0.1]
    Nov 10 16:25:43 xen05 postfix/smtp[2885]: A360C782F4:
    to=<[email protected]>,
    relay=gmail-smtp-in.l.google.com[209.85.143.27]:25, delay=1.3,
    delays=0.15/0.05/0.26/0.83, dsn=2.0.0, status=sent (250 2.0.0 OK
    1226334083 i9si1521562tid.9)
    Nov 10 16:25:43 xen05 postfix/qmgr[2746]: A360C782F4: removed
    

    But still can't receive mail sent from Internet.


    Ran;

    # /etc/init.d/shorewall stop


    Sent a mail on Yahoo to [email protected]. The mail was rejected as well.


    # tail /var/log/mail.log
    Code:
    Nov 11 02:38:34 xen05 postfix/anvil[3266]: statistics: max cache size 1
    at Nov 11 02:35:38
    Nov 11 02:39:15 xen05 postfix/master[2745]: reload configuration
    /etc/postfix
    Nov 11 02:41:53 xen05 postfix/smtpd[3445]: warning: 121.34.170.57:
    hostname 57.170.34.121.broad.sz.gd.dynamic.163data.com.cn verification
    failed: Name or service not known
    Nov 11 02:41:53 xen05 postfix/smtpd[3445]: connect from
    unknown[121.34.170.57]
    Nov 11 02:41:55 xen05 postfix/smtpd[3445]: NOQUEUE: reject: RCPT from
    unknown[121.34.170.57]: 554 5.7.1 <[email protected]>: Relay access
    denied; from=<[email protected]> to=<[email protected]> proto=ESMTP
    helo=<57.170.34.121.broad.sz.gd.dynamic.163data.com.cn>
    Nov 11 02:41:55 xen05 postfix/smtpd[3445]: lost connection after RCPT
    from unknown[121.34.170.57]
    Nov 11 02:41:55 xen05 postfix/smtpd[3445]: disconnect from
    unknown[121.34.170.57]
    Nov 11 02:45:15 xen05 postfix/anvil[3446]: statistics: max connection
    rate 1/60s for (smtp:121.34.170.57) at Nov 11 02:41:53
    Nov 11 02:45:15 xen05 postfix/anvil[3446]: statistics: max connection
    count 1 for (smtp:121.34.170.57) at Nov 11 02:41:53
    Nov 11 02:45:15 xen05 postfix/anvil[3446]: statistics: max cache size 1
    at Nov 11 02:41:53

    I have been googling a while without solution discovered. The cause is supposed to be no relay_domains defined.


    # postconf -n
    Code:
    alias_database = hash:/etc/postfix/aliases
    alias_maps = hash:/etc/postfix/aliases
    append_dot_mydomain = no
    biff = no
    broken_sasl_auth_clients = yes
    config_directory = /etc/postfix
    content_filter = amavis:[127.0.0.1]:10024
    delay_warning_time = 4h
    disable_vrfy_command = yes
    inet_interfaces = all
    local_recipient_maps =
    mailbox_size_limit = 0
    masquerade_exceptions = root
    maximal_backoff_time = 8000s
    maximal_queue_lifetime = 7d
    minimal_backoff_time = 1000s
    mydestination = xen05.satimis.com, localhost.satimis.com, , localhost
    myhostname = xen05.satimis.com
    mynetworks = 127.0.0.0/8
    mynetworks_style = host
    myorigin = /etc/mailname
    recipient_delimiter = +
    relayhost =
    smtp_helo_timeout = 60s
    smtp_tls_session_cache_database = btree:${queue_directory}/smtp_scache
    smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
    smtpd_client_restrictions = reject_rbl_client sbl.spamhaus.org,
    reject_rbl_client dnsbl.njabl.org
    smtpd_data_restrictions = reject_unauth_pipelining
    smtpd_delay_reject = yes
    smtpd_hard_error_limit = 12
    smtpd_helo_required = yes
    smtpd_helo_restrictions = permit_mynetworks, warn_if_reject
    reject_non_fqdn_hostname, reject_invalid_hostname, permit
    smtpd_recipient_limit = 16
    smtpd_recipient_restrictions = reject_unauth_pipelining,
    permit_mynetworks, reject_non_fqdn_recipient,
    reject_unknown_recipient_domain, reject_unauth_destination,
    check_policy_service inet:127.0.0.1:60000, permit
    smtpd_sasl_auth_enable = yes
    smtpd_sasl_local_domain =
    smtpd_sasl_path = /etc/postfix/sasl:/usr/lib/sasl2
    smtpd_sasl_security_options = noanonymous
    smtpd_sender_restrictions = permit_sasl_authenticated,
    permit_mynetworks, reject_non_fqdn_sender,
    reject_unknown_sender_domain, reject_unauth_pipelining, permit
    smtpd_soft_error_limit = 3
    smtpd_tls_cert_file = /etc/postfix/postfix.cert
    smtpd_tls_key_file = /etc/postfix/postfix.key
    smtpd_tls_session_cache_database =
    btree:${queue_directory}/smtpd_scache
    smtpd_use_tls = yes
    unknown_local_recipient_reject_code = 450
    virtual_alias_maps = mysql:/etc/postfix/mysql_alias.cf
    virtual_gid_maps = mysql:/etc/postfix/mysql_gid.cf
    virtual_mailbox_base = /var/spool/mail/virtual
    virtual_mailbox_domains = mysql:/etc/postfix/mysql_domains.cf
    virtual_mailbox_maps = mysql:/etc/postfix/mysql_mailbox.cf
    virtual_uid_maps = mysql:/etc/postfix/mysql_uid.cf
    

    # cat /etc/postfix/mysql_domains.cf
    Code:
    user=mail
    password=mymailpass
    dbname=maildb
    table=domains
    select_field=domain
    where_field=domain
    hosts=127.0.0.1
    additional_conditions = and enabled = 1
    

    # mysql -u root -p
    mysql> USE maildb;
    mysql> show tables;
    Code:
    +------------------+
    | Tables_in_maildb |
    +------------------+
    | aliases          |
    | domains          |
    | users            |
    +------------------+
    3 rows in set (0.00 sec)
    

    mysql> SELECT * from domains;
    Code:
    +------+-----------------------+-----------+---------+
    | pkid | domain                | transport | enabled |
    +------+-----------------------+-----------+---------+
    |    1 | localhost             | virtual:  |       1 |
    |    2 | localhost.localdomain | virtual:  |       1 |
    |    3 | satimis.com.tld       | virtual:  |       1 |
    +------+-----------------------+-----------+---------+
    3 rows in set (0.00 sec)
    

    Whether it just needs "satimis.com" deleting ".tld"-top_level_domain ?


    mysql> SELECT * from users;
    Code:
    +---------------------+---------+------+------+-------------------------+----------+---------+-----------------+------------+---------------+-------+------------+----------------+
    | id                  | name    | uid  | gid  | home                   
    | maildir  | enabled | change_password | clear   | crypt         |
    quota | procmailrc | spamassassinrc |
    +---------------------+---------+------+------+-------------------------+----------+---------+-----------------+------------+---------------+-------+------------+----------------+
    | [email protected]      | root    | 5000 | 5000 | /var/spool/mail/virtual
    | root/    |       1 |               1 | x05root   | sdtrusfX0Jj66 |   
       |            |                |
    | [email protected] | Stephen | 5000 | 5000 | /var/spool/mail/virtual
    | Stephen/ |       1 |               1 | x05satimis | sdtrusfX0Jj66 |  
        |            |                |
    +---------------------+---------+------+------+-------------------------+----------+---------+-----------------+------------+---------------+-------+------------+----------------+
    2 rows in set (0.00 sec)
    

    # /home/satimis/postfinger
    Code:
    postfinger - postfix configuration on Tue Nov 11 04:50:52 UTC 2008
    version: 1.30
    
    - snip -
    
    --master.cf--
    smtp      inet  n       -       n       -       -       smtpd
    smtps     inet  n       -       n       -       -       smtpd
        -o smtpd_tls_wrappermode=yes
        -o smtpd_sasl_auth_enable=yes
    587       inet  n       -       n       -       -       smtpd
        -o smtpd_enforce_tls=yes
        -o smtpd_sasl_auth_enable=yes
    pickup    fifo  n       -       -       60      1       pickup
    cleanup   unix  n       -       -       -       0       cleanup
    qmgr      fifo  n       -       n       300     1       qmgr
    tlsmgr    unix  -       -       n       300     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
    smtp      unix  -       -       -       -       -       smtp
    relay     unix  -       -       -       -       -       smtp
            -o fallback_relay=
    showq     unix  n       -       -       -       -       showq
    error     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
    maildrop  unix  -       n       n       -       -       pipe
      flags=DRhu user=vmail argv=/usr/bin/maildrop -d ${recipient}
    uucp      unix  -       n       n       -       -       pipe
      flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail
    ($recipient)
    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}
    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 strict_rfc821_envelopes=yes
        -o mynetworks=127.0.0.0/8
        -o smtpd_error_sleep_time=0
        -o smtpd_soft_error_limit=1001
        -o smtpd_hard_error_limit=1001
    pre-cleanup unix n      -       -       -       0       cleanup
        -o virtual_alias_maps=
        -o canonical_maps=
        -o sender_canonical_maps=
        -o recipient_canonical_maps=
        -o masquerade_domains=
    
    -- end of postfinger output --
    

    B.R.
    satimis
     
  4. falko

    falko Super Moderator ISPConfig Developer

  5. satimis

    satimis New Member

    Hi falko,


    Problem solved by making following line on /etc/postfix/main.cf as;
    Code:
    mydestination = $myhostname, localhost.$mydomain, localhost, satimis.com
    

    I'm following this howto;
    http://flurdy.com/docs/postfix/edition5.html

    in combination with;
    http://workaround.org/articles/ispmail-sarge/

    plus google searches and exchange on postings building a postfix virtual mail server. This is my 5th round. The server is working able to send (via telnet) and receive mails by itself.


    Made following tests;


    1)
    Sent a mail on Gmail to [email protected]. Mail arrived, being delivered to /var/spool/mail/satimis file


    # tail /var/log/mail.log
    Code:
    Nov 12 12:41:31 xen05 postfix/cleanup[3176]: 757D9782F6:
    message-id=<[email protected]>
    Nov 12 12:41:31 xen05 postfix/smtpd[3180]: disconnect from
    localhost.localdomain[127.0.0.1]
    Nov 12 12:41:31 xen05 postfix/qmgr[2884]: 757D9782F6:
    from=<[email protected]>, size=2221, nrcpt=1 (queue active)
    Nov 12 12:41:31 xen05 amavis[2419]: (02419-01) FWD via SMTP:
    <[email protected]> -> <[email protected]>, 250 2.6.0 Ok,
    id=02419-01, from MTA([127.0.0.1]:10025): 250 2.0.0 Ok: queued as
    757D9782F6
    Nov 12 12:41:32 xen05 postfix/local[3182]: 757D9782F6:
    to=<[email protected]>, relay=local, delay=0.58,
    delays=0.08/0.37/0/0.14, dsn=2.0.0, status=sent (delivered to mailbox)
    Nov 12 12:41:32 xen05 postfix/qmgr[2884]: 757D9782F6: removed
    Nov 12 12:41:32 xen05 amavis[2419]: (02419-01) Passed CLEAN,
    [74.125.44.152] [74.125.44.152] <[email protected]> ->
    <[email protected]>, Message-ID:
    <[email protected]>, mail_id:
    12vF5yRxczq8, Hits: -, queued_as: 757D9782F6, 1722 ms
    Nov 12 12:41:32 xen05 amavis[2419]: (02419-01) TIMING [total 1736 ms] -
    SMTP EHLO: 341 (20%)20, SMTP pre-MAIL: 1 (0%)20, mkdir tempdir: 15
    (1%)21, create email.txt: 2 (0%)21, SMTP pre-DATA-flush: 11 (1%)21,
    SMTP DATA: 10 (1%)22, body_digest: 10 (1%)23, gen_mail_id: 4 (0%)23,
    mkdir parts: 1 (0%)23, mime_decode: 136 (8%)31, get-file-type1: 73
    (4%)35, decompose_part: 2 (0%)35, parts_decode: 0 (0%)35, update_cache:
    110 (6%)41, decide_mail_destiny: 2 (0%)41, fwd-connect: 160 (9%)51,
    fwd-mail-from: 11 (1%)51, fwd-rcpt-to: 26 (2%)53, fwd-data-cmd: 2
    (0%)53, write-header: 12 (1%)54, fwd-data-contents: 0 (0%)54,
    fwd-data-end: 38 (2%)56, fwd-rundown: 6 (0%)56, prepare-dsn: 734
    (42%)98, main_log_entry: 15 (1%)99, update_snmp: 7 (0%)100,
    unlink-1-files: 5 (0%)100, rundown: 1 (0%)100
    Nov 12 12:41:32 xen05 postfix/smtp[3178]: DA9DB782D3:
    to=<[email protected]>, relay=127.0.0.1[127.0.0.1]:10024, delay=3.4,
    delays=1.6/0.03/0.41/1.4, dsn=2.6.0, status=sent (250 2.6.0 Ok,
    id=02419-01, from MTA([127.0.0.1]:10025): 250 2.0.0 Ok: queued as
    757D9782F6)
    Nov 12 12:41:32 xen05 postfix/qmgr[2884]: DA9DB782D3: removed

    # ls -al /var/spool/mail/
    Code:
    total 52
    drwxrwsr-x  3 root    mail     4096 2008-11-12 12:55 .
    drwxr-xr-x 14 root    root     4096 2008-11-07 11:31 ..
    -rw-------  1 root    mail    30076 2008-11-12 06:25 root
    -rw-------  1 satimis mail     6639 2008-11-12 12:55 satimis
    drwxr-sr-x  2 virtual virtual  4096 2008-11-08 06:33 virtual

    2)
    Sent another mail on Yahoo to [email protected]


    # tail /var/log/mail.log
    Code:
    Nov 12 12:41:32 xen05 amavis[2419]: (02419-01) TIMING [total 1736 ms] -
    SMTP EHLO: 341 (20%)20, SMTP pre-MAIL: 1 (0%)20, mkdir tempdir: 15
    (1%)21, create email.txt: 2 (0%)21, SMTP pre-DATA-flush: 11 (1%)21,
    SMTP DATA: 10 (1%)22, body_digest: 10 (1%)23, gen_mail_id: 4 (0%)23,
    mkdir parts: 1 (0%)23, mime_decode: 136 (8%)31, get-file-type1: 73
    (4%)35, decompose_part: 2 (0%)35, parts_decode: 0 (0%)35, update_cache:
    110 (6%)41, decide_mail_destiny: 2 (0%)41, fwd-connect: 160 (9%)51,
    fwd-mail-from: 11 (1%)51, fwd-rcpt-to: 26 (2%)53, fwd-data-cmd: 2
    (0%)53, write-header: 12 (1%)54, fwd-data-contents: 0 (0%)54,
    fwd-data-end: 38 (2%)56, fwd-rundown: 6 (0%)56, prepare-dsn: 734
    (42%)98, main_log_entry: 15 (1%)99, update_snmp: 7 (0%)100,
    unlink-1-files: 5 (0%)100, rundown: 1 (0%)100
    Nov 12 12:41:32 xen05 postfix/smtp[3178]: DA9DB782D3:
    to=<[email protected]>, relay=127.0.0.1[127.0.0.1]:10024, delay=3.4,
    delays=1.6/0.03/0.41/1.4, dsn=2.6.0, status=sent (250 2.6.0 Ok,
    id=02419-01, from MTA([127.0.0.1]:10025): 250 2.0.0 Ok: queued as
    757D9782F6)
    Nov 12 12:41:32 xen05 postfix/qmgr[2884]: DA9DB782D3: removed
    Nov 12 12:42:00 xen05 postfix/smtpd[3171]: disconnect from
    yx-out-1718.google.com[74.125.44.152]
    Nov 12 12:45:20 xen05 postfix/anvil[3172]: statistics: max connection
    rate 1/60s for (smtp:74.125.44.152) at Nov 12 12:41:28
    Nov 12 12:45:20 xen05 postfix/anvil[3172]: statistics: max connection
    count 1 for (smtp:74.125.44.152) at Nov 12 12:41:28
    Nov 12 12:45:20 xen05 postfix/anvil[3172]: statistics: max cache size 1
    at Nov 12 12:41:28
    Nov 12 12:48:09 xen05 postfix/smtpd[3378]: connect from
    web35208.mail.mud.yahoo.com[66.163.179.87]
    Nov 12 12:48:10 xen05 postfix/smtpd[3378]: NOQUEUE: reject: RCPT from
    web35208.mail.mud.yahoo.com[66.163.179.87]: 450 4.7.1
    <[email protected]>: Recipient address rejected: Greylisted, see
    http://isg.ee.ethz.ch/tools/postgrey/help/satimis.com.html;
    from=<[email protected]> to=<[email protected]> proto=SMTP
    helo=<web35208.mail.mud.yahoo.com>
    Nov 12 12:48:11 xen05 postfix/smtpd[3378]: disconnect from
    web35208.mail.mud.yahoo.com[66.163.179.87]
    

    It also arrived, being added on the same file /var/spool/mail/satimis again.


    I have no idea what does it refer to on following link;

    http://isg.ee.ethz.ch/tools/postgrey/help/satimis.com.html


    Postgrey is running on this box.


    3)
    Again sent another mail on Gmail to [email protected]. It also
    arrived being added to /var/spool/mail/satimis file


    Problem solved.


    Now how can I make the 1st incoming mail creating subdirectoris /cur /new etc automatically. TIA


    B.R.
    satimis
     
  6. falko

    falko Super Moderator ISPConfig Developer

    You must configure your system to use Maildir instead of mbox.
     
  7. satimis

    satimis New Member


    I suppose the problem coming on MySQL.


    Made following test;


    On MySQL

    mysql> show tables;
    Code:
    +------------------+
    | Tables_in_maildb |
    +------------------+
    | aliases          |
    | domains          |
    | users            |
    +------------------+
    3 rows in set (0.00 sec)
    

    changed;
    Code:
    
    mysql> SELECT * from domains;
    +------+-----------------------+-----------+---------+
    | pkid | domain                | transport | enabled |
    +------+-----------------------+-----------+---------+
    |    1 | localhost             | virtual:  |       1 |
    |    2 | localhost.localdomain | virtual:  |       1 |
    |    3 | satimis.com.tld       | virtual:  |       1 |
    +------+-----------------------+-----------+---------+
    3 rows in set (0.00 sec)
    
    to;
    Code:
    mysql> SELECT * from domains;
    +------+-----------------------+-----------+---------+
    | pkid | domain                | transport | enabled |
    +------+-----------------------+-----------+---------+
    |    1 | localhost             | virtual:  |       1 |
    |    2 | localhost.localdomain | virtual:  |       1 |
    |    3 | satimis.com           | virtual:  |       1 |
    +------+-----------------------+-----------+---------+
    3 rows in set (0.00 sec)
    

    and


    change;
    Code:
    mysql> SELECT * from aliases;
    +------+----------------------------+--------------------------+---------+
    | pkid | mail                       | destination              | enabled |
    +------+----------------------------+--------------------------+---------+
    |    1 | [email protected]       | [email protected]           |       1 |
    |    2 | [email protected]         | [email protected]           |       1 |
    |    3 | [email protected]        | [email protected]           |       1 |
    |    4 | [email protected]            | [email protected]           |       1 |
    |    5 | [email protected]             | [email protected]           |       1 |
    |    6 | @localhost                 | [email protected]           |       1 |
    |    7 | @localhost.localdomain     | @localhost               |       1 |
    |    8 | @satimis.com               | [email protected] |       1 |
    |    9 | [email protected] | [email protected]   |       1 |
    |   10 | [email protected]      | [email protected]        |       1 |
    |   11 | [email protected]        | [email protected]       |       1 |
    +------+----------------------------+--------------------------+---------+
    11 rows in set (0.00 sec)
    

    to;
    Code:
    mysql> SELECT * from aliases;
    +------+------------------------+--------------------------+---------+
    | pkid | mail                   | destination              | enabled |
    +------+------------------------+--------------------------+---------+
    |    1 | [email protected]   | [email protected]           |       1 |
    |    2 | [email protected]     | [email protected]           |       1 |
    |    3 | [email protected]    | [email protected]           |       1 |
    |    4 | [email protected]        | [email protected]           |       1 |
    |    5 | [email protected]         | [email protected]           |       1 |
    |    6 | @localhost             | [email protected]           |       1 |
    |    7 | @localhost.localdomain | @localhost               |       1 |
    |    8 | @satimis.com           | [email protected] |       1 |
    |    9 | [email protected] | [email protected]   |       1 |
    |   10 | [email protected]      | [email protected]        |       1 |
    |   11 | [email protected]    | [email protected]       |       1 |
    +------+------------------------+--------------------------+---------+
    11 rows in set (0.00 sec)
    

    # postconf -n
    Code:
    alias_database = hash:/etc/postfix/aliases
    alias_maps = hash:/etc/postfix/aliases
    broken_sasl_auth_clients = yes
    config_directory = /etc/postfix
    content_filter = amavis:[127.0.0.1]:10024
    delay_warning_time = 4h
    disable_vrfy_command = yes
    inet_interfaces = all
    local_recipient_maps =
    masquerade_exceptions = root
    maximal_backoff_time = 8000s
    maximal_queue_lifetime = 7d
    minimal_backoff_time = 1000s
    mydestination =
    myhostname = xen05.satimis.com
    mynetworks = 192.168.0.0/24, 127.0.0.0/8 ##
    mynetworks_style = host
    relayhost =
    smtp_helo_timeout = 60s
    smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
    smtpd_client_restrictions = reject_rbl_client sbl.spamhaus.org, reject_rbl_client dnsbl.njabl.org
    smtpd_data_restrictions = reject_unauth_pipelining
    smtpd_delay_reject = yes
    smtpd_hard_error_limit = 12
    smtpd_helo_required = yes
    smtpd_helo_restrictions = permit_mynetworks, warn_if_reject reject_non_fqdn_hostname, reject_invalid_hostname, permit
    smtpd_recipient_limit = 16
    smtpd_recipient_restrictions = reject_unauth_pipelining, permit_mynetworks, reject_non_fqdn_recipient, reject_unknown_recipient_domain, reject_unauth_destination, check_policy_service inet:127.0.0.1:60000, permit
    smtpd_sasl_auth_enable = yes
    smtpd_sasl_local_domain =
    smtpd_sasl_path = /etc/postfix/sasl:/usr/lib/sasl2
    smtpd_sasl_security_options = noanonymous
    smtpd_sender_restrictions = permit_sasl_authenticated, permit_mynetworks, reject_non_fqdn_sender, reject_unknown_sender_domain, reject_unauth_pipelining, permitsmtpd_soft_error_limit = 3
    smtpd_tls_cert_file = /etc/postfix/postfix.cert
    smtpd_tls_key_file = /etc/postfix/postfix.key
    smtpd_use_tls = yes
    unknown_local_recipient_reject_code = 450
    virtual_alias_maps = mysql:/etc/postfix/mysql_alias.cf
    virtual_gid_maps = mysql:/etc/postfix/mysql_gid.cf
    virtual_mailbox_base = /var/spool/mail/virtual
    virtual_mailbox_domains = mysql:/etc/postfix/mysql_domains.cf
    virtual_mailbox_maps = mysql:/etc/postfix/mysql_mailbox.cf
    virtual_uid_maps = mysql:/etc/postfix/mysql_uid.cf
    

    # postfix reload
    postfix/postfix-script: refreshing the Postfix mail system

    # postfix check

    # tail /var/log/mail.log
    Code:
    Nov 15 07:14:22 xen05 postfix/smtpd[3380]: disconnect from unknown[121.24.66.55]
    Nov 15 07:17:42 xen05 postfix/anvil[3381]: statistics: max connection rate 1/60s for (smtp:121.24.66.55) at Nov 15 07:14:19
    Nov 15 07:17:42 xen05 postfix/anvil[3381]: statistics: max connection count 1 for (smtp:121.24.66.55) at Nov 15 07:14:19
    Nov 15 07:17:42 xen05 postfix/anvil[3381]: statistics: max cache size 1 at Nov 15 07:14:19
    Nov 15 07:20:00 xen05 postfix/postfix-script: refreshing the Postfix mail system
    Nov 15 07:20:00 xen05 postfix/master[2775]: reload configuration /etc/postfix
    Nov 15 07:20:00 xen05 postfix/qmgr[3394]: B3F6E78304: from=<[email protected]>, size=1431, nrcpt=1 (queue active)
    Nov 15 07:20:01 xen05 postfix/virtual[3396]: warning: mysql query failed: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near [email protected]' and enabled = 1' at line 1
    Nov 15 07:20:01 xen05 postfix/virtual[3396]: warning: table virtual_mailbox_maps: lookup [email protected]: Success
    Nov 15 07:20:01 xen05 postfix/virtual[3396]: B3F6E78304: to=<[email protected]>, relay=virtual, delay=7240, delays=7240/0.03/0/0.11, dsn=4.3.5, status=deferred (mail system configuration error)
    
    Error indicated.


    Sent a mail to [email protected] on Gmail.


    # tail /var/log/mail.log
    Code:
    Nov 15 07:23:25 xen05 postfix/smtpd[3471]: disconnect from localhost.localdomain[127.0.0.1]
    Nov 15 07:23:25 xen05 postfix/qmgr[3394]: 4258778309: from=<[email protected]>, size=2217, nrcpt=1 (queue active)
    Nov 15 07:23:25 xen05 amavis[2412]: (02412-01) FWD via SMTP: <[email protected]> -> <[email protected]>, 250 2.6.0 Ok, id=02412-01, from MTA([127.0.0.1]:10025): 250 2.0.0 Ok: queued as 4258778309
    Nov 15 07:23:25 xen05 postfix/virtual[3472]: warning: mysql query failed: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near [email protected]' and enabled = 1' at line 1
    Nov 15 07:23:25 xen05 postfix/virtual[3472]: warning: table virtual_mailbox_maps: lookup [email protected]: Success
    Nov 15 07:23:25 xen05 amavis[2412]: (02412-01) Passed CLEAN, [209.85.198.247] [209.85.198.247] <[email protected]> -> <[email protected]>, Message-ID: <[email protected]>, mail_id: F4+fUTBje8c5, Hits: -, queued_as: 4258778309, 892 ms
    Nov 15 07:23:25 xen05 amavis[2412]: (02412-01) TIMING [total 911 ms] - SMTP EHLO: 151 (17%)17, SMTP pre-MAIL: 1 (0%)17, mkdir tempdir: 4 (0%)17, create email.txt: 3 (0%)18, SMTP pre-DATA-flush: 8 (1%)18, SMTP DATA: 19 (2%)21, body_digest: 4 (0%)21, gen_mail_id: 2 (0%)21, mkdir parts: 0 (0%)21, mime_decode: 53 (6%)27, get-file-type1: 78 (9%)36, parts_decode: 0 (0%)36, update_cache: 8 (1%)37, decide_mail_destiny: 1 (0%)37, fwd-connect: 171 (19%)55, fwd-mail-from: 6 (1%)56, fwd-rcpt-to: 210 (23%)79, fwd-data-cmd: 1 (0%)79, write-header: 3 (0%)80, fwd-data-contents: 2 (0%)80, fwd-data-end: 40 (4%)84, fwd-rundown: 7 (1%)85, prepare-dsn: 4 (0%)85, main_log_entry: 115 (13%)98, update_snmp: 12 (1%)99, unlink-1-files: 5 (1%)100, rundown: 2 (0%)100
    Nov 15 07:23:25 xen05 postfix/smtp[3469]: 0288678306: to=<[email protected]>, relay=127.0.0.1[127.0.0.1]:10024, delay=2, delays=0.96/0.01/0.29/0.76, dsn=2.6.0, status=sent (250 2.6.0 Ok, id=02412-01, from MTA([127.0.0.1]:10025): 250 2.0.0 Ok: queued as 4258778309)
    Nov 15 07:23:25 xen05 postfix/qmgr[3394]: 0288678306: removed
    Nov 15 07:23:25 xen05 postfix/virtual[3472]: 4258778309: to=<[email protected]>, relay=virtual, delay=0.43, delays=0.26/0.03/0/0.14, dsn=4.3.5, status=deferred (mail system configuration error)
    

    Mail arrived saying "table virtual_mailbox_maps: lookup [email protected] m: Success ....". But can't find it nor being rejected to Gmail. I think it is bouncing on Internet.


    # /home/satimis/postfinger
    Code:
    postfinger - postfix configuration on Sat Nov 15 07:49:09 UTC 2008
    version: 1.30
    
    --System Parameters--
    mail_version = 2.3.8
    hostname = xen05.satimis.com
    uname = Linux xen05.satimis.com 2.6.18-xen #1 SMP Fri May 18 16:11:33 BST 2007 i686 GNU/Linux
    
    --Packaging information--
    looks like this postfix comes from deb package: postfix-ii  postfix         2.3.8-2+etch1               A high-performance mail transport agent
    
    --main.cf non-default parameters--
    alias_database = hash:/etc/postfix/aliases
    alias_maps = hash:/etc/postfix/aliases
    broken_sasl_auth_clients = yes
    content_filter = amavis:[127.0.0.1]:10024
    delay_warning_time = 4h
    disable_vrfy_command = yes
    local_recipient_maps =
    masquerade_exceptions = root
    maximal_backoff_time = 8000s
    maximal_queue_lifetime = 7d
    mydestination =
    mynetworks = 192.168.0.0/24, 127.0.0.0/8 ##
    mynetworks_style = host
    smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
    smtpd_client_restrictions = reject_rbl_client sbl.spamhaus.org, reject_rbl_client dnsbl.njabl.org
    smtpd_data_restrictions = reject_unauth_pipelining
    smtpd_hard_error_limit = 12
    smtpd_helo_required = yes
    smtpd_helo_restrictions = permit_mynetworks, warn_if_reject reject_non_fqdn_hostname, reject_invalid_hostname, permit
    smtpd_recipient_limit = 16
    smtpd_recipient_restrictions = reject_unauth_pipelining, permit_mynetworks, reject_non_fqdn_recipient, reject_unknown_recipient_domain, reject_unauth_destination, check_policy_service inet:127.0.0.1:60000, permit
    smtpd_sasl_auth_enable = yes
    smtpd_sasl_path = /etc/postfix/sasl:/usr/lib/sasl2
    smtpd_sender_restrictions = permit_sasl_authenticated, permit_mynetworks, reject_non_fqdn_sender, reject_unknown_sender_domain, reject_unauth_pipelining, permitsmtpd_soft_error_limit = 3
    smtpd_tls_cert_file = /etc/postfix/postfix.cert
    smtpd_tls_key_file = /etc/postfix/postfix.key
    smtpd_use_tls = yes
    smtp_helo_timeout = 60s
    unknown_local_recipient_reject_code = 450
    virtual_alias_maps = mysql:/etc/postfix/mysql_alias.cf
    virtual_gid_maps = mysql:/etc/postfix/mysql_gid.cf
    virtual_mailbox_base = /var/spool/mail/virtual
    virtual_mailbox_domains = mysql:/etc/postfix/mysql_domains.cf
    virtual_mailbox_maps = mysql:/etc/postfix/mysql_mailbox.cf
    virtual_uid_maps = mysql:/etc/postfix/mysql_uid.cf
    
    --master.cf--
    smtp      inet  n       -       n       -       -       smtpd
    smtps     inet  n       -       n       -       -       smtpd
        -o smtpd_tls_wrappermode=yes
        -o smtpd_sasl_auth_enable=yes
    587       inet  n       -       n       -       -       smtpd
        -o smtpd_enforce_tls=yes
        -o smtpd_sasl_auth_enable=yes
    pickup    fifo  n       -       -       60      1       pickup
    cleanup   unix  n       -       -       -       0       cleanup
    qmgr      fifo  n       -       n       300     1       qmgr
    tlsmgr    unix  -       -       n       300     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
    smtp      unix  -       -       -       -       -       smtp
    relay     unix  -       -       -       -       -       smtp
            -o fallback_relay=
    showq     unix  n       -       -       -       -       showq
    error     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
    maildrop  unix  -       n       n       -       -       pipe
      flags=DRhu user=vmail argv=/usr/bin/maildrop -d ${recipient}
    uucp      unix  -       n       n       -       -       pipe
      flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient)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 $recipientscalemail-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}
    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 strict_rfc821_envelopes=yes
        -o mynetworks=127.0.0.0/8
        -o smtpd_error_sleep_time=0
        -o smtpd_soft_error_limit=1001
        -o smtpd_hard_error_limit=1001
    pre-cleanup unix n      -       -       -       0       cleanup
        -o virtual_alias_maps=
        -o canonical_maps=
        -o sender_canonical_maps=
        -o recipient_canonical_maps=
        -o masquerade_domains=
    
    -- end of postfinger output --
    

    # mysql -h 127.0.0.1 -u satimis -pemmanuel
    Code:
    ERROR 1045 (28000): Access denied for user 'satimis'@'localhost' (using password : YES)
    
    satimis is not an user of MySQL.


    # mysql -h 127.0.0.1 -u root -pemmanuel
    Code:
    ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: Y ES)
    
    It is the same.


    # postconf -d | grep mail_version
    Code:
    mail_version = 2.3.8
    

    Edit:

    Problem SOLVED


    mail.log
    Code:
    ....
    warning: mysql query failed: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near [email protected]' and enabled = 1' at line 1
    ...
    
    already indicating a hint. The problem came from mysql_*cf files. This time google did not help me. Finally I have to check each mysql_*cf and found on mysql_mailbox.cf
    Code:
    ..
    where_field=id  hosts=127.0.0.1
    ...
    
    on the same line.

    Changed it as.
    Code:
    ..
    where_field=id
    hosts=127.0.0.1
    ...
    

    Ran;
    # /etc/init.d/mysql reload

    # postfix reload
    # postfix check

    to make sure no mistake.


    Sent a mail to [email protected] on Gmail.


    # tail /var/log/mail.log
    Code:
    Nov 15 13:29:29 xen05 postfix/qmgr[4756]: E51A57830A: from=<>, size=4241, nrcpt=1 (queue active)
    Nov 15 13:29:29 xen05 postfix/qmgr[4756]: E51EF78310: from=<>, size=4244, nrcpt=1 (queue active)
    Nov 15 13:29:31 xen05 postfix/smtp[4848]: E51EF78310: to=<[email protected]>, relay=gmail-smtp-in.l.google.com[209.85.143.27]:25, delay=1.8, delays=0.07/0.02/0.29/1.5, dsn=2.0.0, status=sent (250 2.0.0 OK 1226755489 b4si4697531tic.2)
    Nov 15 13:29:31 xen05 postfix/qmgr[4756]: E51EF78310: removed
    Nov 15 13:29:31 xen05 postfix/smtp[4847]: E51A57830A: to=<[email protected]>, relay=gmail-smtp-in.l.google.com[209.85.143.27]:25, delay=1.9, delays=0.06/0.02/0.31/1.5, dsn=2.0.0, status=sent (250 2.0.0 OK 1226755489 i9si555433tid.9)
    Nov 15 13:29:31 xen05 postfix/qmgr[4756]: E51A57830A: removed
    Nov 15 13:43:51 xen05 postfix/master[2775]: reload configuration /etc/postfix
    Nov 15 13:43:51 xen05 postfix/qmgr[4889]: ABE8B7830F: from=<[email protected]>, size=2215, nrcpt=1 (queue active)
    Nov 15 13:43:51 xen05 postfix/virtual[4893]: ABE8B7830F: to=<[email protected]>, relay=virtual, delay=1744, delays=1744/0.03/0/0.01, dsn=2.0.0, status=sent (delivered to maildir)
    Nov 15 13:43:51 xen05 postfix/qmgr[4889]: ABE8B7830F: removed
    
    Mail arrived on;

    # ls /var/spool/mail/virtual/Stephen/
    Code:
    cur  new  tmp
    
    Directories automatically created.

    # ls /var/spool/mail/virtual/Stephen/new/
    Code:
    1226756631.V301I7c135M921128.xen05.satimis.com
    
    That is the new mail.


    Now the mail server can send and receive mails. This is my 5th round building Postfix virtual. There is still a long way ahead.


    B.R.
    satimis
     
    Last edited: Nov 15, 2008

Share This Page