Errors: Mails through XAMPP, Postfix

For: CentOs 6.9 x86_x64, XAMPP, Postfix, mail relay server

Ever got into the situation where you install XAMPP on a Linux server and realize that the mails you send through your PHP application don’t get delivered ?

  • Check /var/log/mailog for any errors.
  • Verify using telnet if the SMTP connection works.
  • Try the following command and check if the mail is delivered.
    echo "My message" | mail -s subject user@gmail.com
  • Check /etc/postfix/main.cf:/etc/postfix/main.cf:
    relayhost = mail-relay-IP

    Flush postfix mail queue:

    postfix -f
  • Check if SELinux is allowing SMTP connections
    [root@webserver ~]# sestatus -b | grep sendmail
    httpd_can_sendmail                   off

    If httpd_can_sendmail is set to ‘off’ like above then do the following

    setsebool httpd_can_sendmail=1
    service postfix restart

    Then restart Apache.

References:
http://www.phpin24.co.za/apache/sendmail-setup-on-linux-with-apache-php/
https://mediatemple.net/community/products/dv/204404584/sending-or-viewing-emails-using-telnet

Docker: Proxy Authentication Error

You change your corporate password and the next thing you see is the error:

{“changed”: false, “changes”: [“{\”status\”:\”Pulling repository docker.io/library/ubuntu\”}\r\n”, “{\”errorDetail\”:{\”message\”:\”Error while pulling image: Get https://index.docker.io/v1/repositories/library/ubuntu/images: Proxy Authentication Required\”},\”error\”:\”Error while pulling image: Get https://index.docker.io/v1/repositories/library/ubuntu/images: Proxy Authentication Required\”}\r\n”], “failed”: true, “msg”: “Unrecognized status from pull.”, “status”: “”}

How to fix?
– Check docker hosts proxies.
– Check proxies set in /etc/default/docker file. If they aren’t set, set them.

Ubuntu Errors -1

Error on running: sudo apt-get update on your Ubuntu user?

W: Failed to fetch http://in.archive.ubuntu.com/ubuntu/dists/trusty-backports/InRelease
W: Failed to fetch http://archive.canonical.com/ubuntu/dists/trusty/InRelease
W: Failed to fetch http://extras.ubuntu.com/ubuntu/dists/trusty/InRelease
W: Failed to fetch http://extras.ubuntu.com/ubuntu/dists/trusty/Release.gpg Cannot initiate the connection to extras.ubuntu.com:80 (2001:67c:1360:8c01::23). - connect (101: Network is unreachable) [IP: 2001:67c:1360:8c01::23 80]
W: Failed to fetch http://archive.canonical.com/ubuntu/dists/trusty/Release.gpg Cannot initiate the connection to archive.canonical.com:80 (2001:67c:1360:8c01::16). - connect (101: Network is unreachable) [IP: 2001:67c:1360:8c01::16 80]
W: Failed to fetch http://in.archive.ubuntu.com/ubuntu/dists/trusty/Release.gpg Cannot initiate the connection to in.archive.ubuntu.com:80 (2001:67c:1360:8001::21). - connect (101: Network is unreachable) [IP: 2001:67c:1360:8001::21 80]
W: Failed to fetch http://in.archive.ubuntu.com/ubuntu/dists/trusty-security/Release.gpg Cannot initiate the connection to in.archive.ubuntu.com:80 (2001:67c:1360:8001::21). - connect (101: Network is unreachable) [IP: 2001:67c:1360:8001::21 80]
W: Failed to fetch http://in.archive.ubuntu.com/ubuntu/dists/trusty-updates/Release.gpg Cannot initiate the connection to in.archive.ubuntu.com:80 (2001:67c:1360:8001::21). - connect (101: Network is unreachable) [IP: 2001:67c:1360:8001::21 80]
W: Failed to fetch http://in.archive.ubuntu.com/ubuntu/dists/trusty-proposed/Release.gpg Cannot initiate the connection to in.archive.ubuntu.com:80 (2001:67c:1360:8001::21). - connect (101: Network is unreachable) [IP: 2001:67c:1360:8001::21 80]
W: Failed to fetch http://in.archive.ubuntu.com/ubuntu/dists/trusty-backports/Release.gpg Cannot initiate the connection to in.archive.ubuntu.com:80 (2001:67c:1360:8001::21). - connect (101: Network is unreachable) [IP: 2001:67c:1360:8001::21 80]

Try the first solution on this link: http://askubuntu.com/questions/711889/err-apt-get-update-on-ubuntu-14-04.

Add a apt.conf file under /etc/apt directory and add the following line:

Acquire::http::Proxy "http://(proxy-username):(proxy-password)@(proxy-address):(proxy-port)";
For example: Acquire::http::Proxy "http://carper:July31Bday@proxy.smthng.co.in:8080";

Then try running sudo apt-get update again.

Intro

I’m one Curious Dev, and I usually have these bucket-loads of questions plaguing my mind. I turn to Google to save me from my misery and learn new things (actually re-learning facts I should be knowing by default).

Mostly I will be covering things that I learn day-by-day or if I find something new and interesting. Though it could be dangerously obvious to other developers; it could enlighten those who live under a rock like me. 😀