# Setting Postfix etc...

## rgk

I have been trying for like a week or two to set up Postfix, normally just giving up. I run lighttpd and I followed http://www.gentoo.org/doc/en/virt-mail-howto.xml a lot, I just skipped the Apache stuff and instead of using rimap I used pam (rimap wouldent work). I just made a ebuild to get postfixadmin without apache, it works fine but I can't get users or anything, I make mailboxes and they don't work on my squirrelmail, I just can't seem to get postfix set up, I haven't had my main email address (the one off my domain) in a while and I can't retrieve many passwords. I also made a DNS A for mail.madgizmo.com and made a DNS MX record for madgizmo.com. If anyone can help, or if anyone knows what I should show, log wise, please respond! Thanks.

----------

## kashani

The Gentoo virtual how-to is incompatible with PostfixAdmin for a number of reason the largest being the completely different database schemas used by each system. I'd scrap what you have now and start over using a how-to from the gentoo-wiki.org based on PostfixAdmin.

kashani

----------

## rgk

i am not really looking for postfixadmin to work or not, it just looked like an easier alternative, even without it i couldent get anything to work because there was no way for me to add mailboxs etc...

----------

## fefeh

I will try to help, I have a working setup.

Can you post the /etc/postfix/main.cf and /etc/postfix/master.cf files?

Also, what happens when you telnet to port 25 on your machine?  Here's an example of how to do it if you don't already know.

```
telnet 127.0.0.1 25

Trying 127.0.0.1...

Connected to 127.0.0.1.

Escape character is '^]'.

220 hostname.domain.com ESMTP Postfix

helo domain.com

250 hostname.domain.com

mail from: fefeh@domain.com

250 2.1.0 Ok

rcpt to: fefeh@domain.com

250 2.1.5 Ok

data

354 End data with <CR><LF>.<CR><LF>

aksjdfkalsdkfj

alksdjfkalsdjf

.

250 2.0.0 Ok: queued as 4782E63CE5

quit

221 2.0.0 Bye

Connection closed by foreign host.

```

----------

## rgk

thank you fefeh!

well to start it off when i telnet 25, its really short all i get is

```
208 ~ # telnet localhost 25

Trying 127.0.0.1...

Connected to localhost.

Escape character is '^]'.

Connection closed by foreign host.
```

it just ends after that

for main.cf (it has a lot of comments etc... so i just copied out what was uncommented.)

```

queue_directory = /var/spool/postfix

command_directory = /usr/sbin

daemon_directory = /usr/lib/postfix

mail_owner = postfix

myhostname = mail.madgizmo.com

mydomain = madgizmo.com

inet_interfaces = all

mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain

unknown_local_recipient_reject_code = 550

mynetworks_style = host

mynetworks = 208.100.2.87/24, 127.0.0.0/8

alias_maps = mysql:/etc/postfix/mysql-aliases.cf

relocated_maps = mysql:/etc/postfix/mysql-relocated.cf

local_transport = local

local_recipient_maps = $alias_maps $virtual_mailbox_maps unix:passwd.byname

virtual_transport = virtual

virtual_mailbox_domains =

        madgizmo.com

virtual_minimum_uid = 1000

virtual_gid_maps = static:$vmail-gid

virtual_mailbox_maps = mysql:/etc/postfix/mysql-virtual-maps.cf

virtual_alias_maps = mysql:/etc/postfix/mysql-virtual.cf

virtual_uid_maps = static:$vmail-uid

virtual_mailbox_base = /

local_destination_concurrency_limit = 2

default_destination_concurrency_limit = 20

debug_peer_level = 2

debugger_command =

         PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin

         xxgdb $daemon_directory/$process_name $process_id & sleep 5

sendmail_path = /usr/sbin/sendmail

newaliases_path = /usr/bin/newaliases

mailq_path = /usr/bin/mailq

setgid_group = postdrop

html_directory = /usr/share/doc/postfix-2.3.6/html

manpage_directory = /usr/share/man

sample_directory = /etc/postfix

readme_directory = /usr/share/doc/postfix-2.3.6/readme

home_mailbox = .maildir/

smtpd_sasl_auth_enable = yes

smtpd_sasl2_auth_enable = yes

smtpd_sasl_security_options = noanonymous

broken_sasl_auth_clients = yes

smtpd_sasl_local_domain =

smtpd_recipient_restrictions =

        permit_sasl_authenticated,

        permit_mynetworks,

        reject_unauth_destination

smtp_use_tls = yes

smtp_tls_note_starttls_offer = yes

smtpd_use_tls = yes

smtpd_tls_key_file = /etc/postfix/newreq.pem

smtpd_tls_cert_file = /etc/postfix/newcert.pem

smtpd_tls_CAfile = /etc/postfix/cacert.pem

smtpd_tls_loglevel = 3

smtpd_tls_received_header = yes

smtpd_tls_session_cache_timeout = 3600s

tls_random_source = dev:/dev/urandom
```

for mail_owner = postfix i am not sure if i should change that to vmail or something?

here is master.cf

```
#

# Postfix master process configuration file.  For details on the format

# of the file, see the master(5) manual page (command: "man 5 master").

#

# ==========================================================================

# service type  private unpriv  chroot  wakeup  maxproc command + args

#               (yes)   (yes)   (yes)   (never) (100)

# ==========================================================================

smtp      inet  n       -       n       -       -       smtpd

#submission inet n       -       n       -       -       smtpd

#  -o smtpd_enforce_tls=yes

#  -o smtpd_sasl_auth_enable=yes

#  -o smtpd_client_restrictions=permit_sasl_authenticated,reject

#smtps     inet  n       -       n       -       -       smtpd

#  -o smtpd_tls_wrappermode=yes

#  -o smtpd_sasl_auth_enable=yes

#  -o smtpd_client_restrictions=permit_sasl_authenticated,reject

#628      inet  n       -       n       -       -       qmqpd

pickup    fifo  n       -       n       60      1       pickup

cleanup   unix  n       -       n       -       0       cleanup

qmgr      fifo  n       -       n       300     1       qmgr

#qmgr     fifo  n       -       n       300     1       oqmgr

tlsmgr    unix  -       -       n       1000?   1       tlsmgr

rewrite   unix  -       -       n       -       -       trivial-rewrite

bounce    unix  -       -       n       -       0       bounce

defer     unix  -       -       n       -       0       bounce

trace     unix  -       -       n       -       0       bounce

verify    unix  -       -       n       -       1       verify

flush     unix  n       -       n       1000?   0       flush

proxymap  unix  -       -       n       -       -       proxymap

smtp      unix  -       -       n       -       -       smtp

# When relaying mail as backup MX, disable fallback_relay to avoid MX loops

relay     unix  -       -       n       -       -       smtp

        -o fallback_relay=

#       -o smtp_helo_timeout=5 -o smtp_connect_timeout=5

showq     unix  n       -       n       -       -       showq

error     unix  -       -       n       -       -       error

discard   unix  -       -       n       -       -       discard

local     unix  -       n       n       -       -       local

virtual   unix  -       n       n       -       -       virtual

lmtp      unix  -       -       n       -       -       lmtp

anvil     unix  -       -       n       -       1       anvil

scache    unix  -       -       n       -       1       scache

#

# ====================================================================

# Interfaces to non-Postfix software. Be sure to examine the manual

# pages of the non-Postfix software to find out what options it wants.

#

# Many of the following services use the Postfix pipe(8) delivery

# agent.  See the pipe(8) man page for information about ${recipient}

# and other message envelope options.

# ====================================================================

#

# maildrop. See the Postfix MAILDROP_README file for details.

# Also specify in main.cf: maildrop_destination_recipient_limit=1

#

maildrop  unix  -       n       n       -       -       pipe

  flags=DRhu user=vmail argv=/usr/local/bin/maildrop -d ${recipient}

#

# The Cyrus deliver program has changed incompatibly, multiple times.

#

old-cyrus unix  -       n       n       -       -       pipe

  flags=R user=cyrus argv=/usr/lib/cyrus/deliver -e -m ${extension} ${user}

# Cyrus 2.1.5 (Amos Gouaux)

# Also specify in main.cf: cyrus_destination_recipient_limit=1

cyrus     unix  -       n       n       -       -       pipe

  flags=hu user=cyrus argv=/usr/lib/cyrus/deliver -e -r ${sender} -m ${extension} ${user}

# Cyrus with "virtdomains: yes"

# Also specify in main.cf: virtual_transport = virt-cyrus

virt-cyrus     unix  -       n       n       -       -       pipe

  flags=hu user=cyrus argv=/usr/lib/cyrus/deliver -e -r ${sender} -m ${recipient} ${user}

#

# See the Postfix UUCP_README file for configuration details.

#

uucp      unix  -       n       n       -       -       pipe

  flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient)

#

# Other external delivery methods.

#

ifmail    unix  -       n       n       -       -       pipe

  flags=F user=ftn argv=/usr/lib/ifmail/ifmail -r $nexthop ($recipient)

bsmtp     unix  -       n       n       -       -       pipe

  flags=Fq. user=foo argv=/usr/local/sbin/bsmtp -f $sender $nexthop $recipient

```

----------

## fefeh

 *rgk wrote:*   

> thank you fefeh!
> 
> well to start it off when i telnet 25, its really short all i get is
> 
> ```
> ...

 

Are you sure postfix is running?  Do you see any errors in the log when you try to start it manually?

```

/etc/init.d/postfix start

```

Your configuration files are not too different from mine.  I don't use mysql so that is the main difference.

----------

## rgk

yeah postfix is running i jut did

```
208 ~ # /etc/init.d/postfix restart

 * Stopping postfix ...                                                   [ ok ]

 * Starting postfix ...                                                   [ ok ]

```

this may be a stupid question but i can't even find the postfix logs, i am looking in /var/log =/

----------

## elgato319

if you have syslog-ng installed all log messages go to /var/log/messages

to seperate everything mail related to another logfile you need to specify it in /etc/syslog-ng/syslog-ng.conf

do you have some kind of firewall installed on this machine?

"netstat -l -n" should contain something like:

```

tcp        0      0 0.0.0.0:25              0.0.0.0:*               LISTEN

```

----------

## fefeh

 *rgk wrote:*   

> yeah postfix is running i jut did
> 
> ```
> 208 ~ # /etc/init.d/postfix restart
> 
> ...

 

Mine are in /var/log/maillog  but that depends on your configuration in syslog

Do this: 

```

netstat -an | grep LISTEN

```

make sure that close to the top of that, you see this or something similar on port 25.

```

tcp        0      0 0.0.0.0:25              0.0.0.0:*               LISTEN

```

----------

## rgk

it does contain tcp        0      0 0.0.0.0:25              0.0.0.0:*               LISTEN

there is no firewall from what i understand installed on my server so i am not sure

it should be working but it just isn't, so i am stumped

i also have no /var/maillog is there any way i would active it? i have mysql, lighttpd but not maillog.

----------

## fefeh

 *rgk wrote:*   

> 
> 
> i also have no /var/maillog is there any way i would active it? i have mysql, lighttpd but not maillog.

 

What about /var/log/messages?

----------

## rgk

ah yes i do have /var/log/messages

its has tons of logs though, tons of people trying to hack into my ssh =P

----------

## magic919

This is often that newaliases command has not been run.

----------

## rgk

well one thing i had to change was in

```
Code Listing 4.2: Starting sasl

# nano -w /etc/sasl2/smtpd.conf

mech_list: PLAIN LOGIN

pwcheck_method: saslauthd

# nano -w /etc/conf.d/saslauthd

SASLAUTHD_OPTS="${SASLAUTH_MECH} -a rimap -r"

SASLAUTHD_OPTS="${SASLAUTHD_OPTS} -O localhost"

# /etc/init.d/saslauthd start

```

for that part i changed rimap to pam (the default in the file) because i couldn't get it to run with rimap, could that be causing any problems?

----------

## fefeh

 *rgk wrote:*   

> 
> 
> for that part i changed rimap to pam (the default in the file) because i couldn't get it to run with rimap, could that be causing any problems?

 

I don't think so because you are not getting to the authentication point I don't think.

Let's try taking out the mysql alias file right now and try it with the hash file, just in case.  In your /etc/postfix/main.cf replace your alias_maps with the following.  I didn't see an alias_database in your file, maybe that's an issue?  We can always change it back later.

```

alias_maps = hash:/etc/mail/aliases

alias_database = hash:/etc/mail/aliases

```

Make sure that file exists, if not I can post mine.

Then do: 

```

newaliases

/etc/init.d/postfix stop

/etc/init.d/postfix start

```

Then try the telnet localhost 25 again.

----------

## rgk

well it seemed to fix a little but telnet is still the same =/

```

208 ~ # nano /etc/postfix/main.cf

208 ~ # newaliases

postalias: fatal: unsupported map type: mysql

208 ~ # nano /etc/postfix/main.cf

208 ~ # cd /etc/mail

208 mail # ls

aliases  aliases.db

208 mail # nano aliases

208 mail # newaliases

208 mail # /etc/init.d/postfix start

 * WARNING:  postfix has already been started.

208 mail # /etc/init.d/postfix restart

 * Stopping postfix ...                                                                     [ ok ]

 * Starting postfix ...                                                                     [ ok ]

208 mail # telnet localhost 25

Trying 127.0.0.1...

Connected to localhost.

Escape character is '^]'.

```

should i change everything to hash files and skip mysql? ( i am sure the database is up i am using it for a few sites etc... so i doubt thats a problem but anything to get it up.)

----------

## fefeh

You know what, try the newaliases command again just to be sure it recognized the right file after you edited it.

Then do the stop/start or the postfix reload again to see if it made any difference.

This is strange.  I keep hoping someone smarter than me will come and bail both of us out   :Laughing:    Oh magic919...  :Wink: 

----------

## magic919

I wouldn't say I qualify as any smarter.

Here's what I'd do first.  Sort out the logging.  Postfix is great at telling you what is or isn't going on.  But you need to be able to see it.

Then you'll probably be able to get this sorted.

If the OP is using syslog-ng then a quick tweak will liberate separate logs.  Meanwhile a grep postfix /var/log/messages will prove it does log to the syslog and show the errors.

----------

## rgk

thanks for everyones help

i changed mynetworks = 208.100.2.87/24, 127.0.0.0/8 to mynetworks = localhost/24, 127.0.0.0/8

it seemed to fix a few things but it still has problems, now when i telnet it is looking for more then just a connection, here are the logs and the telnet.

```

Jun 29 19:48:55 208 postfix/trivial-rewrite[27528]: warning: connect to mysql server unix:/var/run/mysqld/mysqld.sock: Access denied for user 'mailsql'@'localhost' (using password: YES)

Jun 29 19:48:55 208 postfix/trivial-rewrite[27528]: fatal: mysql:/etc/postfix/mysql-virtual.cf(0,lock|fold_fix): table lookup problem

Jun 29 19:48:56 208 postfix/qmgr[27516]: warning: premature end-of-input on private/rewrite socket while reading input attribute name

Jun 29 19:48:56 208 postfix/qmgr[27516]: warning: problem talking to service rewrite: Success

Jun 29 19:48:56 208 postfix/master[27512]: warning: process /usr/lib/postfix/trivial-rewrite pid 27528 exit status 1

Jun 29 19:48:56 208 postfix/master[27512]: warning: /usr/lib/postfix/trivial-rewrite: bad command startup -- throttling

Jun 29 19:49:56 208 postfix/trivial-rewrite[27531]: warning: connect to mysql server unix:/var/run/mysqld/mysqld.sock: Access denied for user 'mailsql'@'localhost' (using password: YES)

Jun 29 19:49:56 208 postfix/trivial-rewrite[27531]: fatal: mysql:/etc/postfix/mysql-virtual.cf(0,lock|fold_fix): table lookup problem

Jun 29 19:49:57 208 postfix/qmgr[27516]: warning: premature end-of-input on private/rewrite socket while reading input attribute name

Jun 29 19:49:57 208 postfix/qmgr[27516]: warning: problem talking to service rewrite: Success

Jun 29 19:49:57 208 postfix/master[27512]: warning: process /usr/lib/postfix/trivial-rewrite pid 27531 exit status 1

Jun 29 19:49:57 208 postfix/master[27512]: warning: /usr/lib/postfix/trivial-rewrite: bad command startup -- throttling

Jun 29 19:50:57 208 postfix/trivial-rewrite[27547]: warning: connect to mysql server unix:/var/run/mysqld/mysqld.sock: Access denied for user 'mailsql'@'localhost' (using password: YES)

Jun 29 19:50:57 208 postfix/trivial-rewrite[27547]: fatal: mysql:/etc/postfix/mysql-virtual.cf(0,lock|fold_fix): table lookup problem

Jun 29 19:50:58 208 postfix/qmgr[27516]: warning: premature end-of-input on private/rewrite socket while reading input attribute name

Jun 29 19:50:58 208 postfix/qmgr[27516]: warning: problem talking to service rewrite: Success

Jun 29 19:50:58 208 postfix/master[27512]: warning: process /usr/lib/postfix/trivial-rewrite pid 27547 exit status 1

Jun 29 19:50:58 208 postfix/master[27512]: warning: /usr/lib/postfix/trivial-rewrite: bad command startup -- throttling

Jun 29 19:51:58 208 postfix/trivial-rewrite[27549]: warning: connect to mysql server unix:/var/run/mysqld/mysqld.sock: Access denied for user 'mailsql'@'localhost' (using password: YES)

Jun 29 19:51:58 208 postfix/trivial-rewrite[27549]: fatal: mysql:/etc/postfix/mysql-virtual.cf(0,lock|fold_fix): table lookup problem

Jun 29 19:51:59 208 postfix/qmgr[27516]: warning: premature end-of-input on private/rewrite socket while reading input attribute name

Jun 29 19:51:59 208 postfix/qmgr[27516]: warning: problem talking to service rewrite: Success

Jun 29 19:51:59 208 postfix/master[27512]: warning: process /usr/lib/postfix/trivial-rewrite pid 27549 exit status 1

Jun 29 19:51:59 208 postfix/master[27512]: warning: /usr/lib/postfix/trivial-rewrite: bad command startup -- throttling

Jun 29 19:52:59 208 postfix/trivial-rewrite[27551]: warning: connect to mysql server unix:/var/run/mysqld/mysqld.sock: Access denied for user 'mailsql'@'localhost' (using password: YES)

Jun 29 19:52:59 208 postfix/trivial-rewrite[27551]: fatal: mysql:/etc/postfix/mysql-virtual.cf(0,lock|fold_fix): table lookup problem

Jun 29 19:53:00 208 postfix/qmgr[27516]: warning: premature end-of-input on private/rewrite socket while reading input attribute name

Jun 29 19:53:00 208 postfix/qmgr[27516]: warning: problem talking to service rewrite: Success

Jun 29 19:53:00 208 postfix/master[27512]: warning: process /usr/lib/postfix/trivial-rewrite pid 27551 exit status 1

Jun 29 19:53:00 208 postfix/master[27512]: warning: /usr/lib/postfix/trivial-rewrite: bad command startup -- throttling

Jun 29 19:53:30 208 postfix/postfix-script: stopping the Postfix mail system

Jun 29 19:53:30 208 postfix/master[27512]: terminating on signal 15

Jun 29 19:53:30 208 postfix/postfix-script: starting the Postfix mail system

Jun 29 19:53:30 208 postfix/master[27657]: daemon started -- version 2.3.6, configuration /etc/postfix

Jun 29 19:53:30 208 postfix/qmgr[27659]: 094B372065A: from=<notice-return-8nxi8xwa4b5njjx@ga-mail.action.freepress.net>, size=15471, nrcpt=1 (queue active)

Jun 29 19:53:30 208 postfix/trivial-rewrite[27666]: warning: connect to mysql server unix:/var/run/mysqld/mysqld.sock: Access denied for user 'mailsql'@'localhost' (using password: YES)

Jun 29 19:53:30 208 postfix/trivial-rewrite[27666]: fatal: mysql:/etc/postfix/mysql-virtual.cf(0,lock|fold_fix): table lookup problem

Jun 29 19:53:31 208 postfix/qmgr[27659]: warning: premature end-of-input on private/rewrite socket while reading input attribute name

Jun 29 19:53:31 208 postfix/master[27657]: warning: process /usr/lib/postfix/trivial-rewrite pid 27666 exit status 1

Jun 29 19:53:31 208 postfix/master[27657]: warning: /usr/lib/postfix/trivial-rewrite: bad command startup -- throttling

208 ~ # telnet localhost 25

Trying 127.0.0.1...

Connected to localhost.

Escape character is '^]'.

220 mail.madgizmo.com ESMTP Postfix

^]

telnet> quit

Connection closed.

```

if that helps

it seems to be mysql problems now and it still doesn't connect   :Sad: 

----------

## magic919

It can't authenticate.

 *Quote:*   

> 
> 
> Jun 29 19:48:55 208 postfix/trivial-rewrite[27528]: warning: connect to mysql server unix:/var/run/mysqld/mysqld.sock: Access denied for user 'mailsql'@'localhost' (using password: YES) 
> 
> 

 

----------

## rgk

more things are working now, i fixed it i relized the password wasn't set correctly but

```

208 ~ # telnet localhost 25

Trying 127.0.0.1...

Connected to localhost.

Escape character is '^]'.

220 mail.madgizmo.com ESMTP Postfix

^]

telnet> quit

Connection closed.

```

it freezes there

i can't really find any errors from where i should work with now, i just reset postfix and all i get is

```

Jul  2 21:41:26 208 postfix/smtpd[20405]: disconnect from madgizmo.com[127.0.0.1]

Jul  2 21:44:26 208 postfix/postfix-script: stopping the Postfix mail system

Jul  2 21:44:26 208 postfix/master[18004]: terminating on signal 15

Jul  2 21:44:26 208 postfix/postfix-script: starting the Postfix mail system

Jul  2 21:44:26 208 postfix/master[20533]: daemon started -- version 2.3.6, configuration /etc/postfix

```

i do see some emails coming in so something is working, any ideas?

----------

## magic919

You say it freezes.  In response to what exactly?  Are you issuing an EHLO?

----------

## fefeh

 *rgk wrote:*   

> 
> 
> ```
> 
> 208 ~ # telnet localhost 25
> ...

 

It will freeze there until you enter something.  I'll post the part I did up there, but bold the user-input so you can see.

telnet 127.0.0.1 25

Trying 127.0.0.1...

Connected to 127.0.0.1.

Escape character is '^]'.

220 hostname.domain.com ESMTP Postfix

helo domain.com

250 hostname.domain.com

mail from: fefeh@domain.com

250 2.1.0 Ok

rcpt to: fefeh@domain.com

250 2.1.5 Ok

data

354 End data with <CR><LF>.<CR><LF>

aksjdfkalsdkfj

alksdjfkalsdjf

.

250 2.0.0 Ok: queued as 4782E63CE5

quit

221 2.0.0 Bye

Connection closed by foreign host. 

Hopefully that makes it a little more clear.  You're getting there.   :Very Happy: 

----------

## rgk

Thanks, it now works!

mail from: rgk@madgizmo.com

rcpt to: rgk@madgizmo.com

both do not work, i am guessing because i haven't set up mysql through phpmyadmin correctly but i tried and it still doesn't seem to be working, i looked at the guide and it really gave me no where to work with, anyone have an example i can use?

Thanks again though!

----------

## magic919

You shouldn't need to guess as the logs and a bit of MySQL should give you the answers.  However...

You need to make sure your MySQL queries run by Postfix match the DB you have created.

You can have a list of my Postfix set up and the queries run.

From main.cf

```

virtual_alias_maps = proxy:mysql:/etc/postfix/mysql_virtual_alias_maps.cf

virtual_gid_maps = static:207

virtual_mailbox_base = /var/vmail/

virtual_mailbox_domains = proxy:mysql:/etc/postfix/mysql_virtual_domains_maps.cf

virtual_mailbox_limit = 1024000000

virtual_mailbox_maps = proxy:mysql:/etc/postfix/mysql_virtual_mailbox_maps.cf

virtual_minimum_uid = 207

virtual_transport = virtual

virtual_uid_maps = static:207

```

Here are the queries:-

```

mysql_relay_domains_maps.cf:query = SELECT domain FROM domain WHERE domain='%s' and backupmx = '1'

mysql_virtual_alias_maps.cf:query = SELECT goto FROM alias WHERE address='%s'

mysql_virtual_domains_maps.cf:query = SELECT description FROM domain WHERE domain='%s'

mysql_virtual_mailbox_limit_maps.cf:query = SELECT quota FROM mailbox WHERE username='%s'

mysql_virtual_mailbox_maps.cf:query = SELECT maildir FROM mailbox WHERE username='%s'

```

----------

## rgk

i tried following but i have a few missing parts

virtual_mailbox_domains = mysql:/etc/postfix/mysql_virtual_domain_maps.cf

i don't have mysql_virtual_domain_maps.cf

and what would i put for local_recipient_maps = $alias_maps $virtual_mailbox_maps unix:passwd.byname?

thanks again =)

----------

## magic919

This is just a standard virtual schema from Postfixadmin.  You can follow it or not but you can't really mix and match.

You can just comment out that local recipient bit.

----------

## rgk

sorry for not replying sooner but,

magic919, i don't want postfixadmin at all, i would rather handle stuff from phpmyadmin i guess.

my question is:

error: Jul 13 16:07:51 208 postfix/trivial-rewrite[21846]: warning: do not list domain madgizmo.com in BOTH mydestination and virtual_mailbox_domains

what would i set virtual_mailbox_domains too?

i got some more logs too if anyone needs to see them, i seem to be getting errors and i am really have no clue what to do

http://paste2.org/p/4683

----------

## kashani

There are a few things going on here. 

1. virtual_mailbox_domains can not contain things that are in mydestination.

When building a virtual mail server it is best to specify a $myhostname and use that as $myorigin and in $mydestination. Any virtual domains need to be listed only in virtual domain places.

2. The Gentoo Virtual How-to sucks. 

By default you have list easy domain you want to be treated as virtual manually in your main.cf.

virtual_mailbox_domains = virtdomain1.com, virtdomain2.com

However you can let Mysql do the work for you with this line and also not have to restart Postfix every time you add a domain.

virtual_mailbox_domains = proxy:mysql:etc/postfix/mysql-transport.cf

kashani

----------

## rgk

the gentoo virtual how-to has caused some problems   :Confused: 

thanks i added

virtual_mailbox_domains = proxy:mysql:/etc/postfix/mysql-transport.cf

but what is the difference from "local" domains to virtual domains?

and how would i set up the db the correct way with phpmyadmin for each user and etc... like adding.

the how-to sort of skipped that and left very few examples in the default it gives.

----------

## kashani

*cough*

And that might be why I recommended using Postfixadmin way back at the beginning of this thread. I hate to say start over, but it's such a better management system and it is really worth it if you don't have much invested in your current system.

However once you get at least one domain, account, etc into your current system it shouldn't be that hard to manage. You pretty much copy the line from your transport table and clone it with the new domain. Same thing for the users and aliases. phpmyadmin should let you do that pretty easily once you set it up.

In regards to local vs virtual the transport table is normally a bit generic. In your case we're setting it to be only virtual so technically it shouldn't matter if we're setting local: or virtual: here. It might be better to use to following config line instead of the original I gave you so you can have local domains, but I won't guarantee it'll work since I haven't used the Gentoo how-to in a number of years. 

transport_maps = proxy:mysql:/etc/postfix/mysql-transport.cf 

If you do want to switch to Postfixadmin I can send you all my configs.

kashani

----------

## bobber205

Since the Virtual How-To Sucks, could you please recommend one that doesn't?  :Very Happy: 

----------

## rgk

kashani:

i have a few problems just as the guide before but a bit worse.

i do like postgres but i do not have it installed and would hate to waste room with it when i have mysql, and i don't use apache or webmin.

if anyone could help me set up my db, from what i understand that would be by best bet.

----------

## kashani

No need to use Postgres, Postfixadmin uses Mysql just fine. This is a how-to I occasionally revisit. It's pretty incomplete, but has all the settings and config files.

http://gentoo-wiki.com/HOWTO_Setup_a_Virtual_Postfix/Courier_Mail_System_with_PostfixAdmin

kashani

----------

## rgk

ok thanks, i am following that guide now   :Very Happy: 

popmail ~ # vi /etc/mail/aliases

what do i do for that part? add aliases how?

----------

## kashani

Fixed-ish. /etc/mail/aliases is going to be used for mail that is not virtual. Basically anything going to $hostname.$domain.com assuming that what you've set $myorigin and $myhostname to in your /etc/postfix/main.cf.

I'll see if I can think of a way to clarify all that in the quide.

kashani

----------

## rgk

kashani

i have followed your guide pretty much all of it, i have 2 questions though:

Could anything from the last guide screw anything up (yes i did re-emerge postfix and everything but i am still just wondering)?

What do I do about the DB? Do I use the same one from last guide? Or?

----------

## kashani

SO my guide pretty much stops at the Gentoo level and now you need to follow the INSTALL file from PostfixAdmin. Basically you'll need to

1. Import the postfixadmin.sql schema into Mysql. The Gentoo how-to schema will not work.

2. Configure config.inc.php in postfixadmin

and that's pretty much it. I can add some stuff to my wiki if you need more details.

kashani

----------

## rgk

i just got postfixadmin running, 

but i still don't really know what to do, i created a mailbox and still can't get it to work on kmail or anything, any how-to or such now?   :Embarassed: 

----------

