Cpanel – Forward email to multiple addresses

March 27, 2009 by Romania-Turistica.ro

I was recently facing a very simple problem regarging on how to forward an email address to multiple adresses in cPanel.  As easi as it seemed it should be, I was not sure if the result I get with the new Cpanel 11 will be what I espected.

I wanted to redirect aliasemail@mydomain.com to  realmail1@anotherdomain.com and secondrealmail@anotherdomain.com .

Normaly, in linux a configuration file I would add the multiple forwarded adresses with a comma between them, and everything would work fine, but, since cPanel updated to version 11, it introduced a new user interface with lots of error checking.  And so, if you try to enter two email adresses into the forwarder address box, the box will turn red and notify that ” ; ” or ” , ” are not acceptable characters.

So the dilema is: what shoul I do ? add 2 forwarders ? will this work as espected ?

The answer is yes, we have to add 2 forwards

aliasemail@mydomain.com to  realmail1@anotherdomain.com
and
aliasemail@mydomain.com to secondrealmail@anotherdomain.com

This actually creates a single forward entry within the operating system, but cPanel keeps it recorded as two separate fowards.

Hope this is useful to you.

Calin

PHP Email Headers – PHP Mail Function headers

September 2, 2008 by Romania-Turistica.ro

PHP Mail Function headers

Headers are the parts seen at the top of emails. Typically :

To : A comma seperated list of recipient emails.
From : The senders email address.
Reply-To : The email address where replies should be sent to.
Return-Path : Kinda the same thing as the Reply-To. Some email clients require this, others create a default.
Subject : Subject of the email.
CC : Carbon Copy. A comma seperated list of more recipients that will be seen by all other recipients.
BCC : Blind Carbon Copy. A comma seperated list of more recipients that will not be seen by any other recipients.

The TO and SUBJECT filds are the first and second variables in the MAIL command. The extra headers seen above can be entered as a 4th variable in the MAIL command.

<?php
mail(“yourplace@somewhere.com”,”My email test.”,”Hello, how are you?”,”From: myplace@here.com\r\nReply-To: myplace2@here.com\r\nReturn-Path: myplace@here.com\r\nCC: sombodyelse@noplace.com\r\nBBC: hidden@special.com\r\n”);
?>
Looks kinda messy when it’s all in there without using variables. That above example has all of the extra headers being declared. You may specify all or some or none as you desire. There are 2 very important things to note here :

1. These headers need their NAMES: shown unlike the first three variables in the mail command. The header names are CaSe SeNsItIvE. Use per example.
2. Each header is ended with the Return and Newline characters. \r\n There are no spaces between each header.

For better organization, these extra headers can be declared in a variable string like our previous examples.

<?php
$to = “yourplace@somewhere.com”;
$subject = “My email test.”;
$message = “Hello, how are you?”;

$headers = “From: myplace@here.com\r\n”;
$headers .= “Reply-To: myplace2@here.com\r\n”;
$headers .= “Return-Path: myplace@here.com\r\n”;
$headers .= “CC: sombodyelse@noplace.com\r\n”;
$headers .= “BCC: hidden@special.com\r\n”;

if ( mail($to,$subject,$message,$headers) ) {
   echo “The email has been sent!”;
   } else {
   echo “The email has failed!”;
   }
?>

I forgot the root password on my linux machine

May 12, 2008 by Romania-Turistica.ro

Linux basic commands FAQ

Simple tasks for simple minds :)

The “forgotten root password”

Q. I forgot the root password on my linux machine. How do I change the password ?

R. The easiest way to change the “forgotten root password” is to boot your Linux machine in the single-user mode, namely at the “lilo”prompt, during the bootup you will type:

linux single

This will log you in as “root” without asking for a password. As root, you may now change the root password using passwd command ( the old password is not required ):

passwd

If this seems to you insecure or to simple to be true, that is because no computer system is realy secure if other people have physical access to the computer hardware.

There is a way to secure the lilo boot, but this will be the subject for another article.

Linux change root password

May 12, 2008 by Romania-Turistica.ro

Linux basic commads FAQ:

Simple task for simple minds :)

Q. How do I change the root password on a linux ( unix ) operating system ?
 
R. What you need to do in order to change the root account password on a linux or unix machine is:
 
- open a terminal an login as root ( if the system permits loging in as root )
or
- open a terminal, login with your account and type “su” to become root.
Enter the ( old ) root password to login
then type “passwd” and it will prompt you for a new password.
—————————-
 
root@ibm:/# passwd
 
Changing password for root
Enter the new password (minimum of 5, maximum of 127 characters)
Please use a combination of upper and lower case letters and numbers.
 
New password: **********
Re-enter new password: **********

Password changed.
 
————————–

 

This should be all.
P.S. The password should be rather complex, containing numbers and letters. However try to pic one that you will remember easily, but not known by everybody.

 

Linux TAR Command

April 4, 2008 by Romania-Turistica.ro

Quick Start: Here we’l present quick start examples explained.

Create linux tar gz (Gzip) archive

tar -czvf myarchive.tgz mydirectory/

We use the -t option to create an linux tar archive
-c, –create                      create a new archive

Note that .tgz is the same thing as .tar.gz

Create linux simple tar archive (withouth compresion)

tar -cvf myarchive.tar mydirectory/

Extracting linux tar archive:

Extract linux tar gz (Gzip) archive
tar -xzvf mystuff.tgz

Extract linux simple tar archive
tar -xvf mystuff.tar

We use -x to extract the files form the tar archive
-x, –extract, –get    extract files from an archive

And now let us shortly explain this command

Usage: tar [OPTION]… [FILE]…

Let us check the option used in this example

-c, –create                      create a new archive
-z, –gzip, –ungzip        filter the archive through gzip
-v, –verbose                   verbosely list files processed
-f, –file=ARCHIVE          use archive file or device ARCHIVE

Testing / viewing your archive

tar -tvf myarchive.tar
tar -tzvf myarchive.tgz

Here we used the – t opton
-t, –list                           list the contents of an archive

————————————————-

Go ahead, try out these commands and stay tuned; we will come up with more doccumentation on linux tar command

Why basic Linux Commands ?

April 3, 2008 by Romania-Turistica.ro

Because I for one, am not a Linux or UNIX guru, and still need to use Linux and Linux basic (or not so basic) commands.

So I decided to gather all the articles about simple Linux and UNIX commands, in one place. linuxbasiccommands.wordpress.com will be the place for there articles. Stay tuned, I will update frequently.