# Postfix alias with multiple destinations? [Solved]

## Alrua

I am running my own mailserver setup using the gentoo virtual mailhosting guide w/postfix and mysql.

Since I have just gotten a gmail invite, I thought I'd try out gmail for a while by forwarding my mail to gmail. However, I would like to keep a copy of the mail on my own server. 

Thus, I would like to setup an alias in postfix which will forward the mail to a local mailbox as well as my gmail account. I know this can be done by setting up some kind of mailing list (e.g. using mailman), but it would be much simpler if I could just setup an alias in postfix with multiple destinations. Can this be done, and in that case, how?

Thanks in advance,

-AlruaLast edited by Alrua on Thu Dec 30, 2004 11:04 pm; edited 1 time in total

----------

## EnricoHorn

Add a line to your /etc/mail/aliases

```

foo:    foo-local, foo@gmail.com

```

So all mail to foo@yourdomain.com is forwarded to foo-local (which may be your local username) and foo@gmail.com. (foo and foo-local may be the same)

Dont forget to do a 

```

newaliases

```

after editing your aliases file.

----------

## Alrua

Ok, thanks alot.  :Smile: 

Will this also work if my alias file is in a mysql-database (as per the virt-mail howto)?

-Alrua

----------

## EnricoHorn

It should, but have not tried it.

----------

## Alrua

I'll give it a shot...thanks alot  :Smile: 

----------

## Alrua

Worked like a charm. Once again thanks.  :Smile: 

----------

