Mailq Arrival Time

Discussion in 'Installation/Configuration' started by Marcos Saiz, Oct 16, 2018.

  1. Marcos Saiz

    Marcos Saiz New Member

    Hi,
    I've migrated my ISPConfig from Debian7 to Debian9 with migration tool.
    Server info:
    IP-address (as per hostname): ***.***.***.***
    [WARN] could not determine server's ip address by ifconfig
    [INFO] ISPConfig is installed.

    ##### ISPCONFIG #####
    ISPConfig version is 3.1.13
    ##### VERSION CHECK #####
    [INFO] php (cli) version is 7.0.30-0+deb9u1
    ##### PORT CHECK #####
    [WARN] Port 8080 (ISPConfig) seems NOT to be listening
    ISPConfig is running in other port
    ##### MAIL SERVER CHECK #####
    [INFO] I found the following web server(s):
    Apache 2 (PID 1116)
    [INFO] I found the following mail server(s):
    Unknown process (smtpd) (PID 435)
    [INFO] I found the following pop3 server(s):
    Dovecot (PID 900)
    [INFO] I found the following imap server(s):
    Dovecot (PID 900)
    [INFO] I found the following ftp server(s):
    PureFTP (PID 1442)
    q##### RUNNING SERVER PROCESSES #####
    [INFO] I found the following web server(s):
    Apache 2 (PID 1116)
    [INFO] I found the following mail server(s):
    Unknown process (smtpd) (PID 435)
    [INFO] I found the following pop3 server(s):
    Dovecot (PID 900)
    [INFO] I found the following imap server(s):
    Dovecot (PID 900)
    [INFO] I found the following ftp server(s):
    PureFTP (PID 1442)

    ##### LISTENING PORTS #####
    (only ()
    Local (Address)
    [anywhere]:25 (435/smtpd)
    [localhost]:953 (876/named)
    [localhost]:6010 (30036/sshd:)
    [localhost]:6011 (24832/sshd:)
    [localhost]:6012 (7000/sshd:)
    [anywhere]:993 (900/dovecot)
    [anywhere]:995 (900/dovecot)
    [localhost]:10023 (1060/postgrey)
    [localhost]:10024 (28615/amavisd-new)
    [localhost]:10025 (7454/master)
    [localhost]:10026 (28615/amavisd-new)
    [localhost]:10027 (7454/master)
    [anywhere]:587 (4854/smtpd)
    [localhost]:11211 (840/memcached)
    [anywhere]:110 (900/dovecot)
    [anywhere]:143 (900/dovecot)
    [anywhere]:465 (6283/smtpd)
    [anywhere]:21 (1442/pure-ftpd)
    ***.***.***.***:53 (876/named)
    ***.***.***.***:53 (876/named)
    [localhost]:53 (876/named)
    [anywhere]:22 (944/sshd)
    *:*:*:*::*:25 (435/smtpd)
    *:*:*:*::*:953 (876/named)
    *:*:*:*::*:6010 (30036/sshd:)
    *:*:*:*::*:6011 (24832/sshd:)
    *:*:*:*::*:443 (1116/apache2)
    *:*:*:*::*:443 (1116/apache2)
    *:*:*:*::*:443 (1116/apache2)
    *:*:*:*::*:443 (1116/apache2)
    *:*:*:*::*:443 (1116/apache2)
    *:*:*:*::*:443 (1116/apache2)
    *:*:*:*::*:443 (1116/apache2)
    *:*:*:*::*:443 (1116/apache2)
    *:*:*:*::*:443 (1116/apache2)
    *:*:*:*::*:443 (1116/apache2)
    *:*:*:*::*:443 (1116/apache2)
    *:*:*:*::*:6012 (7000/sshd:)
    *:*:*:*::*:993 (900/dovecot)
    *:*:*:*::*:995 (900/dovecot)
    *:*:*:*::*:10024 (28615/amavisd-new)
    *:*:*:*::*:10026 (28615/amavisd-new)
    *:*:*:*::*:3306 (1239/mysqld)
    *:*:*:*::*:587 (4854/smtpd)
    [localhost]10 (900/dovecot)
    [localhost]43 (900/dovecot)
    *:*:*:*::*:80 (1116/apache2)
    *:*:*:*::*:465 (6283/smtpd)
    *:*:*:*::*:8081 (1116/apache2)
    *:*:*:*::*:21 (1442/pure-ftpd)
    *:*:*:*::*:53 (876/named)
    *:*:*:*::*:22 (944/sshd)




    ##### IPTABLES #####
    Chain INPUT (policy ACCEPT)
    target prot opt source destination
    f2b-pureftpd tcp -- [anywhere]/0 [anywhere]/0 multiport dports 21
    f2b-postfix-sasl tcp -- [anywhere]/0 [anywhere]/0 multiport dports 25
    f2b-sshd tcp -- [anywhere]/0 [anywhere]/0 multiport dports 22

    Chain FORWARD (policy ACCEPT)
    target prot opt source destination

    Chain OUTPUT (policy ACCEPT)
    target prot opt source destination

    Chain f2b-postfix-sasl (1 references)
    target prot opt source destination
    RETURN all -- [anywhere]/0 [anywhere]/0

    Chain f2b-pureftpd (1 references)
    target prot opt source destination
    RETURN all -- [anywhere]/0 [anywhere]/0

    Chain f2b-sshd (1 references)
    target prot opt source destination
    RETURN all -- [anywhere]/0 [anywhere]/0

    /etc/localtime is the same as /var/spool/postfix/etc/localtime and /usr/share/zoneinfo/Europe/Madrid
    dpkg-reconfigure tzdata
    Current default time zone: 'Europe/Madrid'
    Local time is now: Tue Oct 16 13:27:44 CEST 2018.
    Universal Time is now: Tue Oct 16 11:27:44 UTC 2018.

    ┬┐Why mailq shows date in UTC time?

    mailq
    -Queue ID- --Size-- ----Arrival Time---- -Sender/Recipient-------
    17891410DA* 76180 Tue Oct 16 11:30:13 [email protected] . com
    [email protected] . com

    -- 74 Kbytes in 1 Request.

    date
    Tue Oct 16 13:30:16 CEST 2018

    Regards
     
  2. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    If the times were local time or some other not UTC time, if would be too hard to compare timestamps between servers.
     
  3. Marcos Saiz

    Marcos Saiz New Member

    All emails in the queue are shown with a time difference of 2 hours.
    That difference is between CEST to UTC.
    I want that mailq show me the queue with CEST time. In the old server mailq shows time in CEST.
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

  5. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    What output do you get from the following command:
    Code:
    date ; date --utc ; cat /etc/timezone ; tail -n 5 /var/log/mail.log
    
     
  6. Marcos Saiz

    Marcos Saiz New Member

    Hi,

    I have tried many stackoverflow solutions and other forums. I can't find a solution.

    date ; date --utc ; cat /etc/timezone ;grep postfix /var/log/mail.log| tail -n 5
    Wed Oct 17 18:27:43 CEST 2018
    Wed Oct 17 16:27:43 UTC 2018
    Europe/Madrid
    Oct 17 18:27:35 hostname postfix/cleanup[31413]: ........................
    Oct 17 18:27:35 hostname postfix/qmgr[30239]: ................
    Oct 17 18:27:35 hostname postfix/pipe[31471]: ...................
    Oct 17 18:27:35 hostname postfix/qmgr[30239]: ...........
    Oct 17 18:27:35 hostname postfix/smtpd[5676]: ............

    Logs are correct, problem is with mailq:

    mailq
    -Queue ID- --Size-- ----Arrival Time---- -Sender/Recipient-------
    6C9DF410E5* 143843 Wed Oct 17 16:30:03

    -- 140 Kbytes in 1 Request.
    [email protected]:~# date
    Wed Oct 17 18:30:14 CEST 2018

    Thanks
     
  7. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    How do you know that arrival time is not correct? I have deferred mails in mail queue that are several days old. Read that mail to see when it has arrived and at what times it has been in which mail server. Use command postcat with the Queue ID that is at the beginning of the line.
    Code:
    postcat /var/spool/postfix/deferred/6/6C9DF410E5 | less
    
    You can then check the time stamp of the file to see when it was created: ls -lh /var/spool/postfix/deferred/6/6C9DF410E5
     
  8. Marcos Saiz

    Marcos Saiz New Member

    Hi
    Code:
    #mailq:
    -Queue ID-  --Size-- ----Arrival Time---- -Sender/Recipient-------
    CB71F4110A*   29157 Mon Oct 22 10:47:57 
    
    #ls -lh /var/spool/postfix/active/CB71F4110A:
    -rwx------ 1 postfix postfix 30K Oct 22 12:47 /var/spool/postfix/active/CB71F4110A
    
    
    #postcat /var/spool/postfix/active/CB71F4110A:
    *** ENVELOPE RECORDS /var/spool/postfix/active/CB71F4110A ***
    message_size:           29157             780               1               0           29157               0
    message_arrival_time: Mon Oct 22 12:47:57 2018
    create_time: Mon Oct 22 12:47:57 2018
    named_attribute: log_ident=CB71F4110A
    I've executed:
    Code:
    mailq | grep -o "^[A-F0-9]*" |awk '{print $1}' | while read id; do postcat /var/spool/postfix/active/$id; ls -lh /var/spool/postfix/active/$id; mailq; done
    Thanks
     
  9. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    You are looking at the active queue. Is the mail stuck there and does not get delivered and removed from queue?
    The mails I have in mailq are in deferred queue. There I compare the time mailq shows to the time I can see inside the mail with postcat, and mailq does indeed show the timestamp as UTC and the times recorded in local time (and the times show the TZ).
    It has never bothered me that mailq shows timestamps in UTC, and I was not aware of the fact until now.
     

Share This Page