Before I forget... because it freaked the shit out of me and made me think I broke the postfixadmin database.
When you create a domain in Postfixadmin, that's all fine and dandy. But when you create Mailboxes or Alias in this domain, postfixadmin performs a nameserver lookup only at THIS point in time to check the domain is valid. The helpful response is:
"The EMAIL is not valid!" (for mailbox), or "The ALIAS is not valid!".
In fact, what it means is that the domain is not valid, so this is quite misleading. So don't panic!
I thought I broke things, but all that had happened was that for this particular subdomain, while I had created an MX record for it in the zone, I hadn't reloaded DNS yet, and so a nameserver lookup was failing.
You could wait for DNS propagation (still don't understand why it wasn't almost instant, mail server was also the primary NS), or a quick getaround is to change
$CONF['emailcheck_resolve_domain']='YES';
to
$CONF['emailcheck_resolve_domain']='NO';
In the config.inc.php of postfixadmin, and it'll skip the nameserver lookup.
Phew.
Be wary when you upgrade Debian Lenny server to 5.0.1 and you use Postfix & Dovecot with a PostgreSQL backend and PostgreSQL-8.3 gets upgraded and restarts itself. My Dovecot stopped being able to connect to the database to authenticate my login requests from Thunderbird all
of a sudden with the error 'you have enabled secure authentication and this server does not support it'.
I knew I hadn't changed any Dovecot settings on how I authenticate my IMAP session so assumed it was the PostgreSQL upgrade, though PostgreSQL was running fine.
This in the dovecot logs
dovecot: 2009-04-13 10:38:15 Error: auth(default): sql(<a href="mailto:example@some--address.com">example@some--address.com</a>),): Password query failed: FATAL: terminating connection due to administrator command
dovecot: 2009-04-13 10:38:15 Error: auth(default): io_loop_handle_remove: epoll_ctl(2, 9): Bad file descriptor
I restarted Dovecot, and Postfix just to be sure :) and all is back to normal. I'm assuming it was Dovecot holding a stale connection open to PostgreSQL, and not the MTA, as it wasn't a problem with delivering mail (though it might've posed a problem for Postfix too, but didn't let it hang around long enough to find out)
I wonder, I know that some packages like openssl and whatnot, are able to check what other services are running that depend on it when it's upgraded, and offer a postinst (I assume) ncurses notification telling the user that some services should be restarted. PostgreSQL should have a similar check to see if it's being used for a vhost mail setup.
Coz I always forget them!
http://www.fots.nl/index.php/ndr-and-smtp-reply-and-error-codes/
Login process creation
login_processes_count and login_max_processes_count setting control how new login processes are created. login_processes_count specifies the number of login processes that are tried to be kept listening for new connections. However when a lot of connections arrive at the same
time this number will increase automatically as described below.
To prevent fork-bombing Dovecot's login process creation works in a similiar way to Apache: Initially set "wanted listening process count" to same as login_processes_count and start the processes. Then check every second if we need to start up new processes to keep the listening
process count the same as the wanted count. If all the listening processes have been used, double the wanted count. If we haven't used all of them, decrease the wanted count by one (unless it goes below login_processes_count), but don't destroy already created processes.
login_max_processes_count specifies the maximum number of login processes there can exist at a time (listening, non-listening and SSL/TLS-proxying processes combined).
Didn't know you could do this.. both the ability to specify individuals rather than whole domains, and the retry: logic.
In the transport map
< user >@< destination.com > retry:4.0.0 Temporarily suspended
I was migrating my mail server to a new machine the other day and in the process, I sorted out my smtp/sasl logic.
I'm using virtual domains/mailboxes/aliases with Postfix, PostfixAdmin and Postgresql on Debian servers, works like a charm, but my sasl config was such that it wasn't using the same postfix database for password lookups and I was having to use saslpasswd2 to add accounts so that I could send mail using this server for SMTP as it was using its own sasldb or whatever.
Madness.
This time I've implemented Dovecot's SASL mechanism, it reduced double-up and means the authentication is done via the database in the same way that logging in to *retrieve* mail was being performed (as far as I understand it anyway. I'm not a mailserver guru).
All I changed was in /etc/dovecot/dovecot.conf
# It's possible to export the authentication interface to other programs:
socket listen {
client {
path = /var/spool/postfix/private/auth-client
mode = 0660 user = postfix group = postfix
}
}
And in /etc/postfix/main.cf
smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth-client
smtpd_sasl_auth_enable = yes
broken_sasl_auth_clients = yes
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated,
reject_unauth_destination
Other than following the steps outlined in the INSTALL.txt file of Virtual Vacation’s directory in postfix admin, I had to do these to make it work properly as well:
Added
vacation_destination_recipient_limit = 1
to /etc/postfix/main.cf
At this point things work, so long as your recipient who's on holidays is not a member of any virtual aliases (ie he or she doesn't receive mail sent to generic addresses like info@ or help@).
If they do, you'll soon notice a heap of 'permission denied' errors being spat back either as a bounce or in mail.log, syslog, and the vacation-debug log. This is because the vacation user doesn't have access to select from the alias table in your postfix database.
To fix, you need to grant this privilege to the vacation user with an SQL query:
GRANT SELECT ON TABLE alias TO vacation;
All fixed, now email sent to an alias will send back a vacation auto-reply as well.
Making vacation autoresponder in Debian
Make the .forward file in user's home directory:
\<a href="mailto:user@email.com">user@email.com</a>
"|/usr/bin/vacation user"
Make the .vacation.msg in user's home directory:
From: <a href="mailto:user@email.com">user@email.com</a> (Joe Bloggs)
Subject: I am on Annual Leave
Delivered-By-The-Graces-Of: The Vacation program
Precedence: bulk
E-mail message goes here
cd out of the user's home directory to /home and run:
vacation -i user && chmod 644 user/.vacation.db && chown user:user user/.vacation.db