Page 1 of 3 123 LastLast
Results 1 to 10 of 23

Thread: mail application for cli script admin task

  1. #1
    Join Date
    Jul 2008
    Location
    Some place in Washington
    Posts
    258

    Default mail application for cli script admin task

    To keep this short, I want my proxy server to receive email from my pop/imap email account into single files. I will write a script which parses the subject or body of the email an performs a task. In this case, allow or deny a web address. What I am visioning is a script which monitors the squid logs for web site usage, which reports new domain usage to my wife an my email address. When replied to allow/deny, I want to parse the received email.

    The issue I am running into is when I setup mail via yast, it uses a single file for all mail an I am not able to parse that very well. What I think I want is 1 email / 1 file / in the user folder (probably in home dir).

    Please help me understand the email solutions. I am willing to write the scrips ( I think... LOL ). I am thinking this will be the easiest solution for my wife to use to make changes to my proxy server remotely.

    Thanks,
    John

  2. #2
    Join Date
    Jul 2008
    Location
    Seattle, WA
    Posts
    17,071

    Default Re: mail application for cli script admin task

    On Wed, 09 Nov 2011 05:56:02 +0000, Johnfm3 wrote:

    > Please help me understand the email solutions.


    Probably the easiest way to do this is set up a pop3 server and have your
    script just poll the pop mailbox for new messages, pull the messages that
    way, and process them.

    ISTR that there's also a way to process incoming mail to a specific
    mailbox on a per-message basis, but I might be thinking of sendmail
    functionality rather than postfix. You might look, though, at how a
    mailing list server software package like mailman handles incoming
    requests (subscribe/unsubscribe/info/etc.) as what you're trying to do is
    similar to those processes.

    Jim

    --
    Jim Henderson
    openSUSE Forums Administrator
    Forum Use Terms & Conditions at http://tinyurl.com/openSUSE-T-C

  3. #3
    Join Date
    Aug 2010
    Location
    Chicago suburbs
    Posts
    12,643
    Blog Entries
    3

    Default Re: mail application for cli script admin task

    You can run "fetchmail" to go to the pop3/imap server and retrieve the mail. I think you can configure "fetchmail" to pass the messages to "procmail", and then you can configure "procmail" to put the mail in mh/nmh mailboxes or maildir mailboxes (mailbox is directory and a message is a file with those two mailbox styles).
    openSUSE Leap 15.1; KDE Plasma 5;
    testing Leap 15.2Alpha

  4. #4
    Join Date
    Feb 2009
    Location
    Spain
    Posts
    25,547

    Default Re: mail application for cli script admin task

    On 2011-11-09 07:26, nrickert wrote:
    >
    > You can run "fetchmail" to go to the pop3/imap server and retrieve the
    > mail. I think you can configure "fetchmail" to pass the messages to
    > "procmail", and then you can configure "procmail" to put the mail in
    > mh/nmh mailboxes or maildir mailboxes (mailbox is directory and a
    > message is a file with those two mailbox styles).


    Absolutely.

    Procmail will get the mails one by one, and if it matches a recipe the
    email can be fed to a script, a single mail, the moment it is received.

    How the mail is really stored doesn't matter.

    --
    Cheers / Saludos,

    Carlos E. R.
    (from 11.4 x86_64 "Celadon" at Telcontar)

  5. #5
    Join Date
    Jul 2008
    Location
    Some place in Washington
    Posts
    258

    Default Re: mail application for cli script admin task

    Is the fetchmail / procmail settings configured via yast mail-server?

    My command line configuration is rough at best, I will say most my successes with linux have been due to YaST ability to complete what I want.

  6. #6
    Join Date
    Jul 2008
    Location
    Some place in Washington
    Posts
    258

    Default Re: mail application for cli script admin task

    Quote Originally Posted by robin_listas View Post

    How the mail is really stored doesn't matter.

    --
    Cheers / Saludos,

    Carlos E. R.
    (from 11.4 x86_64 "Celadon" at Telcontar)
    Are you saying I should plan on processing at the time of bringing the emails down? That is a much cleaner method that I was planning. I was thinking of setting up my scripts in cron to process the the emails during set times.

    John

  7. #7
    Join Date
    Aug 2010
    Location
    Chicago suburbs
    Posts
    12,643
    Blog Entries
    3

    Default Re: mail application for cli script admin task

    Quote Originally Posted by Johnfm3 View Post
    Is the fetchmail / procmail settings configured via yast mail-server?
    I don't think so. Prepare to spend some time with man pages.
    openSUSE Leap 15.1; KDE Plasma 5;
    testing Leap 15.2Alpha

  8. #8
    Join Date
    Feb 2009
    Location
    Spain
    Posts
    25,547

    Default Re: mail application for cli script admin task

    On 2011-11-09 15:16, Johnfm3 wrote:
    >
    > Is the fetchmail / procmail settings configured via yast mail-server?


    fetchmail, yes. Procmail, no. And not server, but client, I think.

    > My command line configuration is rough at best, I will say most my
    > successes with linux have been due to YaST ability to complete what I
    > want.


    For success in Linux administration you need to get your hands dirty on the
    command line :-)

    Both programs have good manual pages with examples, they are easy.

    Fetchmail is a neat application that gets all the email from one or a
    hundred remote mail accounts, on several protocols, and push them onto your
    local mail stack. Traditionally they are sent to the local mail server,
    which can do, for example, antispam filtering, delivering to local mail
    accounts... Or they can be sent directly to procmail.

    Procmail is a very powerful mail filter. The typical use is for
    distribution of one or several mail sources on different mail folders.

    --
    Cheers / Saludos,

    Carlos E. R.
    (from 11.4 x86_64 "Celadon" at Telcontar)

  9. #9
    Join Date
    Jul 2008
    Location
    Seattle, WA
    Posts
    17,071

    Default Re: mail application for cli script admin task

    On Wed, 09 Nov 2011 14:16:02 +0000, Johnfm3 wrote:

    > Is the fetchmail / procmail settings configured via yast mail-server?


    Fetchmail is pretty easy to set up; I don't believe there's a yast plugin
    for it.

    Procmail probably doesn't have a plugin, because it involves a fair bit
    of customization. If you're willing to write the scripts to do the
    parsing, though, doing the setup of procmail should be pretty
    straightforward.

    Jim



    --
    Jim Henderson
    openSUSE Forums Administrator
    Forum Use Terms & Conditions at http://tinyurl.com/openSUSE-T-C

  10. #10
    Join Date
    Feb 2009
    Location
    Spain
    Posts
    25,547

    Default Re: mail application for cli script admin task

    On 2011-11-09 18:49, Jim Henderson wrote:
    > Fetchmail is pretty easy to set up; I don't believe there's a yast plugin
    > for it.


    Not exactly, but if you setup the standard mail setup with YaST, it will
    also configure fetchmail as part of it all. A basic config, that is.

    --
    Cheers / Saludos,

    Carlos E. R.
    (from 11.4 x86_64 "Celadon" at Telcontar)

Page 1 of 3 123 LastLast

Posting Permissions

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