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

Thread: mail application for cli script admin task

Hybrid View

  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,076

    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,755
    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

    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

  6. #6
    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.

  7. #7
    Join Date
    Aug 2010
    Location
    Chicago suburbs
    Posts
    12,755
    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
    Aug 2008
    Location
    Behind the 8 ball
    Posts
    116

    Default Re: mail application for cli script admin task

    Stupid question, do you have to use email as your means of triggering these events (allowing/denying a web address)?

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

    Default Re: mail application for cli script admin task

    Quote Originally Posted by jthiatt08 View Post
    Stupid question, do you have to use email as your means of triggering these events (allowing/denying a web address)?
    Sure, my wife is not a system admin. Power user as best. We both work, an email is something we can do from our phones. The problem is while were at work, an the kids ask me to unlock the internet as the proxy is to restrictive for the site they want. My wife or I could send a email an know that within a set time the site will be added to the approved list an the proxy service reloaded. Add to that off work hours while were on the train going to or from work. No use of internet to connect via the Mac's. So SSH is out. Again, email is the one thing we both have almost anywhere. With AT&T, I get email while in the mountains. Pretty nice.

    An why might I not want to use a web page might you ask. Good question. My wife works with at Microsoft for probably the 1 group who doesn't allow personal Internet usage... Which is rough as during my time at the big M$ I had hotmail, jeepforum, an OpenSuSE all open (Shoot, i am at amazon writing this). Further more, whats simpler than just sending a email with a subject of allow an a web domain in the body. An I should be able to set this up to only accept emails from our emails so that the kids dont just send one them self.

    John

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

    Default Re: mail application for cli script admin task

    On 2011-11-09 19:56, Johnfm3 wrote:
    > An I should be able to set this up to only accept emails from our
    > emails so that the kids dont just send one them self.


    They will learn to bypass those limits sooner than you think :-p

    --
    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
  •