Page 1 of 1

sendmail - collect all account

Posted: Tue Oct 13, 2015 12:18 pm
by uunix
This may be generic and not just IBM AIX specific, but I'm implementing on AIX 7.

Been reading up today, and setup sendmail on my power5 system and all went well, can collect, send etc no problem but..

I wanted to direct any email sent to my domain that is incorrect to be passed to single mailbox.

So, the answer my friends, is virtusertabl & virtusertable.db which I have set up thus:

Code: Select all

# virtusertable
# makemap hash /etc/mail/virtusertable.db < /etc/mail/virtusertable
#
# <email address>   <local account>
@mydomain.com   catchall@mydomain.com


I have created the has db using

Code: Select all

makemap hash /etc/mail/virtusertable.db < /etc/mail/virtusertable
but, I am missing something.

sendmail has been restarted, also sendmail -bi (which I think reads the alias files, not sure.

sendmail.mc

Code: Select all

# /etc/mail/sendmail.mc
FEATURE('virtusertable', 'hash -o /etc/mail/virtusertable.db')dnl


Now, are you meant to to create the sendmail.cf from the sendmail.mc like

Code: Select all

m4 sendmail.cf < sendmail.mc


Been a long time since I messed with sendmail and I don't ever recall configuring it that much.

I suppose, the question is, how does sendmail.cf use sendmail.mc ?

Re: sendmail - collect all account

Posted: Tue Oct 13, 2015 12:19 pm
by uunix
oh and does this conflict with aliases?

Re: sendmail - collect all account

Posted: Tue Oct 13, 2015 6:24 pm
by hamei
uunix, really :( This is a family-oriented group. If you want to play with sendmail in the privacy of your own loft, there's nothing we can do about it. But please, in public ? Think of the children :(

Re: sendmail - collect all account

Posted: Tue Oct 13, 2015 9:42 pm
by ClassicHasClass
Yes, you need to preprocess the file into sendmail.cf. I usually just handwrite my sendmail rules, but I'm certifiable.

Re: sendmail - collect all account

Posted: Tue Oct 13, 2015 11:24 pm
by miod
uunix wrote:Now, are you meant to to create the sendmail.cf from the sendmail.mc like

Code: Select all

m4 sendmail.cf < sendmail.mc

I'm sure you mean

Code: Select all

m4 sendmail.mc > sendmail.cf
here (after making a backup of the previous sendmail.cf first).

Re: sendmail - collect all account

Posted: Wed Oct 14, 2015 1:44 am
by uunix
Yes I know I'm mad and there are other MTA's available, but as Magnus Magnusson used to say 'I've started so I'll finish'...

Can't do anything today since I can't connect, looks like my attempts at creating a NIS master last night failed miserably, or rather, I should have a new guide-line of 'Don't go to bed until you have finished what you are doing'.

Anyway, going back to the m4 sendmail.mc > sendmail.cf,
IF I have just a few lines in my mc files, will it integrate into the complete cf file or will it over-write the cf and leave the cf in the same state as the as the original mc file (a few lines)?

Re: sendmail - collect all account

Posted: Wed Oct 14, 2015 3:35 am
by smj
If I ever touched sendmail on AIX, it was back around 1992 - and nothing remains. Caveat emptor.

On my FreeBSD-based mail server, there's a Makefile in /etc/mail -- when you tweak the sendmail.mc file you should be able to run the command "make cf" and it will invoke m4 with whatever it needs to pull in the supporting files.

What a given .mc file produces depends on what's in the .mc file, in terms of OSTYPE, FEATUREs, etc. If you invoke the right things, you'll get a long and functional .cf file. Try to find where AIX has put all the mc files that shipped with sendmail - FreeBSD puts them under /usr/share/sendmail/cf. Look for a README there. Some sample .mc files are in /usr/share/sendmail/cf/cf.

For virtusertable to work, you may need the domain being rewritten to be listed in the text file /etc/mail/local-host-names. Check the file /etc/mail/virtusertable.sample if you have it. Better, grep for "virtuser" in the IBM-supplied sendmail.mc if you have it.

Re: sendmail - collect all account

Posted: Wed Oct 14, 2015 3:38 am
by miod
uunix wrote:Anyway, going back to the m4 sendmail.mc > sendmail.cf,
IF I have just a few lines in my mc files, will it integrate into the complete cf file or will it over-write the cf and leave the cf in the same state as the as the original mc file (a few lines)?

Il will overwrite the file, of course - that's what shell redirections do.

The usual Idiom will however be something like

Code: Select all

m4 -D_CF_DIR=/wherever/ /wherever/m4/cf.m4 sendmail.mc > sendmail.cf
, as the .mc macros need to be defined somewhere. Replace /wherever with the directory name of the sendmail configuration machinery.

Re: sendmail - collect all account

Posted: Sat Oct 17, 2015 12:57 pm
by uunix
OK so I have my IBM back up and running, I had in fact messed up NIS, but not sure how. I found an interesting titbit that may be useful for AIX users setting up NIS that reverts back to local if your domain cannot be found or you just fsck it up.
add the following to /etc/environment
YPBIND_MAXWAIT=300

When nis is not availeble after 5 minutes the system will start and will use local access.


And another note, although I mentioned that the KVM works with USB on my 285 but the focus MUST be on the IBM at power on, selecting a different prom/boot option doesn't work and you have connect a USB keyboard directly if you need to boot single user (or use any of the other options).

Now I'm back up and running I will be re-addressing the evils of Sendmail whilst I attempt to acknowledge and admit the fact I'm actually watching Dr Who because of his good looking assistant and not the actual show!

Re: sendmail - collect all account

Posted: Fri Oct 23, 2015 4:36 pm
by vishnu
Vladio wrote:I'm actually watching Dr Who because of his good looking assistant...
Dude, the Doctor has companions not assistants. It's hamei who has an "assistant"... :lol:

Re: sendmail - collect all account

Posted: Fri Oct 23, 2015 5:21 pm
by uunix
vishnu wrote:
Vladio wrote:I'm actually watching Dr Who because of his good looking assistant...
Dude, the Doctor has companions not assistants. It's hamei who has an "assistant"... :lol:

Not according to John Pertwee .. maybe hamei is Dr Who..........

Re: sendmail - collect all account

Posted: Sun Oct 25, 2015 10:40 am
by vishnu
uunix wrote:[ot according to John Pertwee ..

Ah, Jon Pertwee! There, fixed that for ya... ;) I for one have vivid recollections of his assistant Jo Grant as portrayed by the ever lovely Katy Manning.