Monday, August 6, 2012

vi / vim show line number command



To display line numbers along the left side of a window, type any one of the following:
:set number
or
:set nu

(Fig.01: Vi / Vim line numbers in action - click to enlarge image)
To turn off line number again enter the same command:
:set nu!
If you need number every time you start vi/vim, append following line to your ~/.vimrc file:
set number


How to forward mail to an external email address


In Exchange Server 2003, mail for a recipient can be forwarded to an alternate recipient by modifying the recipient’s Delivery Options in ADUC | recipient -> properties | Exchange General tab.
Figure 1: Use Delivery Options to auto forward email to an alternate recipient in Exchange 2003
Forwarding mail to an external address in Exchange 2010 and Exchange 2007
1Create a MailContact
  1. Expand Recipeint Configuration | Mail Contact
  1. In the Action pane, click New Mail Contact
  1. To create a new Contact object, leave the default (New Contact) selected | click Next
  1. Type First name, Last name
  1. Click Edit to add the external email address
  1. Click New to complete creation of new MailContact
2Forward mail for a recipient to the MailContact
  1. Expand Recipeint Configuration | Mailbox | select mailbox | properties | Mail Flow Settings tab | Delivery Options
  1. Under Forwarding address, select Forward to
  1. Click Browse to select the MailContact
  1. Screenshot: Delivery Options -< Forwarding Address in Exchange 2007
  1. Figure 2:
  2.  Modifying Delivery Options to forward email to an alternate recipient
  1. Optional:
  2.  If a copy of the message needs to be delivered to both the external recipient and the original recipient’s mailbox, select the Deliver message to both forwarding address and mailbox
Listing users with forwarding enabled
Automatic forwarding and Remote Domains
Figure 3: The Allow automatic forward setting for remote domains only impacts client-side automatic forwarding using mechanisms like Inbox Rules, and is disabled by default.
Screenshot: Delivery Options to auto forward email to an alternate recipient in Exchange 2003
If you need to forward mail to an external email address, you can’t simply type the address in theForward to: field on the Delivery Options page. A (mail-enabled) Contact needs to be created in ADfirst, and Delivery Options modified to point to the Contact.
In Exchange 2010/2007, these tasks remain the same. However, instead of using ADUC to accomplish them, you use the EMC or the Shell (aka “EMS“). The new term for a Contact is MailContact.
Create a MailContact using the EMC:
Alternatively, use the Shell to create a new MailContact:
New-MailContact -Name “Foo User” -ExternalEmailAddress “foo@externaldomain.com
Next, we set the recipient’s Delivery Options to deliver to the alternate recipient.
Now that we have a MailContact created for the external recipient’s email address, we can forward mail for the Exchange recipient to the MailContact. To configure mail forwarding using the EMC:
To configure mail forwarding using the Shell:
Set-Mailbox “Joe Adams” -ForwardingAddress “foo@externaldomain.com”
To deliver a copy to the mailbox (in addition to the external email address – equivalent of step 4 above):
Set-Mailbox “Joe Adams” -ForwardingAddress “foo@externaldomain.com” -DeliverToMailboxAndForward $true
This command lists mailboxes with auto forwarding enabled:
Get-Mailbox | where {$_.ForwardingAddress -ne $null} | ft name,forwardingaddress
Remote Domains define a bunch of settings, such as message formats, character sets, and OOFSfor messages sent to specified domains outside your Exchange organization. The default Remote Domain setting for the address space * (the asterisk character) applies to all external domainsexcept the ones for which you’ve created a Remote Domain for.
Screenshot: Remote Domain properties
The Allow automatic forward setting for remote domains applies only to client-side forwardingusing mechanisms like Inbox Rules. For instance, if a user creates a rule in Microsoft Outlook to automatically forward mail to an external email address, the default setting (for address space *) doesn’t allow it. To enable automatic client-side forwarding of mail to external addresses, select the Allow automatic forward checkbox in a remote domain’s properties | Format of original message sent as attachment to journal report tab (Yes, in Exchange 2007 the tab is mislabeled. It is the “Message Formats” tab… :).
Server-side email forwarding configured by an administrator, as shown in this post, is not impacted by this setting.