Postfix SMTP and Forwarding Issue

11 posts / 0 new
Last post
#1 Tue, 05/20/2008 - 22:32
dimpared

Postfix SMTP and Forwarding Issue

Hello,

I'm having an issue with Postfix not accepting SMTP connections (from Mail.app in OSX) and not forwarding emails when specified. Below is the output of "postconf -n" with my domain name changed to "example.com".

[code:1]alias_database = hash:/etc/aliases alias_maps = hash:/etc/aliases append_dot_mydomain = no biff = no broken_sasl_auth_clients = yes config_directory = /etc/postfix inet_protocols = all mailbox_size_limit = 0 mydestination = example.com, localhost.com, localhost myorigin = /etc/mailname readme_directory = no recipient_delimiter = + smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu) smtpd_recipient_restrictions = permit_mynetworks reject_unauth_destination permit_inet_interfaces permit_sasl_authenticated smtpd_sasl_auth_enable = yes smtpd_tls_cert_file = /etc/ssl/certs/ssl-cert-snakeoil.pem smtpd_tls_key_file = /etc/ssl/private/ssl-cert-snakeoil.key smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache smtpd_use_tls = yes virtual_alias_maps = hash:/etc/postfix/virtual[/code:1]

Any help would be greatly appreciated. I've been trying to get the email portion of the server up and running for quite some time. Everything else seems to be working great. I'm running Ubuntu 8.04 Server.<br><br>Post edited by: dimpared, at: 2008/05/20 22:32

Tue, 05/20/2008 - 23:37
Joe
Joe's picture

We need to see logs. The /var/log/mail.log is where errors during your attempts to send will show up. Show us those.

--

Check out the forum guidelines!

Wed, 05/21/2008 - 07:31 (Reply to #2)
dimpared

I did <b>not</b> use the install script, mostly because the binaries have not been compiled yet for Ubuntu 8.04 amd64, but also because I wanted a more tailored setup. I do have everything working beautifully except for this issue however. Is it possible that I need to make a modification to the /etc/default/saslauthd file to make it work as desired?

The output from running [code:1]postconf | grep -e mydestination -e virtual_alias_domains[/code:1] is

[code:1]mydestination = example.com, localhost.com, localhost
proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $virtual_mailbox_maps $virtual_mailbox_domains $relay_recipient_maps $relay_domains $canonical_maps $sender_canonical_maps $recipient_canonical_maps $relocated_maps $transport_maps $mynetworks
relay_domains = $mydestination
virtual_alias_domains = $virtual_alias_maps[/code:1]

if that helps with the other issue.

Wed, 05/21/2008 - 07:38 (Reply to #3)
Joe
Joe's picture

Oh, the other issue is unimportant. But, it's just that you've got &quot;example.com&quot; in your mydestination and also in your virtual alias maps file. You only want it in the virtual map file. However, if the hostname of your system is also example.com, that'll break delivery...so you probably want your system to be named something else, like ns1.example.com or primary.example.com or whatever.

The saslauthd thing...I don't remember where all of the configuration files are on Ubuntu. I have a script that jumps through all kinds of hoops to find them (they're different on almost every OS and version and architecture we support!).

It looks like you'll be probably looking for /etc/default/saslauthd and /etc/postifx/sasl/smtpd.conf

You need to see OPTIONS or PARAMS to &quot;-m /var/spool/postfix/var/run/saslauthd -r&quot; in the defaults file.

And, in the smtpd.conf file:

pwcheck_method: saslauthd
mech_list: plain login

I think that'll do it. Probably.

Oh, and of course you need to restart saslauthd after making the changes.

--

Check out the forum guidelines!

Wed, 05/21/2008 - 08:04 (Reply to #4)
dimpared

The problem has been resolved, thanks for all your help. In the long run, I ended up just following the Postfix portion of the tutorial at http://www.howtoforge.com/perfect-server-ubuntu8.04-lts-p5 , which incorporated what you had suggested as well. I'm now up and running! Thanks again.

Wed, 05/21/2008 - 06:41
dimpared

Joe,

The email forwarding works now all of a sudden, which is weird because I made no changes since last night that I know of. The SMTP authentication still occurs though. Below is the contents of /var/log/mail.log which was truncated before trying to connect via SMTP and send a mail for forwarding, respectively.

[code:1]May 21 15:27:07 example dovecot: imap-login: Login: user=&lt;username&gt;, method=PLAIN, rip=xxx.xxx.xxx.xxx, lip=xxx.xxx.xxx.xxx, TLS
May 21 15:27:07 example dovecot: IMAP(username): Disconnected: Logged out
May 21 15:27:15 example postfix/smtpd[9057]: connect from xxx.xxx.xxx.xxx.xxx.xxx.xxx.com[xxx.xxx.xxx.xxx]
May 21 15:27:16 example postfix/smtpd[9057]: warning: SASL authentication problem: unable to open Berkeley db /etc/sasldb2: No such file or directory
May 21 15:27:16 example postfix/smtpd[9057]: warning: SASL authentication problem: unable to open Berkeley db /etc/sasldb2: No such file or directory
May 21 15:27:16 example postfix/smtpd[9057]: warning: SASL authentication failure: Password verification failed
May 21 15:27:16 example postfix/smtpd[9057]: warning: xxx.xxx.xxx.xxx.xxx.xxx.xxx.com[xxx.xxx.xxx.xxx]: SASL PLAIN authentication failed: authentication failure
May 21 15:27:16 example postfix/smtpd[9057]: disconnect from xxx.xxx.xxx.xxx.xxx.xxx.xxx.com[xxx.xxx.xxx.xxx]
May 21 15:27:16 example postfix/smtpd[9057]: connect from xxx.xxx.xxx.xxx.xxx.xxx.xxx.com[xxx.xxx.xxx.xxx]
May 21 15:27:16 example postfix/smtpd[9057]: warning: SASL authentication problem: unable to open Berkeley db /etc/sasldb2: No such file or directory
May 21 15:27:16 example postfix/smtpd[9057]: warning: SASL authentication problem: unable to open Berkeley db /etc/sasldb2: No such file or directory
May 21 15:27:16 example postfix/smtpd[9057]: warning: SASL authentication failure: no secret in database
May 21 15:27:16 example postfix/smtpd[9057]: warning: xxx.xxx.xxx.xxx.xxx.xxx.xxx.com[xxx.xxx.xxx.xxx]: SASL CRAM-MD5 authentication failed: authentication failure
May 21 15:27:16 example postfix/smtpd[9057]: disconnect from xxx.xxx.xxx.xxx.xxx.xxx.xxx.com[xxx.xxx.xxx.xxx]
May 21 15:27:16 example postfix/smtpd[9057]: connect from xxx.xxx.xxx.xxx.xxx.xxx.xxx.com[xxx.xxx.xxx.xxx]
May 21 15:27:17 example postfix/smtpd[9057]: warning: SASL authentication problem: unable to open Berkeley db /etc/sasldb2: No such file or directory
May 21 15:27:17 example postfix/smtpd[9057]: warning: SASL authentication failure: no secret in database
May 21 15:27:17 example postfix/smtpd[9057]: warning: xxx.xxx.xxx.xxx.xxx.xxx.xxx.com[xxx.xxx.xxx.xxx]: SASL NTLM authentication failed: authentication failure
May 21 15:27:17 example postfix/smtpd[9057]: disconnect from xxx.xxx.xxx.xxx.xxx.xxx.xxx.com[xxx.xxx.xxx.xxx]
May 21 15:29:07 example postfix/smtpd[9092]: connect from el-out-1112.google.com[209.85.162.181]
May 21 15:29:08 example postfix/trivial-rewrite[9094]: warning: do not list domain example.com in BOTH mydestination and virtual_alias_domains
May 21 15:29:08 example postfix/smtpd[9092]: 042DE3895A: client=el-out-1112.google.com[209.85.162.181]
May 21 15:29:08 example postfix/cleanup[9095]: 042DE3895A: message-id=&lt;8C7D26FD-BC7B-4453-AF79-4FC0D2215FF2@gmail.com&gt;
May 21 15:29:08 example postfix/qmgr[3557]: 042DE3895A: from=&lt;username@gmail.com&gt;, size=1933, nrcpt=1 (queue active)
May 21 15:29:08 example postfix/trivial-rewrite[9094]: warning: do not list domain example.com in BOTH mydestination and virtual_alias_domains
May 21 15:29:08 example postfix/trivial-rewrite[9094]: warning: do not list domain example.com in BOTH mydestination and virtual_alias_domains
May 21 15:29:08 example postfix/local[9096]: 042DE3895A: to=&lt;username@example.com&gt;, relay=local, delay=0.22, delays=0.18/0.01/0/0.02, dsn=2.0.0, status=sent (delivered to mailbox)
May 21 15:29:08 example postfix/cleanup[9095]: 256EC3895C: message-id=&lt;8C7D26FD-BC7B-4453-AF79-4FC0D2215FF2@gmail.com&gt;
May 21 15:29:08 example postfix/qmgr[3557]: 256EC3895C: from=&lt;username@gmail.com&gt;, size=2075, nrcpt=1 (queue active)
May 21 15:29:08 example postfix/local[9096]: 042DE3895A: to=&lt;username@example.com&gt;, relay=local, delay=0.23, delays=0.18/0.01/0/0.03, dsn=2.0.0, status=sent (forwarded as 256EC3895C)
May 21 15:29:08 example postfix/qmgr[3557]: 042DE3895A: removed
May 21 15:29:09 example postfix/smtp[9097]: 256EC3895C: to=&lt;username@gmail.com&gt;, orig_to=&lt;username@example.com&gt;, relay=gmail-smtp-in.l.google.com[74.125.45.114]:25, delay=1.6, delays=0.03/0.01/0.16/1.4, dsn=2.0.0, status=sent (250 2.0.0 OK 1211383749 4si2756987yxd.2)
May 21 15:29:09 example postfix/qmgr[3557]: 256EC3895C: removed
May 21 15:29:38 example postfix/smtpd[9092]: disconnect from el-out-1112.google.com[209.85.162.181]
[/code:1]

To me, it appears that the relevant parts are as follows, but am not really sure how to fix them.

[code:1]warning: SASL authentication problem: unable to open Berkeley db /etc/sasldb2: No such file or directory
warning: do not list domain example.com in BOTH mydestination and virtual_alias_domains
[/code:1]

Wed, 05/21/2008 - 07:14 (Reply to #6)
Joe
Joe's picture

<div class='quote'>warning: SASL authentication problem: unable to open Berkeley db /etc/sasldb2: No such file or directory</div>

This is the relevant one.

saslauthd isn't configured to use the local password database, and possibly not to use sane authentication types for that password database.

You haven't mentioned if this box was installed using our install.sh automated install script? If so, Ubuntu must have changed something that silently breaks our configuration of saslauthd. I'll have to dig in and see what. I believe I have heard from someone else that they'd also had problems with saslauthd...so this is seeming the likely cause.

There's a FAQ about saslauthd, but it primarily covers Red Hat based systems (no Debian-based systems were supported by the installer before I had finished automating the process, I think, so it didn't need to be documented).

Anyway, I'll see if I can figure out where the saslauthd configuration files have gotten to on Ubuntu 8.04.

--

Check out the forum guidelines!

Wed, 05/21/2008 - 07:12
lotek

Ok. I'm no guru, but here's what appear to be the problems based on what you think is the problem.

You need to create the sasldb2 file. You can't just sudo touch it, though. It needs information. First check to see if there's a sasldb2 file in /etc/:
[code:1]
ls /etc/ | grep sasl
[/code:1]
If not, you're good. If there is... well frankly I don't know. I'd say just move it to a new file name like sasldb2.bak and start new, but that's me. Now run:
[code:1]
sudo saslpasswd2 -c -u mail.example.com -a smtpauth username
[/code:1]
more info on saslpasswd can be found in the man pages
[code:1]
man saslpasswd2
[/code:1]
now you need to change the permissions for that file or rather the owner of it:
[code:1]
sudo chown postfix sasldb2
[/code:1]
Now if you run this:
[code:1]
sudo sasldblistusers2
[/code:1]
You should see the user you just created.

That *SHOULD* fix your first problem. Again. Not a guru.

For your second problem run this:
[code:1]
postconf | grep -e mydestination -e virtual_alias_domains
[/code:1]
and post the output. I hope this helps a bit.

I'm not real familiar with postfix or emails in general, so most everything I just got I got from the manpages, postfix.org or just winging it. I also don't have any experience with virtualmin (I'm still trying to get it configured right) so most everything I know is command line based. Again, HTH.

Wed, 05/21/2008 - 07:16 (Reply to #8)
Joe
Joe's picture

BTW-Lotek, you're chasing down the wrong path for a system like Virtualmin manages.

You do not want a sasldb at all. You want saslauthd to authenticate to the system passwd database via shadow (or maybe PAM).

--

Check out the forum guidelines!

Wed, 05/21/2008 - 07:45
lotek

Got it. Well, sorry to have clogged up the post then. Like I said, I am no guru on this. I had wondered whether or not virtualmin handled this or not. Good Luck.

Wed, 05/21/2008 - 08:09 (Reply to #10)
Joe
Joe's picture

Hey Lotek,

Your advice would be correct for many types of deployment...just not the kind Virtualmin manages. ;-)

Dimpared,

Great to hear you got it straightened out. I'm working on significant additions to the documentation on the subject of installations that don't use install.sh (though Ubuntu 8.04 should be fully supported now in the install script, and for most folks that's the fastest way to get everything right).

--

Check out the forum guidelines!

Topic locked