Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hi, I have an entry in /etc/aliases to which I would like to filter all outgoing mail. In /etc/mail/virtualuser table I have an entry for 'mydomainname.com'. When I send a mail to multiple 'To' recipients, how is this handled? For example, I can send a mail to several dowmains that are not my own, but when I try to send a mail to my own domain, and to the 'outside world' the script does not work. Any suggestions, or example sendmail wrapper scripts ? Thanks in advance,

Replies are listed 'Best First'.
Re: Sendmail Wrapper
by arhuman (Vicar) on Mar 27, 2001 at 17:53 UTC
    Even if it sounds more like a Sendmail configuration problem, than like a Perl problem, I'm interested !

    Could you please explain a little more what you're trying to do...
    (And give more details than just 'The script doesn't work...')

    Parts of your /etc/aliases, /etc/mail/virtusertable,/etc/sendmail.cw would be useful too....
    (I assume 'standard' path, if you're not sure, your sendmail.cf could be handy to locate the files used...)


    "Trying to be a SMART lamer" (thanx to Merlyn ;-)
Re: Sendmail Wrapper
by jbert (Priest) on Mar 27, 2001 at 18:47 UTC

    If what you want to do is send mail, then a good way of doing this (for me, YMMVOC) is the Net::SMTP module. This allows your script to make a real SMTP connection to either the local machine or another mail server.

    This has the benefits of:

    • You don't need to be co-located with a mail server (but you can be)
    • You are independent of platform or installed mail server software (OK, so most Unixlike SMTP MTAs offer a sendmail-like interface, but why not use the protocol?). It doesn't matter if you are talking to an NT box running Exchange or a Unix MTA.
    • You can specify cool, useful ESMTP options (ask for a delivery report, etc).

    Its easy to use too.