how can I tell the mail command the path to sendmail?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












I would the mail command to use a program other than /usr/sbin/sendmail.

e.g.



$ mail --path=/usr/local/bin/mysendmail someone@somewhere.com


How can I do this?







share|improve this question




















  • What version of mail is this?
    – thrig
    Oct 21 '17 at 4:07










  • @thrig sorry yeah I should have mentioned. BSD-mail package in unbuntu repositories
    – the_velour_fog
    Oct 21 '17 at 4:09














up vote
0
down vote

favorite












I would the mail command to use a program other than /usr/sbin/sendmail.

e.g.



$ mail --path=/usr/local/bin/mysendmail someone@somewhere.com


How can I do this?







share|improve this question




















  • What version of mail is this?
    – thrig
    Oct 21 '17 at 4:07










  • @thrig sorry yeah I should have mentioned. BSD-mail package in unbuntu repositories
    – the_velour_fog
    Oct 21 '17 at 4:09












up vote
0
down vote

favorite









up vote
0
down vote

favorite











I would the mail command to use a program other than /usr/sbin/sendmail.

e.g.



$ mail --path=/usr/local/bin/mysendmail someone@somewhere.com


How can I do this?







share|improve this question












I would the mail command to use a program other than /usr/sbin/sendmail.

e.g.



$ mail --path=/usr/local/bin/mysendmail someone@somewhere.com


How can I do this?









share|improve this question











share|improve this question




share|improve this question










asked Oct 21 '17 at 2:55









the_velour_fog

5,04523153




5,04523153











  • What version of mail is this?
    – thrig
    Oct 21 '17 at 4:07










  • @thrig sorry yeah I should have mentioned. BSD-mail package in unbuntu repositories
    – the_velour_fog
    Oct 21 '17 at 4:09
















  • What version of mail is this?
    – thrig
    Oct 21 '17 at 4:07










  • @thrig sorry yeah I should have mentioned. BSD-mail package in unbuntu repositories
    – the_velour_fog
    Oct 21 '17 at 4:09















What version of mail is this?
– thrig
Oct 21 '17 at 4:07




What version of mail is this?
– thrig
Oct 21 '17 at 4:07












@thrig sorry yeah I should have mentioned. BSD-mail package in unbuntu repositories
– the_velour_fog
Oct 21 '17 at 4:09




@thrig sorry yeah I should have mentioned. BSD-mail package in unbuntu repositories
– the_velour_fog
Oct 21 '17 at 4:09










1 Answer
1






active

oldest

votes

















up vote
1
down vote



accepted










For bsd-mail (which Debian calls the bsd-mailx package) a sendmail option can be set in the ~/.mailrc file:



set sendmail=/root/alternatemailer


Which could instead be ssmtp or something or a simple shell script to test that this even works as documented.



$ cat /root/alternatemailer
#!/bin/sh
cat >> /root/meh
$ rm /root/meh
$ echo foo | mail -s blah nobody@example.org
$ file /root/meh
meh: ASCII text
$





share|improve this answer




















    Your Answer







    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "106"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    convertImagesToLinks: false,
    noModals: false,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













     

    draft saved


    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f399470%2fhow-can-i-tell-the-mail-command-the-path-to-sendmail%23new-answer', 'question_page');

    );

    Post as a guest






























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    1
    down vote



    accepted










    For bsd-mail (which Debian calls the bsd-mailx package) a sendmail option can be set in the ~/.mailrc file:



    set sendmail=/root/alternatemailer


    Which could instead be ssmtp or something or a simple shell script to test that this even works as documented.



    $ cat /root/alternatemailer
    #!/bin/sh
    cat >> /root/meh
    $ rm /root/meh
    $ echo foo | mail -s blah nobody@example.org
    $ file /root/meh
    meh: ASCII text
    $





    share|improve this answer
























      up vote
      1
      down vote



      accepted










      For bsd-mail (which Debian calls the bsd-mailx package) a sendmail option can be set in the ~/.mailrc file:



      set sendmail=/root/alternatemailer


      Which could instead be ssmtp or something or a simple shell script to test that this even works as documented.



      $ cat /root/alternatemailer
      #!/bin/sh
      cat >> /root/meh
      $ rm /root/meh
      $ echo foo | mail -s blah nobody@example.org
      $ file /root/meh
      meh: ASCII text
      $





      share|improve this answer






















        up vote
        1
        down vote



        accepted







        up vote
        1
        down vote



        accepted






        For bsd-mail (which Debian calls the bsd-mailx package) a sendmail option can be set in the ~/.mailrc file:



        set sendmail=/root/alternatemailer


        Which could instead be ssmtp or something or a simple shell script to test that this even works as documented.



        $ cat /root/alternatemailer
        #!/bin/sh
        cat >> /root/meh
        $ rm /root/meh
        $ echo foo | mail -s blah nobody@example.org
        $ file /root/meh
        meh: ASCII text
        $





        share|improve this answer












        For bsd-mail (which Debian calls the bsd-mailx package) a sendmail option can be set in the ~/.mailrc file:



        set sendmail=/root/alternatemailer


        Which could instead be ssmtp or something or a simple shell script to test that this even works as documented.



        $ cat /root/alternatemailer
        #!/bin/sh
        cat >> /root/meh
        $ rm /root/meh
        $ echo foo | mail -s blah nobody@example.org
        $ file /root/meh
        meh: ASCII text
        $






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Oct 21 '17 at 5:44









        thrig

        22.7k12854




        22.7k12854



























             

            draft saved


            draft discarded















































             


            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f399470%2fhow-can-i-tell-the-mail-command-the-path-to-sendmail%23new-answer', 'question_page');

            );

            Post as a guest













































































            Popular posts from this blog

            How to check contact read email or not when send email to Individual?

            Bahrain

            Postfix configuration issue with fips on centos 7; mailgun relay