mail relay issue, bad recipient address syntax

A simple way to test whether postfix consults your aliases file(s), add something like this to "/etc/mail/aliases"
Code:
forum:  xxx, yyy@gmail.com
Replace "xxx" with the user account you have on the box and change 'yyy' into the name of your gmail account.
After editing run newaliases to update the /etc/mail/aliases.db file.

Now from the command line do something like this:
Code:
$ echo A test message from xxx | mail -s 'Test' forum
Postfix should now mail to your user account "xxx" and to the "yyy@gmail.com" account. Check the mail logs and the "xxx" mailbox and the gmail account for arrival of this mail.

If you can get this to work then you will have completed another step in the right direction ;)
 
Thanks J65 and also Dutch!

I received the email... so that means that my /etc/mail/aliases file is connected to postfix.

That is a real good thing...

Now why can't I seem to get the other aliases in their working.

funny thing is...
the user account i have on the box is root@host.local.domain

I'm thinking this is obviously the problem.

Before I got on another adventure of FreeBSD...any suggestions?

I'm loving you guys right now.

In a bro way
 
Yes, mail arrived in var/mail/root

/var/mail/root has the mail and so does my gmail-i believe that means it passed the test. Are there any outputs or files I should post to help in anyway?
 
Yes, that means the data in /etc/mail/aliases.db has been consulted and subsequently used by postfix.

Could you post the the mailmain stuff from /etc/mail/aliases aliases?
 
thanks man

Code:
# This file is generated by Mailman, and is kept in sync with the
# binary hash file aliases.db.  YOU SHOULD NOT MANUALLY EDIT THIS FILE
# unless you know what you're doing, and can keep the two files properly
# in sync.  If you screw it up, you're on your own.

# The ultimate loop stopper address
mailman-loop: /usr/local/mailman/data/owner-bounces.mbox
forum:  [snip]
# STANZA START: sometime
# CREATED: Sun Dec 13 07:05:58 2009
sometime:             "|/usr/local/mailman/mail/mailman post sometime"
sometime-admin:       "|/usr/local/mailman/mail/mailman admin sometime"
sometime-bounces:     "|/usr/local/mailman/mail/mailman bounces sometime"
sometime-confirm:     "|/usr/local/mailman/mail/mailman confirm sometime"
sometime-join:        "|/usr/local/mailman/mail/mailman join sometime"
sometime-leave:       "|/usr/local/mailman/mail/mailman leave sometime"
sometime-owner:       "|/usr/local/mailman/mail/mailman owner sometime"
sometime-request:     "|/usr/local/mailman/mail/mailman request sometime"
sometime-subscribe:   "|/usr/local/mailman/mail/mailman subscribe sometime"
sometime-unsubscribe: "|/usr/local/mailman/mail/mailman unsubscribe sometime"
# STANZA END: sometime

# STANZA START: working
# CREATED: Sun Dec 13 07:05:59 2009
working:             "|/usr/local/mailman/mail/mailman post working"
working-admin:       "|/usr/local/mailman/mail/mailman admin working"
working-bounces:     "|/usr/local/mailman/mail/mailman bounces working"
working-confirm:     "|/usr/local/mailman/mail/mailman confirm working"
working-join:        "|/usr/local/mailman/mail/mailman join working"
working-leave:       "|/usr/local/mailman/mail/mailman leave working"
working-owner:       "|/usr/local/mailman/mail/mailman owner working"
working-request:     "|/usr/local/mailman/mail/mailman request working"
working-subscribe:   "|/usr/local/mailman/mail/mailman subscribe working"
working-unsubscribe: "|/usr/local/mailman/mail/mailman unsubscribe working"
# STANZA END: working

# STANZA START: plenty
# CREATED: Sun Dec 13 07:06:00 2009
plenty:             "|/usr/local/mailman/mail/mailman post plenty"
plenty-admin:       "|/usr/local/mailman/mail/mailman admin plenty"
plenty-bounces:     "|/usr/local/mailman/mail/mailman bounces plenty"
plenty-confirm:     "|/usr/local/mailman/mail/mailman confirm plenty"
plenty-join:        "|/usr/local/mailman/mail/mailman join plenty"
plenty-leave:       "|/usr/local/mailman/mail/mailman leave plenty"
plenty-owner:       "|/usr/local/mailman/mail/mailman owner plenty"
plenty-request:     "|/usr/local/mailman/mail/mailman request plenty"
plenty-subscribe:   "|/usr/local/mailman/mail/mailman subscribe plenty"
plenty-unsubscribe: "|/usr/local/mailman/mail/mailman unsubscribe plenty"
# STANZA END: plenty

# STANZA START: tgif
# CREATED: Sun Dec 13 07:06:01 2009
tgif:             "|/usr/local/mailman/mail/mailman post tgif"
tgif-admin:       "|/usr/local/mailman/mail/mailman admin tgif"
tgif-bounces:     "|/usr/local/mailman/mail/mailman bounces tgif"
tgif-confirm:     "|/usr/local/mailman/mail/mailman confirm tgif"
tgif-join:        "|/usr/local/mailman/mail/mailman join tgif"
tgif-leave:       "|/usr/local/mailman/mail/mailman leave tgif"
tgif-owner:       "|/usr/local/mailman/mail/mailman owner tgif"
tgif-request:     "|/usr/local/mailman/mail/mailman request tgif"
tgif-subscribe:   "|/usr/local/mailman/mail/mailman subscribe tgif"
tgif-unsubscribe: "|/usr/local/mailman/mail/mailman unsubscribe tgif"
# STANZA END: tgif

# STANZA START: testformail
# CREATED: Sun Dec 13 07:06:02 2009
testformail:             "|/usr/local/mailman/mail/mailman post testformail"
testformail-admin:       "|/usr/local/mailman/mail/mailman admin testformail"
testformail-bounces:     "|/usr/local/mailman/mail/mailman bounces testformail"
testformail-confirm:     "|/usr/local/mailman/mail/mailman confirm testformail"
testformail-join:        "|/usr/local/mailman/mail/mailman join testformail"
testformail-leave:       "|/usr/local/mailman/mail/mailman leave testformail"
testformail-owner:       "|/usr/local/mailman/mail/mailman owner testformail"
testformail-request:     "|/usr/local/mailman/mail/mailman request testformail"
testformail-subscribe:   "|/usr/local/mailman/mail/mailman subscribe testformail"
testformail-unsubscribe: "|/usr/local/mailman/mail/mailman unsubscribe testformail"
# STANZA END: testformail

# STANZA START: fritest
# CREATED: Sun Dec 13 07:06:03 2009
fritest:             "|/usr/local/mailman/mail/mailman post fritest"
fritest-admin:       "|/usr/local/mailman/mail/mailman admin fritest"
fritest-bounces:     "|/usr/local/mailman/mail/mailman bounces fritest"
fritest-confirm:     "|/usr/local/mailman/mail/mailman confirm fritest"
fritest-join:        "|/usr/local/mailman/mail/mailman join fritest"
fritest-leave:       "|/usr/local/mailman/mail/mailman leave fritest"
fritest-owner:       "|/usr/local/mailman/mail/mailman owner fritest"
fritest-request:     "|/usr/local/mailman/mail/mailman request fritest"
fritest-subscribe:   "|/usr/local/mailman/mail/mailman subscribe fritest"
fritest-unsubscribe: "|/usr/local/mailman/mail/mailman unsubscribe fritest"
# STANZA END: fritest

# STANZA START: 910test
# CREATED: Sun Dec 13 07:06:04 2009
910test:             "|/usr/local/mailman/mail/mailman post 910test"
910test-admin:       "|/usr/local/mailman/mail/mailman admin 910test"
910test-bounces:     "|/usr/local/mailman/mail/mailman bounces 910test"
910test-confirm:     "|/usr/local/mailman/mail/mailman confirm 910test"
910test-join:        "|/usr/local/mailman/mail/mailman join 910test"
910test-leave:       "|/usr/local/mailman/mail/mailman leave 910test"
910test-owner:       "|/usr/local/mailman/mail/mailman owner 910test"
910test-request:     "|/usr/local/mailman/mail/mailman request 910test"
910test-subscribe:   "|/usr/local/mailman/mail/mailman subscribe 910test"
910test-unsubscribe: "|/usr/local/mailman/mail/mailman unsubscribe 910test"
# STANZA END: 910test

# STANZA START: 914test
# CREATED: Sun Dec 13 07:06:06 2009
914test:             "|/usr/local/mailman/mail/mailman post 914test"
914test-admin:       "|/usr/local/mailman/mail/mailman admin 914test"
914test-bounces:     "|/usr/local/mailman/mail/mailman bounces 914test"
914test-confirm:     "|/usr/local/mailman/mail/mailman confirm 914test"
914test-join:        "|/usr/local/mailman/mail/mailman join 914test"
914test-leave:       "|/usr/local/mailman/mail/mailman leave 914test"
914test-owner:       "|/usr/local/mailman/mail/mailman owner 914test"
914test-request:     "|/usr/local/mailman/mail/mailman request 914test"
914test-subscribe:   "|/usr/local/mailman/mail/mailman subscribe 914test"
914test-unsubscribe: "|/usr/local/mailman/mail/mailman unsubscribe 914test"
# STANZA END: 914test

# STANZA START: 917test
# CREATED: Sun Dec 13 07:06:06 2009
917test:             "|/usr/local/mailman/mail/mailman post 917test"
917test-admin:       "|/usr/local/mailman/mail/mailman admin 917test"
917test-bounces:     "|/usr/local/mailman/mail/mailman bounces 917test"
917test-confirm:     "|/usr/local/mailman/mail/mailman confirm 917test"
917test-join:        "|/usr/local/mailman/mail/mailman join 917test"
917test-leave:       "|/usr/local/mailman/mail/mailman leave 917test"
917test-owner:       "|/usr/local/mailman/mail/mailman owner 917test"
917test-request:     "|/usr/local/mailman/mail/mailman request 917test"
917test-subscribe:   "|/usr/local/mailman/mail/mailman subscribe 917test"
917test-unsubscribe: "|/usr/local/mailman/mail/mailman unsubscribe 917test"
# STANZA END: 917test

# STANZA START: mailman
# CREATED: Sun Dec 13 07:06:08 2009
mailman:             "|/usr/local/mailman/mail/mailman post mailman"
mailman-admin:       "|/usr/local/mailman/mail/mailman admin mailman"
mailman-bounces:     "|/usr/local/mailman/mail/mailman bounces mailman"
mailman-confirm:     "|/usr/local/mailman/mail/mailman confirm mailman"
mailman-join:        "|/usr/local/mailman/mail/mailman join mailman"
mailman-leave:       "|/usr/local/mailman/mail/mailman leave mailman"
mailman-owner:       "|/usr/local/mailman/mail/mailman owner mailman"
mailman-request:     "|/usr/local/mailman/mail/mailman request mailman"
mailman-subscribe:   "|/usr/local/mailman/mail/mailman subscribe mailman"
mailman-unsubscribe: "|/usr/local/mailman/mail/mailman unsubscribe mailman"
# STANZA END: mailman
 
Next step is check you can manually mail a message to the list, by using invoking mailman manually:

Code:
#!/bin/sh

#cat <<END | sed -e 's/hercules/zeus/'g

cat <<END [color=blue]| /usr/local/mailman/mail/mailman post sometime[/color]
Received: from hercules.utp.xnet (localhost.utp.xnet [127.0.0.1])
        by hercules.utp.xnet (8.14.1/8.14.1) with ESMTP id nBG28hg7028245
        for <forum@hercules.utp.xnet>; Wed, 16 Dec 2009 03:08:43 +0100 (CET)
Received: (from j65nko@localhost)
        by hercules.utp.xnet (8.14.1/8.14.1/Submit) id nBG28hro001272
        for forum; Wed, 16 Dec 2009 03:08:43 +0100 (CET)
Date: Wed, 16 Dec 2009 03:08:43 +0100 (CET)
From: j65nko@hercules.utp.xnet
Message-Id: <200912160208.nBG28hro001272@hercules.utp.xnet>
To: sometime 
Subject: Test

A test message posted to the mailman 'sometime' list
bla, bla

END
Download this file and execute it with sh mailman-test.txt

The 'cat' command will output everything in the file till the endmarker 'END' to standard output, then it will be piped, the '|' symbol, through the mailman invocation to post a message to the list.
The "/usr/local/mailman/mail/mailman post" will receive this message on standard input and should process it.

This is equivalent to what postfix would do when it receives a message addressed to 'sometime@yourhostname'

After this check whether the message shows up in the 'sometime' mailing list archive.
 

Attachments

  • mailman-test.txt
    721 bytes · Views: 197
cat output

This output surprised me! It's an obvious problem. I'm certain I set the group as mailman...and I never set any group as wheel. You rock for helping me with this. How should I go about tweaking the mail server...I'm assuming I'd just set it to mailman instead of to wheel.

Code:
deds1124# sh /usr/home/user1/ty/mailman-test.txt
Group mismatch error.  Mailman expected the mail
wrapper script to be executed as group "mailman", but
the system's mail server executed the mail script as
group "wheel".  Try tweaking the mail server to run the
script as group "mailman", or re-run configure, 
providing the command line option `--with-mail-gid=wheel'.
 
Does it help if you use
Code:
su mailman -c 'sh mailman-test.txt'
That way you will exeucte the script with the UID and hopefully the Group ID of mailman. See the 'su' man page.
 
This was the output of that
Code:
deds1124# su mailman -c 'sh /usr/home/user1/ty/mailman-test.txt
Unmatched '.
 
Code:
su mailman -c 'sh /usr/home/user1/ty/mailman-test.txt'
-----------------------------------------------------^
Your pasted command shows a missing single quote.

The '-c' option is for the shell and because the command passed consists of multiple words, the command needs a quote at the start and at the end ;)

BTW what are the permissions of the mailman binary in 'usr/local/mailman/mail/mailman' ?
 
Here it is! :)

Code:
deds1124# su mailman -c 'sh /usr/home/user1/ty/mailman-test.txt'
This account is currently not available.


deds1124# /usr/sbin/sendmail -bv sometime
Mail Delivery Status Report will be mailed to <root>.


I hope this helps..

I owe you a drink or twenty for this!
 
hth (setgid)

Code:
-rwxr-sr-x  1 root  mailman  15854 Nov 19 18:22 /usr/local/mailman/mail/mailman
 
tynelson said:
Code:
deds1124# su mailman -c 'sh /usr/home/user1/ty/mailman-test.txt'
This account is currently not available.
The mailman-test.txt script attempts to do a direct delivery to "| /usr/local/mailman/mail/mailman post sometime" and it seems to fail. Do you see anything about this in either the mailman or postfix logs.

Code:
deds1124# /usr/sbin/sendmail -bv sometime
Mail Delivery Status Report will be mailed to <root>.
Could you post this Mail Delivery Status Report?
See http://www.postfix.org/ADDRESS_REWRITING_README.html#debugging

Another request: What is the contents of /etc/mail/mailer.conf See mailer.conf(5).
 
tynelson said:
I should put all of that in the command line?

He asks whether the owner and group of '/usr/local/mailman/mail/mailman' are 'root' and 'mailman' like he posted.And not 'root' and 'wheel' like the error message seems to indicate ;)

The following will tell you if there is a 'mailman' group, and which members it has:
Code:
# grep mailman /etc/group
 
thanks again

That's the mailer.conf info
Code:
#
# Execute the Postfix sendmail program, named /usr/local/sbin/sendmail
#
sendmail	/usr/local/sbin/sendmail
send-mail	/usr/local/sbin/sendmail
mailq	/usr/local/sbin/sendmail
newaliases	/usr/local/sbin/sendmail

The search for mailman user output was
Code:
deds1124# grep mailman /etc/group
mailman:*:91:
 
The mailer.conf shows that Postfix has been installed.
Have you checked in "/var/mail/root" for the /usr/sbin/sendmail -bv sometime message?

We still have to see the result of ls -l /usr/local/mailman/mail/mailman ;)
 
Here's the prize!

This should be it :)

Code:
From MAILER-DAEMON  Thu Dec 17 09:31:39 2009
Return-Path: <>
X-Original-To: root@deds1124.i2bnetworks.com
Delivered-To: root@deds1124.i2bnetworks.com
Received: by deds1124.i2bnetworks.com (Postfix)
	id 7784C39F1A; Thu, 17 Dec 2009 09:31:39 -0800 (PST)
Date: Thu, 17 Dec 2009 09:31:39 -0800 (PST)
From: MAILER-DAEMON@deds1124.i2bnetworks.com (Mail Delivery System)
Subject: Mail Delivery Status Report
To: root@deds1124.i2bnetworks.com
Auto-Submitted: auto-replied
MIME-Version: 1.0
Content-Type: multipart/report; report-type=delivery-status;
	boundary="7654839F12.1261071099/deds1124.i2bnetworks.com"
Message-Id: <20091217173139.7784C39F1A@deds1124.i2bnetworks.com>

This is a MIME-encapsulated message.

--7654839F12.1261071099/deds1124.i2bnetworks.com
Content-Description: Notification
Content-Type: text/plain; charset=us-ascii

This is the mail system at host deds1124.i2bnetworks.com.

Enclosed is the mail delivery report that you requested.

                   The mail system

<sometime@deds1124.i2bnetworks.com> (expanded from <sometime>): delivery via
    local: delivers to command: /usr/local/mailman/mail/mailman post sometime

--7654839F12.1261071099/deds1124.i2bnetworks.com
Content-Description: Delivery report
Content-Type: message/delivery-status

Reporting-MTA: dns; deds1124.i2bnetworks.com
X-Postfix-Queue-ID: 7654839F12
X-Postfix-Sender: rfc822; root@deds1124.i2bnetworks.com
Arrival-Date: Thu, 17 Dec 2009 09:31:39 -0800 (PST)

Final-Recipient: rfc822; sometime@deds1124.i2bnetworks.com
Original-Recipient: rfc822; sometime
Action: deliverable
Status: 2.0.0
Diagnostic-Code: X-Postfix; delivery via local: delivers to command:
    /usr/local/mailman/mail/mailman post sometime

--7654839F12.1261071099/deds1124.i2bnetworks.com
Content-Description: Message Headers
Content-Type: text/rfc822-headers

Received: by deds1124.i2bnetworks.com (Postfix, from userid 0)
	id 7654839F12; Thu, 17 Dec 2009 09:31:39 -0800 (PST)
From: root@deds1124.i2bnetworks.com
Subject: probe
To: sometime@deds1124.i2bnetworks.com
Message-Id: <20091217173139.7654839F12@deds1124.i2bnetworks.com>
Date: Thu, 17 Dec 2009 09:31:39 -0800 (PST)

--7654839F12.1261071099/deds1124.i2bnetworks.com--
 
In that message postfix confirms that when "sometime" is the recipient of mail, the mail will be delivered to that mailman command. So that looks good ;)

We still have to see the result of ls -l /usr/local/mailman/mail/mailman ;)
 
Back
Top