Professional Web Applications Themes

Sendmail masquerading configuration - FreeBSD

On Thu, 10 Feb 2005 22:14, Ted Mittelstaedt wrote: > Ian Moore wrote: > > On Wed, 9 Feb 2005 17:21, Ted Mittelstaedt wrote: > >> I would probably install src/usr.sbin/ and recompile cron to use > >> the -f flag. The flags are settible in cron/config.h in the source, > >> FreeBSD uses > >> > >> #define MAILARGS "%s -FCronDaemon -odi -oem -oi -t" /*-*/ > >> > >> just change this to > >> > >> #define MAILARGS "%s -FCronDaemon [email]-frootverizon.net[/email] -odi -oem -oi > >> -t" /*-*/ > >> > >> Ted > > > > ...

  1. #1

    Default Re: Sendmail masquerading configuration

    On Thu, 10 Feb 2005 22:14, Ted Mittelstaedt wrote:
    > Ian Moore wrote:
    > > On Wed, 9 Feb 2005 17:21, Ted Mittelstaedt wrote:
    > >> I would probably install src/usr.sbin/ and recompile cron to use
    > >> the -f flag. The flags are settible in cron/config.h in the source,
    > >> FreeBSD uses
    > >>
    > >> #define MAILARGS "%s -FCronDaemon -odi -oem -oi -t" /*-*/
    > >>
    > >> just change this to
    > >>
    > >> #define MAILARGS "%s -FCronDaemon [email]-frootverizon.net[/email] -odi -oem -oi
    > >> -t" /*-*/
    > >>
    > >> Ted
    > >
    > > Thanks, I'll give that a go.
    > > BTW, using C{E} instead if C{E}root plus the MASQUERADE_AS
    > > macro doesn't seem
    > > to work. I didn't try the MASQUERADE_ENVELOPE macro with it though.
    > > Actually, even sending mail as my own local user on the system
    > > ends up with
    > > the hostname added in. Perhaps I'm doing something wrong.
    > > Anyway, from what you've both said, rebuilding cron sounds
    > > like a better
    > > solution. Once I've modified the source, do I just do a make install
    > > from the /usr/src/usr.sbin/cron directory?
    >
    > It would be better to mv the existing cron binary to cron.backup, then
    > copy the cron binary from the build directory. No point in changing
    > anything else, the binary is the only thing that changes.
    Hi,
    Sorry, I'm still having trouble with this - my changes don't seem to
    have had any effect, cron is still sending mail as
    [email]rootinternal.hamcoll.sa.edu.au[/email] (Cron Daemon)
    I think I've done something wrong!

    What I did was:

    #cd /usr/src/usr.sbin/cron/cron
    #ee config.h:
    and I changed the line
    #define MAILARGS "%s -FCronDaemon -odi -oem -oi -t" /*-*/
    to
    #define MAILARGS "%s [email]-Froothamcoll.sa.edu.au[/email] -odi -oem -oi -t" /*-*/

    (I assume the # at the beginning is correct?)

    then I did:
    /usr/src/usr.sbin/cron/cron# cd ..
    /usr/src/usr.sbin/cron# make
    ===> lib
    Warning: Object directory not changed from original
    /usr/src/usr.sbin/cron/lib
    cc -O -pipe -I/usr/src/usr.sbin/cron/lib/../cron -DLOGIN_CAP -c entry.c
    cc -O -pipe -I/usr/src/usr.sbin/cron/lib/../cron -DLOGIN_CAP -c env.c
    cc -O -pipe -I/usr/src/usr.sbin/cron/lib/../cron -DLOGIN_CAP -c misc.c
    building static cron library
    ranlib libcron.a
    ===> cron
    Warning: Object directory not changed from original
    /usr/src/usr.sbin/cron/cron
    cc -O -pipe -DLOGIN_CAP -c cron.c
    cc -O -pipe -DLOGIN_CAP -c database.c
    cc -O -pipe -DLOGIN_CAP -c do_command.c
    cc -O -pipe -DLOGIN_CAP -c job.c
    cc -O -pipe -DLOGIN_CAP -c user.c
    cc -O -pipe -DLOGIN_CAP -c popen.c
    cc -O -pipe -DLOGIN_CAP -o cron cron.o database.o do_command.o job.o
    user.o popen.o /usr/src/usr.sbin/cron/cron/../lib/libcron.a -lutil
    gzip -cn cron.8 > cron.8.gz
    ===> crontab
    Warning: Object directory not changed from original
    /usr/src/usr.sbin/cron/crontab
    cc -O -pipe -I/usr/src/usr.sbin/cron/crontab/../cron -c crontab.c
    cc -O -pipe -I/usr/src/usr.sbin/cron/crontab/../cron -o crontab
    crontab.o /usr/src/usr.sbin/cron/crontab/../lib/libcron.a -lutil
    gzip -cn crontab.1 > crontab.1.gz
    gzip -cn crontab.5 > crontab.5.gz

    (Are the warnings are harmless?)
    Then:
    # /etc/rc.d/cron stop
    # cp /usr/src/usr.sbin/cron/cron/cron /usr/sbin
    # chmod 555 /usr/sbin/cron
    # /etc/rc.d/cron start

    Cheers,
    --
    Ian

    GPG Key: [url]http://home.swiftdsl.com.au/~imoore/no-spam.asc[/url]

    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.4.0 (FreeBSD)

    iD8DBQBCExwKPUlnmbKkJ6ARAqX9AKCXplmNP0llVqGwb9p8lS tXNPHlmgCfYjFq
    tVZ8+5jRqDBxHzwmKc1mUsE=
    =asWK
    -----END PGP SIGNATURE-----

    Ian Moore Guest

  2. #2

    Default RE: Sendmail masquerading configuration


    > -----Original Message-----
    > From: [email]owner-freebsd-questionsfreebsd.org[/email]
    > [mailto:owner-freebsd-questionsfreebsd.org]On Behalf Of Ian Moore
    > Sent: Wednesday, February 16, 2005 2:10 AM
    > To: Ted Mittelstaedt
    > Cc: Ruben de Groot; [email]freebsd-questionsfreebsd.org[/email]
    > Subject: Re: Sendmail masquerading configuration
    >
    >
    > On Thu, 10 Feb 2005 22:14, Ted Mittelstaedt wrote:
    > > Ian Moore wrote:
    > > > On Wed, 9 Feb 2005 17:21, Ted Mittelstaedt wrote:
    > > >> I would probably install src/usr.sbin/ and recompile cron to use
    > > >> the -f flag. The flags are settible in cron/config.h in
    > the source,
    > > >> FreeBSD uses
    > > >>
    > > >> #define MAILARGS "%s -FCronDaemon -odi -oem -oi -t"
    > /*-*/
    > > >>
    > > >> just change this to
    > > >>
    > > >> #define MAILARGS "%s -FCronDaemon [email]-frootverizon.net[/email] -odi -oem -oi
    > > >> -t" /*-*/
    > > >>
    > > >> Ted
    > > >
    > > > Thanks, I'll give that a go.
    >
    > Hi,
    > Sorry, I'm still having trouble with this - my changes don't seem to
    > have had any effect, cron is still sending mail as
    > [email]rootinternal.hamcoll.sa.edu.au[/email] (Cron Daemon)
    > I think I've done something wrong!
    >
    > What I did was:
    >
    > #cd /usr/src/usr.sbin/cron/cron
    > #ee config.h:
    > and I changed the line
    > #define MAILARGS "%s -FCronDaemon -odi -oem -oi -t"
    > /*-*/
    > to
    > #define MAILARGS "%s [email]-Froothamcoll.sa.edu.au[/email] -odi -oem -oi
    > -t" /*-*/
    >
    > (I assume the # at the beginning is correct?)
    >
    Yes. But, the line is incorrect - it needs to be the following:

    #define MAILARGS "%s -FCronDaemon [email]-froothamcoll.sa.edu.au[/email] -odi -oem -oi

    See my earlier posting for this. "man sendmail" also will explain the
    flags a bit as well.

    The rest of the stuff is fine.

    Ted


    Ted Mittelstaedt Guest

  3. #3

    Default Re: Sendmail masquerading configuration

    On Sat, 19 Feb 2005 18:01, Ted Mittelstaedt wrote:
    > > -----Original Message-----
    > > From: [email]owner-freebsd-questionsfreebsd.org[/email]
    > > [mailto:owner-freebsd-questionsfreebsd.org]On Behalf Of Ian Moore
    > > Sent: Wednesday, February 16, 2005 2:10 AM
    > > To: Ted Mittelstaedt
    > > Cc: Ruben de Groot; [email]freebsd-questionsfreebsd.org[/email]
    > > Subject: Re: Sendmail masquerading configuration
    > >
    > > On Thu, 10 Feb 2005 22:14, Ted Mittelstaedt wrote:
    > > > Ian Moore wrote:
    > > > > On Wed, 9 Feb 2005 17:21, Ted Mittelstaedt wrote:
    > > > >> I would probably install src/usr.sbin/ and recompile cron to use
    > > > >> the -f flag. The flags are settible in cron/config.h in
    > >
    > > the source,
    > >
    > > > >> FreeBSD uses
    > > > >>
    > > > >> #define MAILARGS "%s -FCronDaemon -odi -oem -oi -t"
    > >
    > > /*-*/
    > >
    > > > >> just change this to
    > > > >>
    > > > >> #define MAILARGS "%s -FCronDaemon [email]-frootverizon.net[/email] -odi -oem -oi
    > > > >> -t" /*-*/
    > > > >>
    > > > >> Ted
    > > > >
    > > > > Thanks, I'll give that a go.
    > >
    > > Hi,
    > > Sorry, I'm still having trouble with this - my changes don't seem to
    > > have had any effect, cron is still sending mail as
    > > [email]rootinternal.hamcoll.sa.edu.au[/email] (Cron Daemon)
    > > I think I've done something wrong!
    > >
    > > What I did was:
    > >
    > > #cd /usr/src/usr.sbin/cron/cron
    > > #ee config.h:
    > > and I changed the line
    > > #define MAILARGS "%s -FCronDaemon -odi -oem -oi -t"
    > > /*-*/
    > > to
    > > #define MAILARGS "%s [email]-Froothamcoll.sa.edu.au[/email] -odi -oem -oi
    > > -t" /*-*/
    > >
    > > (I assume the # at the beginning is correct?)
    >
    > Yes. But, the line is incorrect - it needs to be the following:
    >
    > #define MAILARGS "%s -FCronDaemon [email]-froothamcoll.sa.edu.au[/email] -odi -oem -oi
    >
    > See my earlier posting for this. "man sendmail" also will explain the
    > flags a bit as well.
    >
    > The rest of the stuff is fine.
    >
    > Ted
    Thanks Ted, - I should have read more carefully.

    Well that sort of works - cron jobs get sent from [email]roothamcoll.sa.edu.au[/email]
    except for the periodic jobs, which are still sent from
    [email]root<hostname>.hamcoll.sa.edu.au[/email]. Perhaps periodic sends the emails itself
    instead of cron, though looking at it's source I can't see how.

    Also, I still need to adjust my sendmail config on the server that is our
    local smtp server. It seems to be putting the hostname back in cron's emails.

    Cheers,
    --
    Ian

    GPG Key: [url]http://home.swiftdsl.com.au/~imoore/no-spam.asc[/url]

    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.4.0 (FreeBSD)

    iD8DBQBCHEyEPUlnmbKkJ6ARAkMtAJ9ZyaAAOar2UBVHvcj5HD JWpgwZjQCghSal
    6ODQsveJ+WPwdRHr+FH8ujk=
    =zFFx
    -----END PGP SIGNATURE-----

    Ian Moore Guest

  4. #4

    Default RE: Sendmail masquerading configuration


    > -----Original Message-----
    > From: Ian Moore [mailto:no-spamswiftdsl.com.au]
    > Sent: Wednesday, February 23, 2005 1:27 AM
    > To: [email]freebsd-questionsfreebsd.org[/email]
    > Cc: Ted Mittelstaedt; Ruben de Groot
    > Subject: Re: Sendmail masquerading configuration
    >
    >
    > On Sat, 19 Feb 2005 18:01, Ted Mittelstaedt wrote:
    > > > -----Original Message-----
    > > > From: [email]owner-freebsd-questionsfreebsd.org[/email]
    > > > [mailto:owner-freebsd-questionsfreebsd.org]On Behalf Of Ian Moore
    > > > Sent: Wednesday, February 16, 2005 2:10 AM
    > > > To: Ted Mittelstaedt
    > > > Cc: Ruben de Groot; [email]freebsd-questionsfreebsd.org[/email]
    > > > Subject: Re: Sendmail masquerading configuration
    > > >
    > > > On Thu, 10 Feb 2005 22:14, Ted Mittelstaedt wrote:
    > > > > Ian Moore wrote:
    > > > > > On Wed, 9 Feb 2005 17:21, Ted Mittelstaedt wrote:
    > > > > >> I would probably install src/usr.sbin/ and recompile
    > cron to use
    > > > > >> the -f flag. The flags are settible in cron/config.h in
    > > >
    > > > the source,
    > > >
    > > > > >> FreeBSD uses
    > > > > >>
    > > > > >> #define MAILARGS "%s -FCronDaemon -odi -oem -oi -t"
    > > >
    > > > /*-*/
    > > >
    > > > > >> just change this to
    > > > > >>
    > > > > >> #define MAILARGS "%s -FCronDaemon [email]-frootverizon.net[/email]
    > -odi -oem -oi
    > > > > >> -t" /*-*/
    > > > > >>
    > > > > >> Ted
    > > > > >
    > > > > > Thanks, I'll give that a go.
    > > >
    > > > Hi,
    > > > Sorry, I'm still having trouble with this - my changes
    > don't seem to
    > > > have had any effect, cron is still sending mail as
    > > > [email]rootinternal.hamcoll.sa.edu.au[/email] (Cron Daemon)
    > > > I think I've done something wrong!
    > > >
    > > > What I did was:
    > > >
    > > > #cd /usr/src/usr.sbin/cron/cron
    > > > #ee config.h:
    > > > and I changed the line
    > > > #define MAILARGS "%s -FCronDaemon -odi -oem -oi -t"
    > > > /*-*/
    > > > to
    > > > #define MAILARGS "%s [email]-Froothamcoll.sa.edu.au[/email] -odi -oem -oi
    > > > -t" /*-*/
    > > >
    > > > (I assume the # at the beginning is correct?)
    > >
    > > Yes. But, the line is incorrect - it needs to be the following:
    > >
    > > #define MAILARGS "%s -FCronDaemon [email]-froothamcoll.sa.edu.au[/email]
    > -odi -oem -oi
    > >
    > > See my earlier posting for this. "man sendmail" also will
    > explain the
    > > flags a bit as well.
    > >
    > > The rest of the stuff is fine.
    > >
    > > Ted
    >
    > Thanks Ted, - I should have read more carefully.
    >
    > Well that sort of works - cron jobs get sent from
    > [email]roothamcoll.sa.edu.au[/email]
    > except for the periodic jobs, which are still sent from
    > [email]root<hostname>.hamcoll.sa.edu.au[/email].
    That might be nothing more than the

    From:

    line in the e-mail. Does the actual received address show:

    [email]root<hostname>.hamcoll.sa.edu.au[/email] <roothamcoll.sa.edu.au>

    or

    [email]root<hostname>.hamcoll.sa.edu.au[/email] <root<hostname>.hamcoll.sa.edu.au>

    If it's the first, then your fine, it is because the periodic
    script is generating the From: line in the body of the e-mail
    message.
    > Perhaps periodic sends the
    > emails itself
    > instead of cron, though looking at it's source I can't see how.
    >
    > Also, I still need to adjust my sendmail config on the server
    > that is our
    > local smtp server. It seems to be putting the hostname back in
    > cron's emails.
    >
    Some masquerading option must be set on it. Once again, check the
    received message to see if the real senders envelope address is getting
    munged, not
    just the From: address.

    Ted

    Ted Mittelstaedt Guest

Similar Threads

  1. watch out for virus masquerading as Microsoft
    By R. Joseph Newton in forum PERL Beginners
    Replies: 0
    Last Post: November 1st, 09:02 AM
  2. [PHP-DEV] sendmail check
    By Sascha Schumann in forum PHP Development
    Replies: 3
    Last Post: October 11th, 08:34 AM
  3. Using Sendmail in ASP
    By Ashish in forum ASP Components
    Replies: 1
    Last Post: July 30th, 06:26 AM
  4. Sendmail
    By Bill Vermillion in forum SCO
    Replies: 0
    Last Post: July 28th, 11:57 PM
  5. Sendmail configuration
    By Dan Phiffer in forum Sun Solaris
    Replies: 2
    Last Post: June 26th, 02:15 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139