postfix and virtual hosts or domains tutorial

I have Apache 2 configured with VirtualHost’s. So I have my domains for example http://mydomain1.com and http://sampledomain.com running on my machine. What about mails now? What about postfix?

For arriving mail:

  1. Edit “/etc/postfix/main.cf” and add there:
          virtual_alias_domains = mydomain1.com, sampledomain.com
          virtual_alias_maps = hash:/etc/postfix/virtual
        
  2. Edit or add “/etc/postfix/virtual”:
          @mydomain1.com user1
          homer@sampledomain.com user2
        
    This means that all mail for domain mydomain1.com should be delivered to local user account user1 (/home/user1 or whatever). This means also that mails for homer@sampledomain.com will be delivered to local user account user2.
  3. Execute:
          cd /etc/postfix
          postmap virtual
          /etc/init.d/postfix restart
        

For departuring mail (mails sent form local accounts to the Internet):

  1. Edit “/etc/postfix/main.cf” and add there:
     
          smtp_generic_maps = hash:/etc/postfix/generic
        
  2. Edit or add “/etc/postfix/generic”:
          user1@ubuntu-1004-lucid-64-minimal user1@mydomain1.com
        
    So mails sent from local account user1 will be sent into the Internet as user1@mydomain1.com.
  3. Execute:
          cd /etc/postfix
          postmap virtual
          /etc/init.d/postfix restart
        

Further information in here http://www.postfix.org/VIRTUAL_README.html#virtual_alias and in here http://www.postfix.org/ADDRESS_REWRITING_README.html#generic.

Posted by wojtek Fri, 23 Jul 2010 11:04:00 GMT




ubuntu xml gem instal problem

Problem:

libxslt is missing.  try 'port install libxslt' or 'yum install libxslt-devel'
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers.  Check the mkmf.log file for more
details.  You may need configuration options.

Solution:

apt-get install libxslt1-dev

Posted by wojtek Wed, 21 Apr 2010 11:53:00 GMT




ubuntu 8.04 webdav svn problem

Problem:

Unknown DAV provider: svn

Solution:

apt-get install libapache2-svn
a2enmod dav_svn

Posted by wojtek Wed, 21 Apr 2010 11:50:00 GMT




ubuntu webdav problem

Problem: ubuntu 8.04

Unknown DAV provider: filesystem
   ...fail!

Solution:

a2enmod dav_fs

Posted by wojtek Wed, 21 Apr 2010 11:40:00 GMT




vimdiff not working on ubuntu 9.10 and ubuntu 8.04

Problem:

This Vim was not compiled with the diff feature.

Solution:

apt-get install vim

Stange, but worked for me :)

Posted by wojtek Sat, 03 Apr 2010 12:49:00 GMT




good old pine mail client in ubuntu 9.10

I did not know that Pine is now called Alpine. So to have Pine in Ubuntu one should install

apt-get install alpine

Posted by wojtek Sat, 20 Feb 2010 14:59:00 GMT




xubuntu system tray disappeared

The solution that worked for ubuntu works for xubuntu as well.

Posted by wojtek Wed, 18 Nov 2009 16:10:00 GMT




ntldr is missing vista ubuntu grub

After reinstalling my Windows Vista I had to recover Grub menu. I tried https://help.ubuntu.com/community/RecoveringUbuntuAfterInstallingWindows and EasyBCD. It was not working. I downloaded Ubuntu 9.10 CD and boot it, hoping to do a grub-install. After reboot I got my Grub menu and when trying to boot Vista a “NTLDR is missing” error.

The solution that worked for me was to:


FIRST OF ALL:


Follow http://neosmart.net/wiki/display/EBCD/Recovering+the+Vista+Bootloader+from+the+DVD


SECOND OF ALL:


Follow https://wiki.ubuntu.com/Grub2#Recover%20Grub%202%20via%20LiveCD


And watch out for the menu.lst generated (/boot/grub/menu.lst), mine included thinks like:

title Ubuntu 9.10, kernel 2.6.31-14-generic
root 
kernel /boot/vmlinuz-2.6.3........
initrd /boot/initrd.img-2.6.3........
quiet

But it should be:

title Ubuntu 9.10, kernel 2.6.31-14-generic
root (hd0,4)
kernel /boot/vmlinuz-2.6.3.......
initrd /boot/initrd.img-2.6.3.....
quiet

It seams that update-grub when doing a chroot generated wrong partition numbers for grub. To be more specific it did not generate any partition pointers for the loader :) But after changing those everything works fine.

(hd0,4) is a grub partition number. if you don’t know how to find out what to type there study grub manual http://www.gnu.org/software/grub/manual/html_node/Naming-convention.html


Mine is:


hd - hard disk


0 - disk no. 1


4 - first extended partition


Posted by wojtek Wed, 11 Nov 2009 13:13:00 GMT




eclipse galileo with aptana hangs on ubuntu and then exits

Problem: Eclipse Galileo with Aptana plugin hangs and than after a minute or two exits. Logs say:

java.lang.NoSuchMethodError: method java.util.regex.Pattern.quote with signature (Ljava.lang.String;)Ljava.lang.String; was not found.
   at com.aptana.ide.desktop.integration.protocolhandler.ProtocolHandlerStartup
<clinit>(ProtocolHandlerStartup.java:31)
   at java.lang.Class.initializeClass(libgcj.so.90)
   at java.lang.Class.newInstance(libgcj.so.90)
   at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.
createExecutableExtension(RegistryStrategyOSGI.java:170)
   at org.eclipse.core.internal.registry.ExtensionRegistry.createExecutableExtension
(ExtensionRegistry.java:874)
   at org.eclipse.core.internal.registry.ConfigurationElement.createExecutableExtension
(ConfigurationElement.java:243)
   at org.eclipse.core.internal.registry.ConfigurationElementHandle.
createExecutableExtension(ConfigurationElementHandle.java:51)
   at org.eclipse.ui.internal.WorkbenchPlugin$1.run(WorkbenchPlugin.java:267)
   at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:52)
   at org.eclipse.ui.internal.WorkbenchPlugin.createExtension(WorkbenchPlugin.java:263)
   at org.eclipse.ui.internal.EarlyStartupRunnable.getExecutableExtension
(EarlyStartupRunnable.java:117)
   at org.eclipse.ui.internal.EarlyStartupRunnable.run(EarlyStartupRunnable.java:66)
   at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
   at org.eclipse.ui.internal.Workbench$55.run(Workbench.java:2192)
   at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)

Solution: You are using GCJ java (try java –version in console). Insted of GCJ use Sun JDK.

Posted by wojtek Thu, 24 Sep 2009 15:08:00 GMT




linux ubuntu gnotify

The one and only: http://gmail-notify.sourceforge.net/

Do not use http://gnotify.sourceforge.net/ cos it sucks.

On Ubuntu you should just do:

apt-get install gmail-notify

Posted by wojtek Thu, 25 Jun 2009 20:37:00 GMT