Monday, April 27, 2015

Check postfix email queue, and how to clear emails in there

To check the queue, we use a command called mailq, example as below:

$ mailq | tail

2024F98A61     3505 Mon Apr 27 18:16:17  support.us@something.com
(delivery temporarily suspended: Host or domain name not found. Name service error for name=smtp.something.com type=AAAA: Host not found)
                                         support.us@somethingelse.com
231EC98AED     3525 Fri Apr 24 16:48:04  support.us@something.com
(delivery temporarily suspended: Host or domain name not found. Name service error for name=smtp.something.com type=AAAA: Host not found)
                                         whoami@somethingelse.com

To clear the email in the queue, a command called postsuper is used, as below:

$ sudo postsuper -d ALL

To check the status of deletion, you can refer to the maillog, in below example, 15 messages have been deleted:

$ sudo tail /var/log/maillog

Apr 27 19:44:02 au-mel-rh-dev-3 postfix/smtp[6927]: 46F5598AF7: to=, relay=mta5.am0.yahoodns.net[98.138.112.37]:25, delay=2568, delays=2562/0.02/4.3/2, dsn=2.0.0, status=sent (250 ok dirdel)
Apr 27 19:44:02 au-mel-rh-dev-3 postfix/qmgr[5985]: 46F5598AF7: removed
Apr 27 19:44:04 au-mel-rh-dev-3 postfix/smtp[6925]: ABA8B98AFA: to=, relay=mta5.am0.yahoodns.net[98.138.112.34]:25, delay=1624, delays=1617/0.02/4.4/3.3, dsn=2.0.0, status=sent (250 ok dirdel)
Apr 27 19:44:04 au-mel-rh-dev-3 postfix/qmgr[5985]: ABA8B98AFA: removed
Apr 27 19:49:27 au-mel-rh-dev-3 postfix/postsuper[7913]: Deleted: 15 messages



Monday, April 20, 2015

xrdp is not accessible with "X server -- no display in range is available" error

From rdp client, it is showing below error:












Checking on the log, this is the error:

$ sudo tail -f  /var/log/xrdp-sesman.log
...
[20150420-09:55:01] [INFO ] scp thread on sck 7 started successfully

[20150420-09:55:02] [INFO ] ++ created session (access granted): username mrapp, ip 10.157.4.55:53456 - socket: 7

[20150420-09:55:02] [INFO ] starting Xvnc session...

[20150420-09:55:02] [ERROR] X server -- no display in range is available


Searching on the web, I stumbled upon a site. Below are the steps that I learned to solve the above issue from the site:
  1. Edit /etc/xrdp/sesmain.ini
  2. Change MaxSessions from 10 to 100 
  3. $ sudo diff -u {~,/etc/xrdp}/sesman.ini
    --- /home/mrapp/sesman.ini      2012-10-29 20:58:30.000000000 +0700
    +++ /etc/xrdp/sesman.ini        2015-04-20 09:56:31.277342575 +0700
    @@ -13,7 +13,7 @@
    
    
     [Sessions]
     X11DisplayOffset=10
    -MaxSessions=10
    +MaxSessions=100
     KillDisconnected=0
     IdleTimeLimit=0
     DisconnectedTimeLimit=0
  4. Restart xrdp
    $ sudo /etc/init.d/xrdp restart
Try to connect with your rdp client, it should work now.